internal/protocoltest/awsrestjson/serializers.go (7,950 lines of code) (raw):
// Code generated by smithy-go-codegen DO NOT EDIT.
package awsrestjson
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"github.com/aws/aws-sdk-go-v2/internal/protocoltest/awsrestjson/document"
internaldocument "github.com/aws/aws-sdk-go-v2/internal/protocoltest/awsrestjson/internal/document"
"github.com/aws/aws-sdk-go-v2/internal/protocoltest/awsrestjson/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
"github.com/aws/smithy-go/tracing"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
"net/http"
"strconv"
"strings"
"time"
)
type awsRestjson1_serializeOpAllQueryStringTypes struct {
}
func (*awsRestjson1_serializeOpAllQueryStringTypes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAllQueryStringTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AllQueryStringTypesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/AllQueryStringTypesInput")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsAllQueryStringTypesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsAllQueryStringTypesInput(v *AllQueryStringTypesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.QueryBoolean != nil {
encoder.SetQuery("Boolean").Boolean(*v.QueryBoolean)
}
if v.QueryBooleanList != nil {
for i := range v.QueryBooleanList {
encoder.AddQuery("BooleanList").Boolean(v.QueryBooleanList[i])
}
}
if v.QueryByte != nil {
encoder.SetQuery("Byte").Byte(*v.QueryByte)
}
if v.QueryDouble != nil {
encoder.SetQuery("Double").Double(*v.QueryDouble)
}
if v.QueryDoubleList != nil {
for i := range v.QueryDoubleList {
encoder.AddQuery("DoubleList").Double(v.QueryDoubleList[i])
}
}
if len(v.QueryEnum) > 0 {
encoder.SetQuery("Enum").String(string(v.QueryEnum))
}
if v.QueryEnumList != nil {
for i := range v.QueryEnumList {
encoder.AddQuery("EnumList").String(string(v.QueryEnumList[i]))
}
}
if v.QueryFloat != nil {
encoder.SetQuery("Float").Float(*v.QueryFloat)
}
if v.QueryInteger != nil {
encoder.SetQuery("Integer").Integer(*v.QueryInteger)
}
if v.QueryIntegerEnum != 0 {
encoder.SetQuery("IntegerEnum").Integer(v.QueryIntegerEnum)
}
if v.QueryIntegerEnumList != nil {
for i := range v.QueryIntegerEnumList {
encoder.AddQuery("IntegerEnumList").Integer(v.QueryIntegerEnumList[i])
}
}
if v.QueryIntegerList != nil {
for i := range v.QueryIntegerList {
encoder.AddQuery("IntegerList").Integer(v.QueryIntegerList[i])
}
}
if v.QueryIntegerSet != nil {
for i := range v.QueryIntegerSet {
encoder.AddQuery("IntegerSet").Integer(v.QueryIntegerSet[i])
}
}
if v.QueryLong != nil {
encoder.SetQuery("Long").Long(*v.QueryLong)
}
if v.QueryParamsMapOfStringList != nil {
for qkey, qvalue := range v.QueryParamsMapOfStringList {
if encoder.HasQuery(qkey) {
continue
}
for i := range qvalue {
encoder.AddQuery(qkey).String(qvalue[i])
}
}
}
if v.QueryShort != nil {
encoder.SetQuery("Short").Short(*v.QueryShort)
}
if v.QueryString != nil {
encoder.SetQuery("String").String(*v.QueryString)
}
if v.QueryStringList != nil {
for i := range v.QueryStringList {
encoder.AddQuery("StringList").String(v.QueryStringList[i])
}
}
if v.QueryStringSet != nil {
for i := range v.QueryStringSet {
encoder.AddQuery("StringSet").String(v.QueryStringSet[i])
}
}
if v.QueryTimestamp != nil {
encoder.SetQuery("Timestamp").String(smithytime.FormatDateTime(*v.QueryTimestamp))
}
if v.QueryTimestampList != nil {
for i := range v.QueryTimestampList {
encoder.AddQuery("TimestampList").String(smithytime.FormatDateTime(v.QueryTimestampList[i]))
}
}
return nil
}
type awsRestjson1_serializeOpConstantAndVariableQueryString struct {
}
func (*awsRestjson1_serializeOpConstantAndVariableQueryString) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpConstantAndVariableQueryString) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ConstantAndVariableQueryStringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ConstantAndVariableQueryString?foo=bar")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsConstantAndVariableQueryStringInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsConstantAndVariableQueryStringInput(v *ConstantAndVariableQueryStringInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Baz != nil {
encoder.SetQuery("baz").String(*v.Baz)
}
if v.MaybeSet != nil {
encoder.SetQuery("maybeSet").String(*v.MaybeSet)
}
return nil
}
type awsRestjson1_serializeOpConstantQueryString struct {
}
func (*awsRestjson1_serializeOpConstantQueryString) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpConstantQueryString) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ConstantQueryStringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ConstantQueryString/{hello}?foo=bar&hello")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsConstantQueryStringInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsConstantQueryStringInput(v *ConstantQueryStringInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Hello == nil || len(*v.Hello) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member hello must not be empty")}
}
if v.Hello != nil {
if err := encoder.SetURI("hello").String(*v.Hello); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpContentTypeParameters struct {
}
func (*awsRestjson1_serializeOpContentTypeParameters) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpContentTypeParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ContentTypeParametersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ContentTypeParameters")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentContentTypeParametersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsContentTypeParametersInput(v *ContentTypeParametersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentContentTypeParametersInput(v *ContentTypeParametersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Value != nil {
ok := object.Key("value")
ok.Integer(*v.Value)
}
return nil
}
type awsRestjson1_serializeOpDatetimeOffsets struct {
}
func (*awsRestjson1_serializeOpDatetimeOffsets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDatetimeOffsets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DatetimeOffsetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DatetimeOffsets")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDatetimeOffsetsInput(v *DatetimeOffsetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDocumentType struct {
}
func (*awsRestjson1_serializeOpDocumentType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDocumentType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DocumentTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DocumentType")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDocumentTypeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDocumentTypeInput(v *DocumentTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDocumentTypeInput(v *DocumentTypeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DocumentValue != nil {
ok := object.Key("documentValue")
if err := awsRestjson1_serializeDocumentDocument(v.DocumentValue, ok); err != nil {
return err
}
}
if v.StringValue != nil {
ok := object.Key("stringValue")
ok.String(*v.StringValue)
}
return nil
}
type awsRestjson1_serializeOpDocumentTypeAsMapValue struct {
}
func (*awsRestjson1_serializeOpDocumentTypeAsMapValue) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDocumentTypeAsMapValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DocumentTypeAsMapValueInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DocumentTypeAsMapValue")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDocumentTypeAsMapValueInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDocumentTypeAsMapValueInput(v *DocumentTypeAsMapValueInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDocumentTypeAsMapValueInput(v *DocumentTypeAsMapValueInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DocValuedMap != nil {
ok := object.Key("docValuedMap")
if err := awsRestjson1_serializeDocumentDocumentValuedMap(v.DocValuedMap, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDocumentTypeAsPayload struct {
}
func (*awsRestjson1_serializeOpDocumentTypeAsPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDocumentTypeAsPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DocumentTypeAsPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/DocumentTypeAsPayload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/json")
}
if input.DocumentValue != nil {
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentDocument(input.DocumentValue, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(jsonEncoder.Bytes())
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDocumentTypeAsPayloadInput(v *DocumentTypeAsPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpEmptyInputAndEmptyOutput struct {
}
func (*awsRestjson1_serializeOpEmptyInputAndEmptyOutput) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpEmptyInputAndEmptyOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EmptyInputAndEmptyOutputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/EmptyInputAndEmptyOutput")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsEmptyInputAndEmptyOutputInput(v *EmptyInputAndEmptyOutputInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpEndpointOperation struct {
}
func (*awsRestjson1_serializeOpEndpointOperation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpEndpointOperation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EndpointOperationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/EndpointOperation")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsEndpointOperationInput(v *EndpointOperationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpEndpointWithHostLabelOperation struct {
}
func (*awsRestjson1_serializeOpEndpointWithHostLabelOperation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpEndpointWithHostLabelOperation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EndpointWithHostLabelOperationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/EndpointWithHostLabelOperation")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentEndpointWithHostLabelOperationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsEndpointWithHostLabelOperationInput(v *EndpointWithHostLabelOperationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentEndpointWithHostLabelOperationInput(v *EndpointWithHostLabelOperationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Label != nil {
ok := object.Key("label")
ok.String(*v.Label)
}
return nil
}
type awsRestjson1_serializeOpFractionalSeconds struct {
}
func (*awsRestjson1_serializeOpFractionalSeconds) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpFractionalSeconds) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*FractionalSecondsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/FractionalSeconds")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsFractionalSecondsInput(v *FractionalSecondsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpGreetingWithErrors struct {
}
func (*awsRestjson1_serializeOpGreetingWithErrors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGreetingWithErrors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GreetingWithErrorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/GreetingWithErrors")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGreetingWithErrorsInput(v *GreetingWithErrorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpHostWithPathOperation struct {
}
func (*awsRestjson1_serializeOpHostWithPathOperation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHostWithPathOperation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HostWithPathOperationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HostWithPathOperation")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHostWithPathOperationInput(v *HostWithPathOperationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpHttpChecksumRequired struct {
}
func (*awsRestjson1_serializeOpHttpChecksumRequired) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpChecksumRequired) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpChecksumRequiredInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpChecksumRequired")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentHttpChecksumRequiredInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpChecksumRequiredInput(v *HttpChecksumRequiredInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentHttpChecksumRequiredInput(v *HttpChecksumRequiredInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Foo != nil {
ok := object.Key("foo")
ok.String(*v.Foo)
}
return nil
}
type awsRestjson1_serializeOpHttpEnumPayload struct {
}
func (*awsRestjson1_serializeOpHttpEnumPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpEnumPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpEnumPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/EnumPayload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("text/plain")
}
if len(input.Payload) > 0 {
payload := strings.NewReader(string(input.Payload))
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpEnumPayloadInput(v *HttpEnumPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpHttpPayloadTraits struct {
}
func (*awsRestjson1_serializeOpHttpPayloadTraits) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpPayloadTraits) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpPayloadTraitsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpPayloadTraits")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpPayloadTraitsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.Blob != nil {
payload := bytes.NewReader(input.Blob)
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpPayloadTraitsInput(v *HttpPayloadTraitsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
locationName := "X-Foo"
encoder.SetHeader(locationName).String(*v.Foo)
}
return nil
}
type awsRestjson1_serializeOpHttpPayloadTraitsWithMediaType struct {
}
func (*awsRestjson1_serializeOpHttpPayloadTraitsWithMediaType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpPayloadTraitsWithMediaType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpPayloadTraitsWithMediaTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpPayloadTraitsWithMediaType")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpPayloadTraitsWithMediaTypeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("text/plain")
}
if input.Blob != nil {
payload := bytes.NewReader(input.Blob)
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpPayloadTraitsWithMediaTypeInput(v *HttpPayloadTraitsWithMediaTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
locationName := "X-Foo"
encoder.SetHeader(locationName).String(*v.Foo)
}
return nil
}
type awsRestjson1_serializeOpHttpPayloadWithStructure struct {
}
func (*awsRestjson1_serializeOpHttpPayloadWithStructure) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpPayloadWithStructure) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpPayloadWithStructureInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpPayloadWithStructure")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/json")
}
if input.Nested != nil {
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentNestedPayload(input.Nested, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(jsonEncoder.Bytes())
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
} else {
jsonEncoder := smithyjson.NewEncoder()
jsonEncoder.Value.Object().Close()
payload := bytes.NewReader(jsonEncoder.Bytes())
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpPayloadWithStructureInput(v *HttpPayloadWithStructureInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpHttpPayloadWithUnion struct {
}
func (*awsRestjson1_serializeOpHttpPayloadWithUnion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpPayloadWithUnion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpPayloadWithUnionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpPayloadWithUnion")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/json")
}
if input.Nested != nil {
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentUnionPayload(input.Nested, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(jsonEncoder.Bytes())
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpPayloadWithUnionInput(v *HttpPayloadWithUnionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpHttpPrefixHeaders struct {
}
func (*awsRestjson1_serializeOpHttpPrefixHeaders) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpPrefixHeaders) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpPrefixHeadersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpPrefixHeaders")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpPrefixHeadersInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpPrefixHeadersInput(v *HttpPrefixHeadersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
locationName := "X-Foo"
encoder.SetHeader(locationName).String(*v.Foo)
}
if v.FooMap != nil {
hv := encoder.Headers("X-Foo-")
for mapKey, mapVal := range v.FooMap {
hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal)
}
}
return nil
}
type awsRestjson1_serializeOpHttpPrefixHeadersInResponse struct {
}
func (*awsRestjson1_serializeOpHttpPrefixHeadersInResponse) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpPrefixHeadersInResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpPrefixHeadersInResponseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpPrefixHeadersResponse")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpPrefixHeadersInResponseInput(v *HttpPrefixHeadersInResponseInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpHttpRequestWithFloatLabels struct {
}
func (*awsRestjson1_serializeOpHttpRequestWithFloatLabels) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpRequestWithFloatLabels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpRequestWithFloatLabelsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/FloatHttpLabels/{float}/{double}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpRequestWithFloatLabelsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpRequestWithFloatLabelsInput(v *HttpRequestWithFloatLabelsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Double == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member double must not be empty")}
}
if v.Double != nil {
if err := encoder.SetURI("double").Double(*v.Double); err != nil {
return err
}
}
if v.Float == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member float must not be empty")}
}
if v.Float != nil {
if err := encoder.SetURI("float").Float(*v.Float); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpHttpRequestWithGreedyLabelInPath struct {
}
func (*awsRestjson1_serializeOpHttpRequestWithGreedyLabelInPath) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpRequestWithGreedyLabelInPath) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpRequestWithGreedyLabelInPathInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpRequestWithGreedyLabelInPathInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpRequestWithGreedyLabelInPathInput(v *HttpRequestWithGreedyLabelInPathInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Baz == nil || len(*v.Baz) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member baz must not be empty")}
}
if v.Baz != nil {
if err := encoder.SetURI("baz").String(*v.Baz); err != nil {
return err
}
}
if v.Foo == nil || len(*v.Foo) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member foo must not be empty")}
}
if v.Foo != nil {
if err := encoder.SetURI("foo").String(*v.Foo); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpHttpRequestWithLabels struct {
}
func (*awsRestjson1_serializeOpHttpRequestWithLabels) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpRequestWithLabels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpRequestWithLabelsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpRequestWithLabelsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpRequestWithLabelsInput(v *HttpRequestWithLabelsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Boolean == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member boolean must not be empty")}
}
if v.Boolean != nil {
if err := encoder.SetURI("boolean").Boolean(*v.Boolean); err != nil {
return err
}
}
if v.Double == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member double must not be empty")}
}
if v.Double != nil {
if err := encoder.SetURI("double").Double(*v.Double); err != nil {
return err
}
}
if v.Float == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member float must not be empty")}
}
if v.Float != nil {
if err := encoder.SetURI("float").Float(*v.Float); err != nil {
return err
}
}
if v.Integer == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member integer must not be empty")}
}
if v.Integer != nil {
if err := encoder.SetURI("integer").Integer(*v.Integer); err != nil {
return err
}
}
if v.Long == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member long must not be empty")}
}
if v.Long != nil {
if err := encoder.SetURI("long").Long(*v.Long); err != nil {
return err
}
}
if v.Short == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member short must not be empty")}
}
if v.Short != nil {
if err := encoder.SetURI("short").Short(*v.Short); err != nil {
return err
}
}
if v.String_ == nil || len(*v.String_) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member string must not be empty")}
}
if v.String_ != nil {
if err := encoder.SetURI("string").String(*v.String_); err != nil {
return err
}
}
if v.Timestamp == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member timestamp must not be empty")}
}
if v.Timestamp != nil {
if err := encoder.SetURI("timestamp").String(smithytime.FormatDateTime(*v.Timestamp)); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpHttpRequestWithLabelsAndTimestampFormat struct {
}
func (*awsRestjson1_serializeOpHttpRequestWithLabelsAndTimestampFormat) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpRequestWithLabelsAndTimestampFormat) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpRequestWithLabelsAndTimestampFormatInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpRequestWithLabelsAndTimestampFormatInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpRequestWithLabelsAndTimestampFormatInput(v *HttpRequestWithLabelsAndTimestampFormatInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DefaultFormat == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member defaultFormat must not be empty")}
}
if v.DefaultFormat != nil {
if err := encoder.SetURI("defaultFormat").String(smithytime.FormatDateTime(*v.DefaultFormat)); err != nil {
return err
}
}
if v.MemberDateTime == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member memberDateTime must not be empty")}
}
if v.MemberDateTime != nil {
if err := encoder.SetURI("memberDateTime").String(smithytime.FormatDateTime(*v.MemberDateTime)); err != nil {
return err
}
}
if v.MemberEpochSeconds == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member memberEpochSeconds must not be empty")}
}
if v.MemberEpochSeconds != nil {
if err := encoder.SetURI("memberEpochSeconds").Double(smithytime.FormatEpochSeconds(*v.MemberEpochSeconds)); err != nil {
return err
}
}
if v.MemberHttpDate == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member memberHttpDate must not be empty")}
}
if v.MemberHttpDate != nil {
if err := encoder.SetURI("memberHttpDate").String(smithytime.FormatHTTPDate(*v.MemberHttpDate)); err != nil {
return err
}
}
if v.TargetDateTime == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member targetDateTime must not be empty")}
}
if v.TargetDateTime != nil {
if err := encoder.SetURI("targetDateTime").String(smithytime.FormatDateTime(*v.TargetDateTime)); err != nil {
return err
}
}
if v.TargetEpochSeconds == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member targetEpochSeconds must not be empty")}
}
if v.TargetEpochSeconds != nil {
if err := encoder.SetURI("targetEpochSeconds").Double(smithytime.FormatEpochSeconds(*v.TargetEpochSeconds)); err != nil {
return err
}
}
if v.TargetHttpDate == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member targetHttpDate must not be empty")}
}
if v.TargetHttpDate != nil {
if err := encoder.SetURI("targetHttpDate").String(smithytime.FormatHTTPDate(*v.TargetHttpDate)); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpHttpRequestWithRegexLiteral struct {
}
func (*awsRestjson1_serializeOpHttpRequestWithRegexLiteral) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpRequestWithRegexLiteral) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpRequestWithRegexLiteralInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/ReDosLiteral/{str}/(a+)+")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsHttpRequestWithRegexLiteralInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpRequestWithRegexLiteralInput(v *HttpRequestWithRegexLiteralInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Str == nil || len(*v.Str) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member str must not be empty")}
}
if v.Str != nil {
if err := encoder.SetURI("str").String(*v.Str); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpHttpResponseCode struct {
}
func (*awsRestjson1_serializeOpHttpResponseCode) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpResponseCode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpResponseCodeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/HttpResponseCode")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpResponseCodeInput(v *HttpResponseCodeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpHttpStringPayload struct {
}
func (*awsRestjson1_serializeOpHttpStringPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpHttpStringPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*HttpStringPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/StringPayload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("text/plain")
}
if input.Payload != nil {
payload := strings.NewReader(*input.Payload)
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsHttpStringPayloadInput(v *HttpStringPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpIgnoreQueryParamsInResponse struct {
}
func (*awsRestjson1_serializeOpIgnoreQueryParamsInResponse) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpIgnoreQueryParamsInResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*IgnoreQueryParamsInResponseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/IgnoreQueryParamsInResponse")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsIgnoreQueryParamsInResponseInput(v *IgnoreQueryParamsInResponseInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpInputAndOutputWithHeaders struct {
}
func (*awsRestjson1_serializeOpInputAndOutputWithHeaders) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpInputAndOutputWithHeaders) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*InputAndOutputWithHeadersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/InputAndOutputWithHeaders")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsInputAndOutputWithHeadersInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsInputAndOutputWithHeadersInput(v *InputAndOutputWithHeadersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.HeaderBooleanList != nil {
locationName := "X-Booleanlist"
if len(v.HeaderBooleanList) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.HeaderBooleanList {
{
encoder.AddHeader(locationName).Boolean(v.HeaderBooleanList[i])
}
}
}
if v.HeaderByte != nil {
locationName := "X-Byte"
encoder.SetHeader(locationName).Byte(*v.HeaderByte)
}
if v.HeaderDouble != nil {
locationName := "X-Double"
encoder.SetHeader(locationName).Double(*v.HeaderDouble)
}
if len(v.HeaderEnum) > 0 {
locationName := "X-Enum"
encoder.SetHeader(locationName).String(string(v.HeaderEnum))
}
if v.HeaderEnumList != nil {
locationName := "X-Enumlist"
if len(v.HeaderEnumList) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.HeaderEnumList {
if len(v.HeaderEnumList[i]) > 0 {
escaped := string(v.HeaderEnumList[i])
if strings.Index(string(v.HeaderEnumList[i]), `,`) != -1 || strings.Index(string(v.HeaderEnumList[i]), `"`) != -1 {
escaped = strconv.Quote(string(v.HeaderEnumList[i]))
}
encoder.AddHeader(locationName).String(string(escaped))
}
}
}
if v.HeaderFalseBool != nil {
locationName := "X-Boolean2"
encoder.SetHeader(locationName).Boolean(*v.HeaderFalseBool)
}
if v.HeaderFloat != nil {
locationName := "X-Float"
encoder.SetHeader(locationName).Float(*v.HeaderFloat)
}
if v.HeaderInteger != nil {
locationName := "X-Integer"
encoder.SetHeader(locationName).Integer(*v.HeaderInteger)
}
if v.HeaderIntegerEnum != 0 {
locationName := "X-Integerenum"
encoder.SetHeader(locationName).Integer(v.HeaderIntegerEnum)
}
if v.HeaderIntegerEnumList != nil {
locationName := "X-Integerenumlist"
if len(v.HeaderIntegerEnumList) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.HeaderIntegerEnumList {
{
encoder.AddHeader(locationName).Integer(v.HeaderIntegerEnumList[i])
}
}
}
if v.HeaderIntegerList != nil {
locationName := "X-Integerlist"
if len(v.HeaderIntegerList) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.HeaderIntegerList {
{
encoder.AddHeader(locationName).Integer(v.HeaderIntegerList[i])
}
}
}
if v.HeaderLong != nil {
locationName := "X-Long"
encoder.SetHeader(locationName).Long(*v.HeaderLong)
}
if v.HeaderShort != nil {
locationName := "X-Short"
encoder.SetHeader(locationName).Short(*v.HeaderShort)
}
if v.HeaderString != nil {
locationName := "X-String"
encoder.SetHeader(locationName).String(*v.HeaderString)
}
if v.HeaderStringList != nil {
locationName := "X-Stringlist"
if len(v.HeaderStringList) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.HeaderStringList {
if len(v.HeaderStringList[i]) > 0 {
escaped := v.HeaderStringList[i]
if strings.Index(v.HeaderStringList[i], `,`) != -1 || strings.Index(v.HeaderStringList[i], `"`) != -1 {
escaped = strconv.Quote(v.HeaderStringList[i])
}
encoder.AddHeader(locationName).String(escaped)
}
}
}
if v.HeaderStringSet != nil {
locationName := "X-Stringset"
if len(v.HeaderStringSet) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.HeaderStringSet {
if len(v.HeaderStringSet[i]) > 0 {
escaped := v.HeaderStringSet[i]
if strings.Index(v.HeaderStringSet[i], `,`) != -1 || strings.Index(v.HeaderStringSet[i], `"`) != -1 {
escaped = strconv.Quote(v.HeaderStringSet[i])
}
encoder.AddHeader(locationName).String(escaped)
}
}
}
if v.HeaderTimestampList != nil {
locationName := "X-Timestamplist"
if len(v.HeaderTimestampList) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.HeaderTimestampList {
{
encoder.AddHeader(locationName).String(smithytime.FormatHTTPDate(v.HeaderTimestampList[i]))
}
}
}
if v.HeaderTrueBool != nil {
locationName := "X-Boolean1"
encoder.SetHeader(locationName).Boolean(*v.HeaderTrueBool)
}
return nil
}
type awsRestjson1_serializeOpJsonBlobs struct {
}
func (*awsRestjson1_serializeOpJsonBlobs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpJsonBlobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JsonBlobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/JsonBlobs")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentJsonBlobsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsJsonBlobsInput(v *JsonBlobsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentJsonBlobsInput(v *JsonBlobsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("data")
ok.Base64EncodeBytes(v.Data)
}
return nil
}
type awsRestjson1_serializeOpJsonEnums struct {
}
func (*awsRestjson1_serializeOpJsonEnums) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpJsonEnums) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JsonEnumsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/JsonEnums")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentJsonEnumsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsJsonEnumsInput(v *JsonEnumsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentJsonEnumsInput(v *JsonEnumsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.FooEnum1) > 0 {
ok := object.Key("fooEnum1")
ok.String(string(v.FooEnum1))
}
if len(v.FooEnum2) > 0 {
ok := object.Key("fooEnum2")
ok.String(string(v.FooEnum2))
}
if len(v.FooEnum3) > 0 {
ok := object.Key("fooEnum3")
ok.String(string(v.FooEnum3))
}
if v.FooEnumList != nil {
ok := object.Key("fooEnumList")
if err := awsRestjson1_serializeDocumentFooEnumList(v.FooEnumList, ok); err != nil {
return err
}
}
if v.FooEnumMap != nil {
ok := object.Key("fooEnumMap")
if err := awsRestjson1_serializeDocumentFooEnumMap(v.FooEnumMap, ok); err != nil {
return err
}
}
if v.FooEnumSet != nil {
ok := object.Key("fooEnumSet")
if err := awsRestjson1_serializeDocumentFooEnumSet(v.FooEnumSet, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpJsonIntEnums struct {
}
func (*awsRestjson1_serializeOpJsonIntEnums) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpJsonIntEnums) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JsonIntEnumsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/JsonIntEnums")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentJsonIntEnumsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsJsonIntEnumsInput(v *JsonIntEnumsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentJsonIntEnumsInput(v *JsonIntEnumsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntegerEnum1 != 0 {
ok := object.Key("integerEnum1")
ok.Integer(v.IntegerEnum1)
}
if v.IntegerEnum2 != 0 {
ok := object.Key("integerEnum2")
ok.Integer(v.IntegerEnum2)
}
if v.IntegerEnum3 != 0 {
ok := object.Key("integerEnum3")
ok.Integer(v.IntegerEnum3)
}
if v.IntegerEnumList != nil {
ok := object.Key("integerEnumList")
if err := awsRestjson1_serializeDocumentIntegerEnumList(v.IntegerEnumList, ok); err != nil {
return err
}
}
if v.IntegerEnumMap != nil {
ok := object.Key("integerEnumMap")
if err := awsRestjson1_serializeDocumentIntegerEnumMap(v.IntegerEnumMap, ok); err != nil {
return err
}
}
if v.IntegerEnumSet != nil {
ok := object.Key("integerEnumSet")
if err := awsRestjson1_serializeDocumentIntegerEnumSet(v.IntegerEnumSet, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpJsonLists struct {
}
func (*awsRestjson1_serializeOpJsonLists) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpJsonLists) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JsonListsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/JsonLists")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentJsonListsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsJsonListsInput(v *JsonListsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentJsonListsInput(v *JsonListsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BooleanList != nil {
ok := object.Key("booleanList")
if err := awsRestjson1_serializeDocumentBooleanList(v.BooleanList, ok); err != nil {
return err
}
}
if v.EnumList != nil {
ok := object.Key("enumList")
if err := awsRestjson1_serializeDocumentFooEnumList(v.EnumList, ok); err != nil {
return err
}
}
if v.IntegerList != nil {
ok := object.Key("integerList")
if err := awsRestjson1_serializeDocumentIntegerList(v.IntegerList, ok); err != nil {
return err
}
}
if v.IntEnumList != nil {
ok := object.Key("intEnumList")
if err := awsRestjson1_serializeDocumentIntegerEnumList(v.IntEnumList, ok); err != nil {
return err
}
}
if v.NestedStringList != nil {
ok := object.Key("nestedStringList")
if err := awsRestjson1_serializeDocumentNestedStringList(v.NestedStringList, ok); err != nil {
return err
}
}
if v.StringList != nil {
ok := object.Key("stringList")
if err := awsRestjson1_serializeDocumentStringList(v.StringList, ok); err != nil {
return err
}
}
if v.StringSet != nil {
ok := object.Key("stringSet")
if err := awsRestjson1_serializeDocumentStringSet(v.StringSet, ok); err != nil {
return err
}
}
if v.StructureList != nil {
ok := object.Key("myStructureList")
if err := awsRestjson1_serializeDocumentStructureList(v.StructureList, ok); err != nil {
return err
}
}
if v.TimestampList != nil {
ok := object.Key("timestampList")
if err := awsRestjson1_serializeDocumentTimestampList(v.TimestampList, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpJsonMaps struct {
}
func (*awsRestjson1_serializeOpJsonMaps) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpJsonMaps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JsonMapsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/JsonMaps")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentJsonMapsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsJsonMapsInput(v *JsonMapsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentJsonMapsInput(v *JsonMapsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DenseBooleanMap != nil {
ok := object.Key("denseBooleanMap")
if err := awsRestjson1_serializeDocumentDenseBooleanMap(v.DenseBooleanMap, ok); err != nil {
return err
}
}
if v.DenseNumberMap != nil {
ok := object.Key("denseNumberMap")
if err := awsRestjson1_serializeDocumentDenseNumberMap(v.DenseNumberMap, ok); err != nil {
return err
}
}
if v.DenseSetMap != nil {
ok := object.Key("denseSetMap")
if err := awsRestjson1_serializeDocumentDenseSetMap(v.DenseSetMap, ok); err != nil {
return err
}
}
if v.DenseStringMap != nil {
ok := object.Key("denseStringMap")
if err := awsRestjson1_serializeDocumentDenseStringMap(v.DenseStringMap, ok); err != nil {
return err
}
}
if v.DenseStructMap != nil {
ok := object.Key("denseStructMap")
if err := awsRestjson1_serializeDocumentDenseStructMap(v.DenseStructMap, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpJsonTimestamps struct {
}
func (*awsRestjson1_serializeOpJsonTimestamps) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpJsonTimestamps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JsonTimestampsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/JsonTimestamps")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentJsonTimestampsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsJsonTimestampsInput(v *JsonTimestampsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentJsonTimestampsInput(v *JsonTimestampsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DateTime != nil {
ok := object.Key("dateTime")
ok.String(smithytime.FormatDateTime(*v.DateTime))
}
if v.DateTimeOnTarget != nil {
ok := object.Key("dateTimeOnTarget")
ok.String(smithytime.FormatDateTime(*v.DateTimeOnTarget))
}
if v.EpochSeconds != nil {
ok := object.Key("epochSeconds")
ok.Double(smithytime.FormatEpochSeconds(*v.EpochSeconds))
}
if v.EpochSecondsOnTarget != nil {
ok := object.Key("epochSecondsOnTarget")
ok.Double(smithytime.FormatEpochSeconds(*v.EpochSecondsOnTarget))
}
if v.HttpDate != nil {
ok := object.Key("httpDate")
ok.String(smithytime.FormatHTTPDate(*v.HttpDate))
}
if v.HttpDateOnTarget != nil {
ok := object.Key("httpDateOnTarget")
ok.String(smithytime.FormatHTTPDate(*v.HttpDateOnTarget))
}
if v.Normal != nil {
ok := object.Key("normal")
ok.Double(smithytime.FormatEpochSeconds(*v.Normal))
}
return nil
}
type awsRestjson1_serializeOpJsonUnions struct {
}
func (*awsRestjson1_serializeOpJsonUnions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpJsonUnions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JsonUnionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/JsonUnions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentJsonUnionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsJsonUnionsInput(v *JsonUnionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentJsonUnionsInput(v *JsonUnionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Contents != nil {
ok := object.Key("contents")
if err := awsRestjson1_serializeDocumentMyUnion(v.Contents, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpMalformedAcceptWithBody struct {
}
func (*awsRestjson1_serializeOpMalformedAcceptWithBody) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedAcceptWithBody) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedAcceptWithBodyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedAcceptWithBody")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedAcceptWithBodyInput(v *MalformedAcceptWithBodyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpMalformedAcceptWithGenericString struct {
}
func (*awsRestjson1_serializeOpMalformedAcceptWithGenericString) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedAcceptWithGenericString) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedAcceptWithGenericStringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedAcceptWithGenericString")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedAcceptWithGenericStringInput(v *MalformedAcceptWithGenericStringInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpMalformedAcceptWithPayload struct {
}
func (*awsRestjson1_serializeOpMalformedAcceptWithPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedAcceptWithPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedAcceptWithPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedAcceptWithPayload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedAcceptWithPayloadInput(v *MalformedAcceptWithPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpMalformedBlob struct {
}
func (*awsRestjson1_serializeOpMalformedBlob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedBlob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedBlobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedBlob")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedBlobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedBlobInput(v *MalformedBlobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedBlobInput(v *MalformedBlobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Blob != nil {
ok := object.Key("blob")
ok.Base64EncodeBytes(v.Blob)
}
return nil
}
type awsRestjson1_serializeOpMalformedBoolean struct {
}
func (*awsRestjson1_serializeOpMalformedBoolean) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedBoolean) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedBooleanInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedBoolean/{booleanInPath}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedBooleanInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedBooleanInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedBooleanInput(v *MalformedBooleanInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BooleanInHeader != nil {
locationName := "Booleaninheader"
encoder.SetHeader(locationName).Boolean(*v.BooleanInHeader)
}
if v.BooleanInPath == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member booleanInPath must not be empty")}
}
if v.BooleanInPath != nil {
if err := encoder.SetURI("booleanInPath").Boolean(*v.BooleanInPath); err != nil {
return err
}
}
if v.BooleanInQuery != nil {
encoder.SetQuery("booleanInQuery").Boolean(*v.BooleanInQuery)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedBooleanInput(v *MalformedBooleanInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BooleanInBody != nil {
ok := object.Key("booleanInBody")
ok.Boolean(*v.BooleanInBody)
}
return nil
}
type awsRestjson1_serializeOpMalformedByte struct {
}
func (*awsRestjson1_serializeOpMalformedByte) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedByte) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedByteInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedByte/{byteInPath}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedByteInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedByteInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedByteInput(v *MalformedByteInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ByteInHeader != nil {
locationName := "Byteinheader"
encoder.SetHeader(locationName).Byte(*v.ByteInHeader)
}
if v.ByteInPath == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member byteInPath must not be empty")}
}
if v.ByteInPath != nil {
if err := encoder.SetURI("byteInPath").Byte(*v.ByteInPath); err != nil {
return err
}
}
if v.ByteInQuery != nil {
encoder.SetQuery("byteInQuery").Byte(*v.ByteInQuery)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedByteInput(v *MalformedByteInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ByteInBody != nil {
ok := object.Key("byteInBody")
ok.Byte(*v.ByteInBody)
}
return nil
}
type awsRestjson1_serializeOpMalformedContentTypeWithBody struct {
}
func (*awsRestjson1_serializeOpMalformedContentTypeWithBody) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedContentTypeWithBody) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedContentTypeWithBodyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedContentTypeWithBody")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedContentTypeWithBodyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedContentTypeWithBodyInput(v *MalformedContentTypeWithBodyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedContentTypeWithBodyInput(v *MalformedContentTypeWithBodyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Hi != nil {
ok := object.Key("hi")
ok.String(*v.Hi)
}
return nil
}
type awsRestjson1_serializeOpMalformedContentTypeWithGenericString struct {
}
func (*awsRestjson1_serializeOpMalformedContentTypeWithGenericString) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedContentTypeWithGenericString) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedContentTypeWithGenericStringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedContentTypeWithGenericString")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("text/plain")
}
if input.Payload != nil {
payload := strings.NewReader(*input.Payload)
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedContentTypeWithGenericStringInput(v *MalformedContentTypeWithGenericStringInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpMalformedContentTypeWithoutBody struct {
}
func (*awsRestjson1_serializeOpMalformedContentTypeWithoutBody) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedContentTypeWithoutBody) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedContentTypeWithoutBodyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedContentTypeWithoutBody")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedContentTypeWithoutBodyInput(v *MalformedContentTypeWithoutBodyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpMalformedContentTypeWithoutBodyEmptyInput struct {
}
func (*awsRestjson1_serializeOpMalformedContentTypeWithoutBodyEmptyInput) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedContentTypeWithoutBodyEmptyInput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedContentTypeWithoutBodyEmptyInputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedContentTypeWithoutBodyEmptyInput")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedContentTypeWithoutBodyEmptyInputInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedContentTypeWithoutBodyEmptyInputInput(v *MalformedContentTypeWithoutBodyEmptyInputInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Header != nil {
locationName := "Header"
encoder.SetHeader(locationName).String(*v.Header)
}
return nil
}
type awsRestjson1_serializeOpMalformedContentTypeWithPayload struct {
}
func (*awsRestjson1_serializeOpMalformedContentTypeWithPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedContentTypeWithPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedContentTypeWithPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedContentTypeWithPayload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("image/jpeg")
}
if input.Payload != nil {
payload := bytes.NewReader(input.Payload)
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedContentTypeWithPayloadInput(v *MalformedContentTypeWithPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpMalformedDouble struct {
}
func (*awsRestjson1_serializeOpMalformedDouble) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedDouble) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedDoubleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedDouble/{doubleInPath}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedDoubleInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedDoubleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedDoubleInput(v *MalformedDoubleInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DoubleInHeader != nil {
locationName := "Doubleinheader"
encoder.SetHeader(locationName).Double(*v.DoubleInHeader)
}
if v.DoubleInPath == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member doubleInPath must not be empty")}
}
if v.DoubleInPath != nil {
if err := encoder.SetURI("doubleInPath").Double(*v.DoubleInPath); err != nil {
return err
}
}
if v.DoubleInQuery != nil {
encoder.SetQuery("doubleInQuery").Double(*v.DoubleInQuery)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedDoubleInput(v *MalformedDoubleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DoubleInBody != nil {
ok := object.Key("doubleInBody")
switch {
case math.IsNaN(*v.DoubleInBody):
ok.String("NaN")
case math.IsInf(*v.DoubleInBody, 1):
ok.String("Infinity")
case math.IsInf(*v.DoubleInBody, -1):
ok.String("-Infinity")
default:
ok.Double(*v.DoubleInBody)
}
}
return nil
}
type awsRestjson1_serializeOpMalformedFloat struct {
}
func (*awsRestjson1_serializeOpMalformedFloat) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedFloat) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedFloatInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedFloat/{floatInPath}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedFloatInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedFloatInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedFloatInput(v *MalformedFloatInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FloatInHeader != nil {
locationName := "Floatinheader"
encoder.SetHeader(locationName).Float(*v.FloatInHeader)
}
if v.FloatInPath == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member floatInPath must not be empty")}
}
if v.FloatInPath != nil {
if err := encoder.SetURI("floatInPath").Float(*v.FloatInPath); err != nil {
return err
}
}
if v.FloatInQuery != nil {
encoder.SetQuery("floatInQuery").Float(*v.FloatInQuery)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedFloatInput(v *MalformedFloatInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FloatInBody != nil {
ok := object.Key("floatInBody")
switch {
case math.IsNaN(float64(*v.FloatInBody)):
ok.String("NaN")
case math.IsInf(float64(*v.FloatInBody), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.FloatInBody), -1):
ok.String("-Infinity")
default:
ok.Float(*v.FloatInBody)
}
}
return nil
}
type awsRestjson1_serializeOpMalformedInteger struct {
}
func (*awsRestjson1_serializeOpMalformedInteger) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedInteger) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedIntegerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedInteger/{integerInPath}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedIntegerInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedIntegerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedIntegerInput(v *MalformedIntegerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IntegerInHeader != nil {
locationName := "Integerinheader"
encoder.SetHeader(locationName).Integer(*v.IntegerInHeader)
}
if v.IntegerInPath == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member integerInPath must not be empty")}
}
if v.IntegerInPath != nil {
if err := encoder.SetURI("integerInPath").Integer(*v.IntegerInPath); err != nil {
return err
}
}
if v.IntegerInQuery != nil {
encoder.SetQuery("integerInQuery").Integer(*v.IntegerInQuery)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedIntegerInput(v *MalformedIntegerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntegerInBody != nil {
ok := object.Key("integerInBody")
ok.Integer(*v.IntegerInBody)
}
return nil
}
type awsRestjson1_serializeOpMalformedList struct {
}
func (*awsRestjson1_serializeOpMalformedList) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedListInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedList")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedListInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedListInput(v *MalformedListInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedListInput(v *MalformedListInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BodyList != nil {
ok := object.Key("bodyList")
if err := awsRestjson1_serializeDocumentSimpleList(v.BodyList, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpMalformedLong struct {
}
func (*awsRestjson1_serializeOpMalformedLong) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedLong) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedLongInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedLong/{longInPath}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedLongInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedLongInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedLongInput(v *MalformedLongInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LongInHeader != nil {
locationName := "Longinheader"
encoder.SetHeader(locationName).Long(*v.LongInHeader)
}
if v.LongInPath == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member longInPath must not be empty")}
}
if v.LongInPath != nil {
if err := encoder.SetURI("longInPath").Long(*v.LongInPath); err != nil {
return err
}
}
if v.LongInQuery != nil {
encoder.SetQuery("longInQuery").Long(*v.LongInQuery)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedLongInput(v *MalformedLongInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LongInBody != nil {
ok := object.Key("longInBody")
ok.Long(*v.LongInBody)
}
return nil
}
type awsRestjson1_serializeOpMalformedMap struct {
}
func (*awsRestjson1_serializeOpMalformedMap) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedMap) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedMapInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedMap")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedMapInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedMapInput(v *MalformedMapInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedMapInput(v *MalformedMapInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BodyMap != nil {
ok := object.Key("bodyMap")
if err := awsRestjson1_serializeDocumentSimpleMap(v.BodyMap, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpMalformedRequestBody struct {
}
func (*awsRestjson1_serializeOpMalformedRequestBody) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedRequestBody) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedRequestBodyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedRequestBody")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedRequestBodyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedRequestBodyInput(v *MalformedRequestBodyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedRequestBodyInput(v *MalformedRequestBodyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Float != nil {
ok := object.Key("float")
switch {
case math.IsNaN(float64(*v.Float)):
ok.String("NaN")
case math.IsInf(float64(*v.Float), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.Float), -1):
ok.String("-Infinity")
default:
ok.Float(*v.Float)
}
}
if v.Int != nil {
ok := object.Key("int")
ok.Integer(*v.Int)
}
return nil
}
type awsRestjson1_serializeOpMalformedShort struct {
}
func (*awsRestjson1_serializeOpMalformedShort) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedShort) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedShortInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedShort/{shortInPath}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedShortInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedShortInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedShortInput(v *MalformedShortInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ShortInHeader != nil {
locationName := "Shortinheader"
encoder.SetHeader(locationName).Short(*v.ShortInHeader)
}
if v.ShortInPath == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member shortInPath must not be empty")}
}
if v.ShortInPath != nil {
if err := encoder.SetURI("shortInPath").Short(*v.ShortInPath); err != nil {
return err
}
}
if v.ShortInQuery != nil {
encoder.SetQuery("shortInQuery").Short(*v.ShortInQuery)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedShortInput(v *MalformedShortInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ShortInBody != nil {
ok := object.Key("shortInBody")
ok.Short(*v.ShortInBody)
}
return nil
}
type awsRestjson1_serializeOpMalformedString struct {
}
func (*awsRestjson1_serializeOpMalformedString) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedString) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedStringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedString")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedStringInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedStringInput(v *MalformedStringInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Blob != nil {
locationName := "Amz-Media-Typed-Header"
encodedVal := base64.StdEncoding.EncodeToString([]byte(*v.Blob))
encodedPtr := ptr.String(encodedVal)
encoder.SetHeader(locationName).String(*encodedPtr)
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampBodyDateTime struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampBodyDateTime) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampBodyDateTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampBodyDateTimeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampBodyDateTime")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedTimestampBodyDateTimeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampBodyDateTimeInput(v *MalformedTimestampBodyDateTimeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedTimestampBodyDateTimeInput(v *MalformedTimestampBodyDateTimeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Timestamp != nil {
ok := object.Key("timestamp")
ok.String(smithytime.FormatDateTime(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampBodyDefault struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampBodyDefault) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampBodyDefault) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampBodyDefaultInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampBodyDefault")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedTimestampBodyDefaultInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampBodyDefaultInput(v *MalformedTimestampBodyDefaultInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedTimestampBodyDefaultInput(v *MalformedTimestampBodyDefaultInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Timestamp != nil {
ok := object.Key("timestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampBodyHttpDate struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampBodyHttpDate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampBodyHttpDate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampBodyHttpDateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampBodyHttpDate")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedTimestampBodyHttpDateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampBodyHttpDateInput(v *MalformedTimestampBodyHttpDateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedTimestampBodyHttpDateInput(v *MalformedTimestampBodyHttpDateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Timestamp != nil {
ok := object.Key("timestamp")
ok.String(smithytime.FormatHTTPDate(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampHeaderDateTime struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampHeaderDateTime) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampHeaderDateTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampHeaderDateTimeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampHeaderDateTime")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampHeaderDateTimeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampHeaderDateTimeInput(v *MalformedTimestampHeaderDateTimeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp != nil {
locationName := "Timestamp"
encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampHeaderDefault struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampHeaderDefault) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampHeaderDefault) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampHeaderDefaultInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampHeaderDefault")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampHeaderDefaultInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampHeaderDefaultInput(v *MalformedTimestampHeaderDefaultInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp != nil {
locationName := "Timestamp"
encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampHeaderEpoch struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampHeaderEpoch) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampHeaderEpoch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampHeaderEpochInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampHeaderEpoch")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampHeaderEpochInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampHeaderEpochInput(v *MalformedTimestampHeaderEpochInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp != nil {
locationName := "Timestamp"
encoder.SetHeader(locationName).Double(smithytime.FormatEpochSeconds(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampPathDefault struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampPathDefault) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampPathDefault) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampPathDefaultInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampPathDefault/{timestamp}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampPathDefaultInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampPathDefaultInput(v *MalformedTimestampPathDefaultInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member timestamp must not be empty")}
}
if v.Timestamp != nil {
if err := encoder.SetURI("timestamp").String(smithytime.FormatDateTime(*v.Timestamp)); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampPathEpoch struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampPathEpoch) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampPathEpoch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampPathEpochInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampPathEpoch/{timestamp}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampPathEpochInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampPathEpochInput(v *MalformedTimestampPathEpochInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member timestamp must not be empty")}
}
if v.Timestamp != nil {
if err := encoder.SetURI("timestamp").Double(smithytime.FormatEpochSeconds(*v.Timestamp)); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampPathHttpDate struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampPathHttpDate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampPathHttpDate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampPathHttpDateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampPathHttpDate/{timestamp}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampPathHttpDateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampPathHttpDateInput(v *MalformedTimestampPathHttpDateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp == nil {
return &smithy.SerializationError{Err: fmt.Errorf("input member timestamp must not be empty")}
}
if v.Timestamp != nil {
if err := encoder.SetURI("timestamp").String(smithytime.FormatHTTPDate(*v.Timestamp)); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampQueryDefault struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampQueryDefault) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampQueryDefault) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampQueryDefaultInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampQueryDefault")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampQueryDefaultInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampQueryDefaultInput(v *MalformedTimestampQueryDefaultInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp != nil {
encoder.SetQuery("timestamp").String(smithytime.FormatDateTime(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampQueryEpoch struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampQueryEpoch) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampQueryEpoch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampQueryEpochInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampQueryEpoch")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampQueryEpochInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampQueryEpochInput(v *MalformedTimestampQueryEpochInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp != nil {
encoder.SetQuery("timestamp").Double(smithytime.FormatEpochSeconds(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedTimestampQueryHttpDate struct {
}
func (*awsRestjson1_serializeOpMalformedTimestampQueryHttpDate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedTimestampQueryHttpDate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedTimestampQueryHttpDateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedTimestampQueryHttpDate")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMalformedTimestampQueryHttpDateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedTimestampQueryHttpDateInput(v *MalformedTimestampQueryHttpDateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Timestamp != nil {
encoder.SetQuery("timestamp").String(smithytime.FormatHTTPDate(*v.Timestamp))
}
return nil
}
type awsRestjson1_serializeOpMalformedUnion struct {
}
func (*awsRestjson1_serializeOpMalformedUnion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMalformedUnion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MalformedUnionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MalformedUnion")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentMalformedUnionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMalformedUnionInput(v *MalformedUnionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentMalformedUnionInput(v *MalformedUnionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Union != nil {
ok := object.Key("union")
if err := awsRestjson1_serializeDocumentSimpleUnion(v.Union, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpMediaTypeHeader struct {
}
func (*awsRestjson1_serializeOpMediaTypeHeader) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpMediaTypeHeader) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MediaTypeHeaderInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/MediaTypeHeader")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsMediaTypeHeaderInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsMediaTypeHeaderInput(v *MediaTypeHeaderInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Json != nil {
locationName := "X-Json"
encodedVal := base64.StdEncoding.EncodeToString([]byte(*v.Json))
encodedPtr := ptr.String(encodedVal)
encoder.SetHeader(locationName).String(*encodedPtr)
}
return nil
}
type awsRestjson1_serializeOpNoInputAndNoOutput struct {
}
func (*awsRestjson1_serializeOpNoInputAndNoOutput) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpNoInputAndNoOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*NoInputAndNoOutputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/NoInputAndNoOutput")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsNoInputAndNoOutputInput(v *NoInputAndNoOutputInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpNoInputAndOutput struct {
}
func (*awsRestjson1_serializeOpNoInputAndOutput) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpNoInputAndOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*NoInputAndOutputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/NoInputAndOutputOutput")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsNoInputAndOutputInput(v *NoInputAndOutputInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpNullAndEmptyHeadersClient struct {
}
func (*awsRestjson1_serializeOpNullAndEmptyHeadersClient) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpNullAndEmptyHeadersClient) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*NullAndEmptyHeadersClientInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/NullAndEmptyHeadersClient")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsNullAndEmptyHeadersClientInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsNullAndEmptyHeadersClientInput(v *NullAndEmptyHeadersClientInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.A != nil {
locationName := "X-A"
encoder.SetHeader(locationName).String(*v.A)
}
if v.B != nil {
locationName := "X-B"
encoder.SetHeader(locationName).String(*v.B)
}
if v.C != nil {
locationName := "X-C"
if len(v.C) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.C {
if len(v.C[i]) > 0 {
escaped := v.C[i]
if strings.Index(v.C[i], `,`) != -1 || strings.Index(v.C[i], `"`) != -1 {
escaped = strconv.Quote(v.C[i])
}
encoder.AddHeader(locationName).String(escaped)
}
}
}
return nil
}
type awsRestjson1_serializeOpNullAndEmptyHeadersServer struct {
}
func (*awsRestjson1_serializeOpNullAndEmptyHeadersServer) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpNullAndEmptyHeadersServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*NullAndEmptyHeadersServerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/NullAndEmptyHeadersServer")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsNullAndEmptyHeadersServerInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsNullAndEmptyHeadersServerInput(v *NullAndEmptyHeadersServerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.A != nil {
locationName := "X-A"
encoder.SetHeader(locationName).String(*v.A)
}
if v.B != nil {
locationName := "X-B"
encoder.SetHeader(locationName).String(*v.B)
}
if v.C != nil {
locationName := "X-C"
if len(v.C) == 0 {
encoder.AddHeader(locationName).String("")
}
for i := range v.C {
if len(v.C[i]) > 0 {
escaped := v.C[i]
if strings.Index(v.C[i], `,`) != -1 || strings.Index(v.C[i], `"`) != -1 {
escaped = strconv.Quote(v.C[i])
}
encoder.AddHeader(locationName).String(escaped)
}
}
}
return nil
}
type awsRestjson1_serializeOpOmitsNullSerializesEmptyString struct {
}
func (*awsRestjson1_serializeOpOmitsNullSerializesEmptyString) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpOmitsNullSerializesEmptyString) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*OmitsNullSerializesEmptyStringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/OmitsNullSerializesEmptyString")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsOmitsNullSerializesEmptyStringInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsOmitsNullSerializesEmptyStringInput(v *OmitsNullSerializesEmptyStringInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmptyString != nil {
encoder.SetQuery("Empty").String(*v.EmptyString)
}
if v.NullValue != nil {
encoder.SetQuery("Null").String(*v.NullValue)
}
return nil
}
type awsRestjson1_serializeOpOmitsSerializingEmptyLists struct {
}
func (*awsRestjson1_serializeOpOmitsSerializingEmptyLists) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpOmitsSerializingEmptyLists) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*OmitsSerializingEmptyListsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/OmitsSerializingEmptyLists")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsOmitsSerializingEmptyListsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsOmitsSerializingEmptyListsInput(v *OmitsSerializingEmptyListsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.QueryBooleanList != nil {
for i := range v.QueryBooleanList {
encoder.AddQuery("BooleanList").Boolean(v.QueryBooleanList[i])
}
}
if v.QueryDoubleList != nil {
for i := range v.QueryDoubleList {
encoder.AddQuery("DoubleList").Double(v.QueryDoubleList[i])
}
}
if v.QueryEnumList != nil {
for i := range v.QueryEnumList {
encoder.AddQuery("EnumList").String(string(v.QueryEnumList[i]))
}
}
if v.QueryIntegerEnumList != nil {
for i := range v.QueryIntegerEnumList {
encoder.AddQuery("IntegerEnumList").Integer(v.QueryIntegerEnumList[i])
}
}
if v.QueryIntegerList != nil {
for i := range v.QueryIntegerList {
encoder.AddQuery("IntegerList").Integer(v.QueryIntegerList[i])
}
}
if v.QueryStringList != nil {
for i := range v.QueryStringList {
encoder.AddQuery("StringList").String(v.QueryStringList[i])
}
}
if v.QueryTimestampList != nil {
for i := range v.QueryTimestampList {
encoder.AddQuery("TimestampList").String(smithytime.FormatDateTime(v.QueryTimestampList[i]))
}
}
return nil
}
type awsRestjson1_serializeOpOperationWithDefaults struct {
}
func (*awsRestjson1_serializeOpOperationWithDefaults) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpOperationWithDefaults) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*OperationWithDefaultsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/OperationWithDefaults")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentOperationWithDefaultsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsOperationWithDefaultsInput(v *OperationWithDefaultsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentOperationWithDefaultsInput(v *OperationWithDefaultsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientOptionalDefaults != nil {
ok := object.Key("clientOptionalDefaults")
if err := awsRestjson1_serializeDocumentClientOptionalDefaults(v.ClientOptionalDefaults, ok); err != nil {
return err
}
}
if v.Defaults != nil {
ok := object.Key("defaults")
if err := awsRestjson1_serializeDocumentDefaults(v.Defaults, ok); err != nil {
return err
}
}
if v.OtherTopLevelDefault != 0 {
ok := object.Key("otherTopLevelDefault")
ok.Integer(v.OtherTopLevelDefault)
}
if v.TopLevelDefault != nil {
ok := object.Key("topLevelDefault")
ok.String(*v.TopLevelDefault)
}
return nil
}
type awsRestjson1_serializeOpOperationWithNestedStructure struct {
}
func (*awsRestjson1_serializeOpOperationWithNestedStructure) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpOperationWithNestedStructure) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*OperationWithNestedStructureInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/OperationWithNestedStructure")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentOperationWithNestedStructureInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsOperationWithNestedStructureInput(v *OperationWithNestedStructureInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentOperationWithNestedStructureInput(v *OperationWithNestedStructureInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TopLevel != nil {
ok := object.Key("topLevel")
if err := awsRestjson1_serializeDocumentTopLevel(v.TopLevel, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPostPlayerAction struct {
}
func (*awsRestjson1_serializeOpPostPlayerAction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPostPlayerAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PostPlayerActionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/PostPlayerAction")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPostPlayerActionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsPostPlayerActionInput(v *PostPlayerActionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPostPlayerActionInput(v *PostPlayerActionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("action")
if err := awsRestjson1_serializeDocumentPlayerAction(v.Action, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPostUnionWithJsonName struct {
}
func (*awsRestjson1_serializeOpPostUnionWithJsonName) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPostUnionWithJsonName) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PostUnionWithJsonNameInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/PostUnionWithJsonName")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPostUnionWithJsonNameInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsPostUnionWithJsonNameInput(v *PostUnionWithJsonNameInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPostUnionWithJsonNameInput(v *PostUnionWithJsonNameInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentUnionWithJsonName(v.Value, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutWithContentEncoding struct {
}
func (*awsRestjson1_serializeOpPutWithContentEncoding) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutWithContentEncoding) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutWithContentEncodingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/requestcompression/putcontentwithencoding")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsPutWithContentEncodingInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutWithContentEncodingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsPutWithContentEncodingInput(v *PutWithContentEncodingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Encoding != nil {
locationName := "Content-Encoding"
encoder.SetHeader(locationName).String(*v.Encoding)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutWithContentEncodingInput(v *PutWithContentEncodingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("data")
ok.String(*v.Data)
}
return nil
}
type awsRestjson1_serializeOpQueryIdempotencyTokenAutoFill struct {
}
func (*awsRestjson1_serializeOpQueryIdempotencyTokenAutoFill) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpQueryIdempotencyTokenAutoFill) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*QueryIdempotencyTokenAutoFillInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/QueryIdempotencyTokenAutoFill")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsQueryIdempotencyTokenAutoFillInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsQueryIdempotencyTokenAutoFillInput(v *QueryIdempotencyTokenAutoFillInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Token != nil {
encoder.SetQuery("token").String(*v.Token)
}
return nil
}
type awsRestjson1_serializeOpQueryParamsAsStringListMap struct {
}
func (*awsRestjson1_serializeOpQueryParamsAsStringListMap) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpQueryParamsAsStringListMap) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*QueryParamsAsStringListMapInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/StringListMap")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsQueryParamsAsStringListMapInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsQueryParamsAsStringListMapInput(v *QueryParamsAsStringListMapInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
for qkey, qvalue := range v.Foo {
if encoder.HasQuery(qkey) {
continue
}
for i := range qvalue {
encoder.AddQuery(qkey).String(qvalue[i])
}
}
}
if v.Qux != nil {
encoder.SetQuery("corge").String(*v.Qux)
}
return nil
}
type awsRestjson1_serializeOpQueryPrecedence struct {
}
func (*awsRestjson1_serializeOpQueryPrecedence) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpQueryPrecedence) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*QueryPrecedenceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/Precedence")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsQueryPrecedenceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsQueryPrecedenceInput(v *QueryPrecedenceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Baz != nil {
for qkey, qvalue := range v.Baz {
if encoder.HasQuery(qkey) {
continue
}
encoder.SetQuery(qkey).String(qvalue)
}
}
if v.Foo != nil {
encoder.SetQuery("bar").String(*v.Foo)
}
return nil
}
type awsRestjson1_serializeOpRecursiveShapes struct {
}
func (*awsRestjson1_serializeOpRecursiveShapes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRecursiveShapes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RecursiveShapesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/RecursiveShapes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentRecursiveShapesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsRecursiveShapesInput(v *RecursiveShapesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentRecursiveShapesInput(v *RecursiveShapesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Nested != nil {
ok := object.Key("nested")
if err := awsRestjson1_serializeDocumentRecursiveShapesInputOutputNested1(v.Nested, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpResponseCodeHttpFallback struct {
}
func (*awsRestjson1_serializeOpResponseCodeHttpFallback) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpResponseCodeHttpFallback) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ResponseCodeHttpFallbackInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/responseCodeHttpFallback")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsResponseCodeHttpFallbackInput(v *ResponseCodeHttpFallbackInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpResponseCodeRequired struct {
}
func (*awsRestjson1_serializeOpResponseCodeRequired) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpResponseCodeRequired) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ResponseCodeRequiredInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/responseCodeRequired")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsResponseCodeRequiredInput(v *ResponseCodeRequiredInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpSimpleScalarProperties struct {
}
func (*awsRestjson1_serializeOpSimpleScalarProperties) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSimpleScalarProperties) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SimpleScalarPropertiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/SimpleScalarProperties")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsSimpleScalarPropertiesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentSimpleScalarPropertiesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsSimpleScalarPropertiesInput(v *SimpleScalarPropertiesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
locationName := "X-Foo"
encoder.SetHeader(locationName).String(*v.Foo)
}
return nil
}
func awsRestjson1_serializeOpDocumentSimpleScalarPropertiesInput(v *SimpleScalarPropertiesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ByteValue != nil {
ok := object.Key("byteValue")
ok.Byte(*v.ByteValue)
}
if v.DoubleValue != nil {
ok := object.Key("DoubleDribble")
switch {
case math.IsNaN(*v.DoubleValue):
ok.String("NaN")
case math.IsInf(*v.DoubleValue, 1):
ok.String("Infinity")
case math.IsInf(*v.DoubleValue, -1):
ok.String("-Infinity")
default:
ok.Double(*v.DoubleValue)
}
}
if v.FalseBooleanValue != nil {
ok := object.Key("falseBooleanValue")
ok.Boolean(*v.FalseBooleanValue)
}
if v.FloatValue != nil {
ok := object.Key("floatValue")
switch {
case math.IsNaN(float64(*v.FloatValue)):
ok.String("NaN")
case math.IsInf(float64(*v.FloatValue), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.FloatValue), -1):
ok.String("-Infinity")
default:
ok.Float(*v.FloatValue)
}
}
if v.IntegerValue != nil {
ok := object.Key("integerValue")
ok.Integer(*v.IntegerValue)
}
if v.LongValue != nil {
ok := object.Key("longValue")
ok.Long(*v.LongValue)
}
if v.ShortValue != nil {
ok := object.Key("shortValue")
ok.Short(*v.ShortValue)
}
if v.StringValue != nil {
ok := object.Key("stringValue")
ok.String(*v.StringValue)
}
if v.TrueBooleanValue != nil {
ok := object.Key("trueBooleanValue")
ok.Boolean(*v.TrueBooleanValue)
}
return nil
}
type awsRestjson1_serializeOpSparseJsonLists struct {
}
func (*awsRestjson1_serializeOpSparseJsonLists) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSparseJsonLists) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SparseJsonListsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/SparseJsonLists")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentSparseJsonListsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsSparseJsonListsInput(v *SparseJsonListsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentSparseJsonListsInput(v *SparseJsonListsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SparseShortList != nil {
ok := object.Key("sparseShortList")
if err := awsRestjson1_serializeDocumentSparseShortList(v.SparseShortList, ok); err != nil {
return err
}
}
if v.SparseStringList != nil {
ok := object.Key("sparseStringList")
if err := awsRestjson1_serializeDocumentSparseStringList(v.SparseStringList, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpSparseJsonMaps struct {
}
func (*awsRestjson1_serializeOpSparseJsonMaps) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSparseJsonMaps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SparseJsonMapsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/SparseJsonMaps")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentSparseJsonMapsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsSparseJsonMapsInput(v *SparseJsonMapsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentSparseJsonMapsInput(v *SparseJsonMapsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SparseBooleanMap != nil {
ok := object.Key("sparseBooleanMap")
if err := awsRestjson1_serializeDocumentSparseBooleanMap(v.SparseBooleanMap, ok); err != nil {
return err
}
}
if v.SparseNumberMap != nil {
ok := object.Key("sparseNumberMap")
if err := awsRestjson1_serializeDocumentSparseNumberMap(v.SparseNumberMap, ok); err != nil {
return err
}
}
if v.SparseSetMap != nil {
ok := object.Key("sparseSetMap")
if err := awsRestjson1_serializeDocumentSparseSetMap(v.SparseSetMap, ok); err != nil {
return err
}
}
if v.SparseStringMap != nil {
ok := object.Key("sparseStringMap")
if err := awsRestjson1_serializeDocumentSparseStringMap(v.SparseStringMap, ok); err != nil {
return err
}
}
if v.SparseStructMap != nil {
ok := object.Key("sparseStructMap")
if err := awsRestjson1_serializeDocumentSparseStructMap(v.SparseStructMap, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStreamingTraits struct {
}
func (*awsRestjson1_serializeOpStreamingTraits) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStreamingTraits) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StreamingTraitsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/StreamingTraits")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStreamingTraitsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.Blob != nil {
payload := input.Blob
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStreamingTraitsInput(v *StreamingTraitsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
locationName := "X-Foo"
encoder.SetHeader(locationName).String(*v.Foo)
}
return nil
}
type awsRestjson1_serializeOpStreamingTraitsRequireLength struct {
}
func (*awsRestjson1_serializeOpStreamingTraitsRequireLength) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStreamingTraitsRequireLength) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StreamingTraitsRequireLengthInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/StreamingTraitsRequireLength")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStreamingTraitsRequireLengthInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.Blob != nil {
payload := input.Blob
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStreamingTraitsRequireLengthInput(v *StreamingTraitsRequireLengthInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
locationName := "X-Foo"
encoder.SetHeader(locationName).String(*v.Foo)
}
return nil
}
type awsRestjson1_serializeOpStreamingTraitsWithMediaType struct {
}
func (*awsRestjson1_serializeOpStreamingTraitsWithMediaType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStreamingTraitsWithMediaType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StreamingTraitsWithMediaTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/StreamingTraitsWithMediaType")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStreamingTraitsWithMediaTypeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("text/plain")
}
if input.Blob != nil {
payload := input.Blob
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStreamingTraitsWithMediaTypeInput(v *StreamingTraitsWithMediaTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Foo != nil {
locationName := "X-Foo"
encoder.SetHeader(locationName).String(*v.Foo)
}
return nil
}
type awsRestjson1_serializeOpTestBodyStructure struct {
}
func (*awsRestjson1_serializeOpTestBodyStructure) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestBodyStructure) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestBodyStructureInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/body")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTestBodyStructureInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTestBodyStructureInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTestBodyStructureInput(v *TestBodyStructureInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestId != nil {
locationName := "X-Amz-Test-Id"
encoder.SetHeader(locationName).String(*v.TestId)
}
return nil
}
func awsRestjson1_serializeOpDocumentTestBodyStructureInput(v *TestBodyStructureInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TestConfig != nil {
ok := object.Key("testConfig")
if err := awsRestjson1_serializeDocumentTestConfig(v.TestConfig, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTestGetNoInputNoPayload struct {
}
func (*awsRestjson1_serializeOpTestGetNoInputNoPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestGetNoInputNoPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestGetNoInputNoPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/no_input_no_payload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTestGetNoInputNoPayloadInput(v *TestGetNoInputNoPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpTestGetNoPayload struct {
}
func (*awsRestjson1_serializeOpTestGetNoPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestGetNoPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestGetNoPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/no_payload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTestGetNoPayloadInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTestGetNoPayloadInput(v *TestGetNoPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestId != nil {
locationName := "X-Amz-Test-Id"
encoder.SetHeader(locationName).String(*v.TestId)
}
return nil
}
type awsRestjson1_serializeOpTestPayloadBlob struct {
}
func (*awsRestjson1_serializeOpTestPayloadBlob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestPayloadBlob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestPayloadBlobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/blob_payload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTestPayloadBlobInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.Data != nil {
payload := bytes.NewReader(input.Data)
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTestPayloadBlobInput(v *TestPayloadBlobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContentType != nil {
locationName := "Content-Type"
encoder.SetHeader(locationName).String(*v.ContentType)
}
return nil
}
type awsRestjson1_serializeOpTestPayloadStructure struct {
}
func (*awsRestjson1_serializeOpTestPayloadStructure) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestPayloadStructure) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestPayloadStructureInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/payload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTestPayloadStructureInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/json")
}
if input.PayloadConfig != nil {
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentPayloadConfig(input.PayloadConfig, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
payload := bytes.NewReader(jsonEncoder.Bytes())
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
} else {
jsonEncoder := smithyjson.NewEncoder()
jsonEncoder.Value.Object().Close()
payload := bytes.NewReader(jsonEncoder.Bytes())
if request, err = request.SetStream(payload); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTestPayloadStructureInput(v *TestPayloadStructureInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestId != nil {
locationName := "X-Amz-Test-Id"
encoder.SetHeader(locationName).String(*v.TestId)
}
return nil
}
type awsRestjson1_serializeOpTestPostNoInputNoPayload struct {
}
func (*awsRestjson1_serializeOpTestPostNoInputNoPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestPostNoInputNoPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestPostNoInputNoPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/no_input_no_payload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTestPostNoInputNoPayloadInput(v *TestPostNoInputNoPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpTestPostNoPayload struct {
}
func (*awsRestjson1_serializeOpTestPostNoPayload) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestPostNoPayload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestPostNoPayloadInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/no_payload")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTestPostNoPayloadInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTestPostNoPayloadInput(v *TestPostNoPayloadInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TestId != nil {
locationName := "X-Amz-Test-Id"
encoder.SetHeader(locationName).String(*v.TestId)
}
return nil
}
type awsRestjson1_serializeOpTimestampFormatHeaders struct {
}
func (*awsRestjson1_serializeOpTimestampFormatHeaders) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTimestampFormatHeaders) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TimestampFormatHeadersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/TimestampFormatHeaders")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTimestampFormatHeadersInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTimestampFormatHeadersInput(v *TimestampFormatHeadersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DefaultFormat != nil {
locationName := "X-Defaultformat"
encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.DefaultFormat))
}
if v.MemberDateTime != nil {
locationName := "X-Memberdatetime"
encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.MemberDateTime))
}
if v.MemberEpochSeconds != nil {
locationName := "X-Memberepochseconds"
encoder.SetHeader(locationName).Double(smithytime.FormatEpochSeconds(*v.MemberEpochSeconds))
}
if v.MemberHttpDate != nil {
locationName := "X-Memberhttpdate"
encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.MemberHttpDate))
}
if v.TargetDateTime != nil {
locationName := "X-Targetdatetime"
encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.TargetDateTime))
}
if v.TargetEpochSeconds != nil {
locationName := "X-Targetepochseconds"
encoder.SetHeader(locationName).Double(smithytime.FormatEpochSeconds(*v.TargetEpochSeconds))
}
if v.TargetHttpDate != nil {
locationName := "X-Targethttpdate"
encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.TargetHttpDate))
}
return nil
}
type awsRestjson1_serializeOpUnitInputAndOutput struct {
}
func (*awsRestjson1_serializeOpUnitInputAndOutput) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUnitInputAndOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, span := tracing.StartSpan(ctx, "OperationSerializer")
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
defer endTimer()
defer span.End()
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UnitInputAndOutputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/UnitInputAndOutput")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
var restEncoder *httpbinding.Encoder
if request.URL.RawPath == "" {
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
} else {
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
}
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUnitInputAndOutputInput(v *UnitInputAndOutputInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeDocumentClientOptionalDefaults(v *types.ClientOptionalDefaults, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Member != nil {
ok := object.Key("member")
ok.Integer(*v.Member)
}
return nil
}
func awsRestjson1_serializeDocumentDefaults(v *types.Defaults, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultBlob != nil {
ok := object.Key("defaultBlob")
ok.Base64EncodeBytes(v.DefaultBlob)
}
if v.DefaultBoolean != nil {
ok := object.Key("defaultBoolean")
ok.Boolean(*v.DefaultBoolean)
}
if v.DefaultByte != nil {
ok := object.Key("defaultByte")
ok.Byte(*v.DefaultByte)
}
if v.DefaultDocumentBoolean != nil {
ok := object.Key("defaultDocumentBoolean")
if err := awsRestjson1_serializeDocumentDocument(v.DefaultDocumentBoolean, ok); err != nil {
return err
}
}
if v.DefaultDocumentList != nil {
ok := object.Key("defaultDocumentList")
if err := awsRestjson1_serializeDocumentDocument(v.DefaultDocumentList, ok); err != nil {
return err
}
}
if v.DefaultDocumentMap != nil {
ok := object.Key("defaultDocumentMap")
if err := awsRestjson1_serializeDocumentDocument(v.DefaultDocumentMap, ok); err != nil {
return err
}
}
if v.DefaultDocumentString != nil {
ok := object.Key("defaultDocumentString")
if err := awsRestjson1_serializeDocumentDocument(v.DefaultDocumentString, ok); err != nil {
return err
}
}
if v.DefaultDouble != nil {
ok := object.Key("defaultDouble")
switch {
case math.IsNaN(*v.DefaultDouble):
ok.String("NaN")
case math.IsInf(*v.DefaultDouble, 1):
ok.String("Infinity")
case math.IsInf(*v.DefaultDouble, -1):
ok.String("-Infinity")
default:
ok.Double(*v.DefaultDouble)
}
}
if len(v.DefaultEnum) > 0 {
ok := object.Key("defaultEnum")
ok.String(string(v.DefaultEnum))
}
if v.DefaultFloat != nil {
ok := object.Key("defaultFloat")
switch {
case math.IsNaN(float64(*v.DefaultFloat)):
ok.String("NaN")
case math.IsInf(float64(*v.DefaultFloat), 1):
ok.String("Infinity")
case math.IsInf(float64(*v.DefaultFloat), -1):
ok.String("-Infinity")
default:
ok.Float(*v.DefaultFloat)
}
}
if v.DefaultInteger != nil {
ok := object.Key("defaultInteger")
ok.Integer(*v.DefaultInteger)
}
if v.DefaultIntEnum != 0 {
ok := object.Key("defaultIntEnum")
ok.Integer(v.DefaultIntEnum)
}
if v.DefaultList != nil {
ok := object.Key("defaultList")
if err := awsRestjson1_serializeDocumentTestStringList(v.DefaultList, ok); err != nil {
return err
}
}
if v.DefaultLong != nil {
ok := object.Key("defaultLong")
ok.Long(*v.DefaultLong)
}
if v.DefaultMap != nil {
ok := object.Key("defaultMap")
if err := awsRestjson1_serializeDocumentTestStringMap(v.DefaultMap, ok); err != nil {
return err
}
}
if v.DefaultNullDocument != nil {
ok := object.Key("defaultNullDocument")
if err := awsRestjson1_serializeDocumentDocument(v.DefaultNullDocument, ok); err != nil {
return err
}
}
if v.DefaultShort != nil {
ok := object.Key("defaultShort")
ok.Short(*v.DefaultShort)
}
if v.DefaultString != nil {
ok := object.Key("defaultString")
ok.String(*v.DefaultString)
}
if v.DefaultTimestamp != nil {
ok := object.Key("defaultTimestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.DefaultTimestamp))
}
if v.EmptyBlob != nil {
ok := object.Key("emptyBlob")
ok.Base64EncodeBytes(v.EmptyBlob)
}
if v.EmptyString != nil {
ok := object.Key("emptyString")
ok.String(*v.EmptyString)
}
if v.FalseBoolean {
ok := object.Key("falseBoolean")
ok.Boolean(v.FalseBoolean)
}
if v.ZeroByte != 0 {
ok := object.Key("zeroByte")
ok.Byte(v.ZeroByte)
}
if v.ZeroDouble != 0 {
ok := object.Key("zeroDouble")
switch {
case math.IsNaN(v.ZeroDouble):
ok.String("NaN")
case math.IsInf(v.ZeroDouble, 1):
ok.String("Infinity")
case math.IsInf(v.ZeroDouble, -1):
ok.String("-Infinity")
default:
ok.Double(v.ZeroDouble)
}
}
if v.ZeroFloat != 0 {
ok := object.Key("zeroFloat")
switch {
case math.IsNaN(float64(v.ZeroFloat)):
ok.String("NaN")
case math.IsInf(float64(v.ZeroFloat), 1):
ok.String("Infinity")
case math.IsInf(float64(v.ZeroFloat), -1):
ok.String("-Infinity")
default:
ok.Float(v.ZeroFloat)
}
}
if v.ZeroInteger != 0 {
ok := object.Key("zeroInteger")
ok.Integer(v.ZeroInteger)
}
if v.ZeroLong != 0 {
ok := object.Key("zeroLong")
ok.Long(v.ZeroLong)
}
if v.ZeroShort != 0 {
ok := object.Key("zeroShort")
ok.Short(v.ZeroShort)
}
return nil
}
func awsRestjson1_serializeDocumentDenseBooleanMap(v map[string]bool, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.Boolean(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentDenseNumberMap(v map[string]int32, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.Integer(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentDenseSetMap(v map[string][]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentStringSet(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDenseStringMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentDenseStructMap(v map[string]types.GreetingStruct, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentGreetingStruct(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDialog(v *types.Dialog, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Farewell != nil {
ok := object.Key("farewell")
if err := awsRestjson1_serializeDocumentFarewell(v.Farewell, ok); err != nil {
return err
}
}
if v.Greeting != nil {
ok := object.Key("greeting")
ok.String(*v.Greeting)
}
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
return nil
}
func awsRestjson1_serializeDocumentDialogList(v []types.Dialog, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDialog(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDialogMap(v map[string]types.Dialog, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentDialog(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDocument(v document.Interface, value smithyjson.Value) error {
if v == nil {
return nil
}
if !internaldocument.IsInterface(v) {
return fmt.Errorf("%T is not a compatible document type", v)
}
db, err := v.MarshalSmithyDocument()
if err != nil {
return err
}
value.Write(db)
return nil
}
func awsRestjson1_serializeDocumentDocumentValuedMap(v map[string]document.Interface, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentDocument(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFarewell(v *types.Farewell, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Phrase != nil {
ok := object.Key("phrase")
ok.String(*v.Phrase)
}
return nil
}
func awsRestjson1_serializeDocumentMyUnion(v types.MyUnion, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.MyUnionMemberBlobValue:
av := object.Key("blobValue")
av.Base64EncodeBytes(uv.Value)
case *types.MyUnionMemberBooleanValue:
av := object.Key("booleanValue")
av.Boolean(uv.Value)
case *types.MyUnionMemberEnumValue:
av := object.Key("enumValue")
av.String(string(uv.Value))
case *types.MyUnionMemberListValue:
av := object.Key("listValue")
if err := awsRestjson1_serializeDocumentStringList(uv.Value, av); err != nil {
return err
}
case *types.MyUnionMemberMapValue:
av := object.Key("mapValue")
if err := awsRestjson1_serializeDocumentStringMap(uv.Value, av); err != nil {
return err
}
case *types.MyUnionMemberNumberValue:
av := object.Key("numberValue")
av.Integer(uv.Value)
case *types.MyUnionMemberRenamedStructureValue:
av := object.Key("renamedStructureValue")
if err := awsRestjson1_serializeDocumentRenamedGreeting(&uv.Value, av); err != nil {
return err
}
case *types.MyUnionMemberStringValue:
av := object.Key("stringValue")
av.String(uv.Value)
case *types.MyUnionMemberStructureValue:
av := object.Key("structureValue")
if err := awsRestjson1_serializeDocumentGreetingStruct(&uv.Value, av); err != nil {
return err
}
case *types.MyUnionMemberTimestampValue:
av := object.Key("timestampValue")
av.Double(smithytime.FormatEpochSeconds(uv.Value))
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentNestedPayload(v *types.NestedPayload, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Greeting != nil {
ok := object.Key("greeting")
ok.String(*v.Greeting)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentPayloadConfig(v *types.PayloadConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("data")
ok.Integer(*v.Data)
}
return nil
}
func awsRestjson1_serializeDocumentPlayerAction(v types.PlayerAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.PlayerActionMemberQuit:
av := object.Key("quit")
if err := awsRestjson1_serializeDocumentUnit(&uv.Value, av); err != nil {
return err
}
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentRecursiveShapesInputOutputNested1(v *types.RecursiveShapesInputOutputNested1, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Foo != nil {
ok := object.Key("foo")
ok.String(*v.Foo)
}
if v.Nested != nil {
ok := object.Key("nested")
if err := awsRestjson1_serializeDocumentRecursiveShapesInputOutputNested2(v.Nested, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentRecursiveShapesInputOutputNested2(v *types.RecursiveShapesInputOutputNested2, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bar != nil {
ok := object.Key("bar")
ok.String(*v.Bar)
}
if v.RecursiveMember != nil {
ok := object.Key("recursiveMember")
if err := awsRestjson1_serializeDocumentRecursiveShapesInputOutputNested1(v.RecursiveMember, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSimpleList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentSimpleMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentSimpleUnion(v types.SimpleUnion, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.SimpleUnionMemberInt:
av := object.Key("int")
av.Integer(uv.Value)
case *types.SimpleUnionMemberString:
av := object.Key("string")
av.String(uv.Value)
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentSparseBooleanMap(v map[string]*bool, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
om.Null()
continue
}
om.Boolean(*v[key])
}
return nil
}
func awsRestjson1_serializeDocumentSparseNumberMap(v map[string]*int32, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
om.Null()
continue
}
om.Integer(*v[key])
}
return nil
}
func awsRestjson1_serializeDocumentSparseSetMap(v map[string][]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
om.Null()
continue
}
if err := awsRestjson1_serializeDocumentStringSet(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSparseStructMap(v map[string]*types.GreetingStruct, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
om.Null()
continue
}
if err := awsRestjson1_serializeDocumentGreetingStruct(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentStructureList(v []types.StructureListMember, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentStructureListMember(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentStructureListMember(v *types.StructureListMember, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.A != nil {
ok := object.Key("value")
ok.String(*v.A)
}
if v.B != nil {
ok := object.Key("other")
ok.String(*v.B)
}
return nil
}
func awsRestjson1_serializeDocumentTestConfig(v *types.TestConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Timeout != nil {
ok := object.Key("timeout")
ok.Integer(*v.Timeout)
}
return nil
}
func awsRestjson1_serializeDocumentTestStringList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentTestStringMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentTopLevel(v *types.TopLevel, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Dialog != nil {
ok := object.Key("dialog")
if err := awsRestjson1_serializeDocumentDialog(v.Dialog, ok); err != nil {
return err
}
}
if v.DialogList != nil {
ok := object.Key("dialogList")
if err := awsRestjson1_serializeDocumentDialogList(v.DialogList, ok); err != nil {
return err
}
}
if v.DialogMap != nil {
ok := object.Key("dialogMap")
if err := awsRestjson1_serializeDocumentDialogMap(v.DialogMap, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentUnionPayload(v types.UnionPayload, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.UnionPayloadMemberGreeting:
av := object.Key("greeting")
av.String(uv.Value)
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentUnionWithJsonName(v types.UnionWithJsonName, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.UnionWithJsonNameMemberBar:
av := object.Key("bar")
av.String(uv.Value)
case *types.UnionWithJsonNameMemberBaz:
av := object.Key("_baz")
av.String(uv.Value)
case *types.UnionWithJsonNameMemberFoo:
av := object.Key("FOO")
av.String(uv.Value)
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentRenamedGreeting(v *types.RenamedGreeting, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Salutation != nil {
ok := object.Key("salutation")
ok.String(*v.Salutation)
}
return nil
}
func awsRestjson1_serializeDocumentBooleanList(v []bool, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Boolean(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentFooEnumList(v []types.FooEnum, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentFooEnumMap(v map[string]types.FooEnum, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(string(v[key]))
}
return nil
}
func awsRestjson1_serializeDocumentFooEnumSet(v []types.FooEnum, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentGreetingStruct(v *types.GreetingStruct, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Hi != nil {
ok := object.Key("hi")
ok.String(*v.Hi)
}
return nil
}
func awsRestjson1_serializeDocumentIntegerEnumList(v []types.IntegerEnum, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Integer(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentIntegerEnumMap(v map[string]types.IntegerEnum, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.Integer(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentIntegerEnumSet(v []types.IntegerEnum, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Integer(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentIntegerList(v []int32, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Integer(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentNestedStringList(v [][]string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentStringList(v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSparseShortList(v []*int16, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
av.Null()
continue
}
av.Short(*v[i])
}
return nil
}
func awsRestjson1_serializeDocumentSparseStringList(v []*string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
av.Null()
continue
}
av.String(*v[i])
}
return nil
}
func awsRestjson1_serializeDocumentSparseStringMap(v map[string]*string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
om.Null()
continue
}
om.String(*v[key])
}
return nil
}
func awsRestjson1_serializeDocumentStringList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentStringMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentStringSet(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentTimestampList(v []time.Time, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Double(smithytime.FormatEpochSeconds(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentUnit(v *types.Unit, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}