// Code generated by smithy-go-codegen DO NOT EDIT. package firehose import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/firehose/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "math" "strings" ) type awsAwsjson11_deserializeOpCreateDeliveryStream struct { } func (*awsAwsjson11_deserializeOpCreateDeliveryStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorCreateDeliveryStream(response, &metadata) } output := &CreateDeliveryStreamOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentCreateDeliveryStreamOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("InvalidKMSResourceException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteDeliveryStream struct { } func (*awsAwsjson11_deserializeOpDeleteDeliveryStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDeliveryStream(response, &metadata) } output := &DeleteDeliveryStreamOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteDeliveryStreamOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceInUseException", errorCode): return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeDeliveryStream struct { } func (*awsAwsjson11_deserializeOpDescribeDeliveryStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDeliveryStream(response, &metadata) } output := &DescribeDeliveryStreamOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDescribeDeliveryStreamOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDescribeDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListDeliveryStreams struct { } func (*awsAwsjson11_deserializeOpListDeliveryStreams) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListDeliveryStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorListDeliveryStreams(response, &metadata) } output := &ListDeliveryStreamsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentListDeliveryStreamsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListDeliveryStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListTagsForDeliveryStream struct { } func (*awsAwsjson11_deserializeOpListTagsForDeliveryStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListTagsForDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForDeliveryStream(response, &metadata) } output := &ListTagsForDeliveryStreamOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentListTagsForDeliveryStreamOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListTagsForDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPutRecord struct { } func (*awsAwsjson11_deserializeOpPutRecord) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPutRecord) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorPutRecord(response, &metadata) } output := &PutRecordOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentPutRecordOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorPutRecord(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("InvalidKMSResourceException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPutRecordBatch struct { } func (*awsAwsjson11_deserializeOpPutRecordBatch) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPutRecordBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorPutRecordBatch(response, &metadata) } output := &PutRecordBatchOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentPutRecordBatchOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorPutRecordBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("InvalidKMSResourceException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartDeliveryStreamEncryption struct { } func (*awsAwsjson11_deserializeOpStartDeliveryStreamEncryption) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartDeliveryStreamEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorStartDeliveryStreamEncryption(response, &metadata) } output := &StartDeliveryStreamEncryptionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentStartDeliveryStreamEncryptionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorStartDeliveryStreamEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("InvalidKMSResourceException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStopDeliveryStreamEncryption struct { } func (*awsAwsjson11_deserializeOpStopDeliveryStreamEncryption) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStopDeliveryStreamEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorStopDeliveryStreamEncryption(response, &metadata) } output := &StopDeliveryStreamEncryptionOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentStopDeliveryStreamEncryptionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorStopDeliveryStreamEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTagDeliveryStream struct { } func (*awsAwsjson11_deserializeOpTagDeliveryStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpTagDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorTagDeliveryStream(response, &metadata) } output := &TagDeliveryStreamOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentTagDeliveryStreamOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorTagDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUntagDeliveryStream struct { } func (*awsAwsjson11_deserializeOpUntagDeliveryStream) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUntagDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorUntagDeliveryStream(response, &metadata) } output := &UntagDeliveryStreamOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentUntagDeliveryStreamOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUntagDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateDestination struct { } func (*awsAwsjson11_deserializeOpUpdateDestination) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDestination(response, &metadata) } output := &UpdateDestinationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentUpdateDestinationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConcurrentModificationException", errorCode): return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ConcurrentModificationException{} err := awsAwsjson11_deserializeDocumentConcurrentModificationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorInvalidArgumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InvalidArgumentException{} err := awsAwsjson11_deserializeDocumentInvalidArgumentException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorInvalidKMSResourceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InvalidKMSResourceException{} err := awsAwsjson11_deserializeDocumentInvalidKMSResourceException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.LimitExceededException{} err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ResourceInUseException{} err := awsAwsjson11_deserializeDocumentResourceInUseException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ResourceNotFoundException{} err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ServiceUnavailableException{} err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessBufferingHints(v **types.AmazonOpenSearchServerlessBufferingHints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonOpenSearchServerlessBufferingHints if *v == nil { sv = &types.AmazonOpenSearchServerlessBufferingHints{} } else { sv = *v } for key, value := range shape { switch key { case "IntervalInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AmazonOpenSearchServerlessBufferingIntervalInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IntervalInSeconds = ptr.Int32(int32(i64)) } case "SizeInMBs": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AmazonOpenSearchServerlessBufferingSizeInMBs to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInMBs = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessDestinationDescription(v **types.AmazonOpenSearchServerlessDestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonOpenSearchServerlessDestinationDescription if *v == nil { sv = &types.AmazonOpenSearchServerlessDestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "BufferingHints": if err := awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessBufferingHints(&sv.BufferingHints, value); err != nil { return err } case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "CollectionEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonOpenSearchServerlessCollectionEndpoint to be of type string, got %T instead", value) } sv.CollectionEndpoint = ptr.String(jtv) } case "IndexName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonOpenSearchServerlessIndexName to be of type string, got %T instead", value) } sv.IndexName = ptr.String(jtv) } case "ProcessingConfiguration": if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil { return err } case "RetryOptions": if err := awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessRetryOptions(&sv.RetryOptions, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "S3BackupMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonOpenSearchServerlessS3BackupMode to be of type string, got %T instead", value) } sv.S3BackupMode = types.AmazonOpenSearchServerlessS3BackupMode(jtv) } case "S3DestinationDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil { return err } case "VpcConfigurationDescription": if err := awsAwsjson11_deserializeDocumentVpcConfigurationDescription(&sv.VpcConfigurationDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessRetryOptions(v **types.AmazonOpenSearchServerlessRetryOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonOpenSearchServerlessRetryOptions if *v == nil { sv = &types.AmazonOpenSearchServerlessRetryOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AmazonOpenSearchServerlessRetryDurationInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAmazonopensearchserviceBufferingHints(v **types.AmazonopensearchserviceBufferingHints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonopensearchserviceBufferingHints if *v == nil { sv = &types.AmazonopensearchserviceBufferingHints{} } else { sv = *v } for key, value := range shape { switch key { case "IntervalInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AmazonopensearchserviceBufferingIntervalInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IntervalInSeconds = ptr.Int32(int32(i64)) } case "SizeInMBs": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AmazonopensearchserviceBufferingSizeInMBs to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInMBs = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAmazonopensearchserviceDestinationDescription(v **types.AmazonopensearchserviceDestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonopensearchserviceDestinationDescription if *v == nil { sv = &types.AmazonopensearchserviceDestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "BufferingHints": if err := awsAwsjson11_deserializeDocumentAmazonopensearchserviceBufferingHints(&sv.BufferingHints, value); err != nil { return err } case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "ClusterEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonopensearchserviceClusterEndpoint to be of type string, got %T instead", value) } sv.ClusterEndpoint = ptr.String(jtv) } case "DomainARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonopensearchserviceDomainARN to be of type string, got %T instead", value) } sv.DomainARN = ptr.String(jtv) } case "IndexName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonopensearchserviceIndexName to be of type string, got %T instead", value) } sv.IndexName = ptr.String(jtv) } case "IndexRotationPeriod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonopensearchserviceIndexRotationPeriod to be of type string, got %T instead", value) } sv.IndexRotationPeriod = types.AmazonopensearchserviceIndexRotationPeriod(jtv) } case "ProcessingConfiguration": if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil { return err } case "RetryOptions": if err := awsAwsjson11_deserializeDocumentAmazonopensearchserviceRetryOptions(&sv.RetryOptions, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "S3BackupMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonopensearchserviceS3BackupMode to be of type string, got %T instead", value) } sv.S3BackupMode = types.AmazonopensearchserviceS3BackupMode(jtv) } case "S3DestinationDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil { return err } case "TypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonopensearchserviceTypeName to be of type string, got %T instead", value) } sv.TypeName = ptr.String(jtv) } case "VpcConfigurationDescription": if err := awsAwsjson11_deserializeDocumentVpcConfigurationDescription(&sv.VpcConfigurationDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAmazonopensearchserviceRetryOptions(v **types.AmazonopensearchserviceRetryOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonopensearchserviceRetryOptions if *v == nil { sv = &types.AmazonopensearchserviceRetryOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AmazonopensearchserviceRetryDurationInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentBufferingHints(v **types.BufferingHints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BufferingHints if *v == nil { sv = &types.BufferingHints{} } else { sv = *v } for key, value := range shape { switch key { case "IntervalInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntervalInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IntervalInSeconds = ptr.Int32(int32(i64)) } case "SizeInMBs": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SizeInMBs to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInMBs = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(v **types.CloudWatchLoggingOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CloudWatchLoggingOptions if *v == nil { sv = &types.CloudWatchLoggingOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "LogGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) } sv.LogGroupName = ptr.String(jtv) } case "LogStreamName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value) } sv.LogStreamName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentColumnToJsonKeyMappings(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsAwsjson11_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConcurrentModificationException if *v == nil { sv = &types.ConcurrentModificationException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentCopyCommand(v **types.CopyCommand, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CopyCommand if *v == nil { sv = &types.CopyCommand{} } else { sv = *v } for key, value := range shape { switch key { case "CopyOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CopyOptions to be of type string, got %T instead", value) } sv.CopyOptions = ptr.String(jtv) } case "DataTableColumns": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataTableColumns to be of type string, got %T instead", value) } sv.DataTableColumns = ptr.String(jtv) } case "DataTableName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataTableName to be of type string, got %T instead", value) } sv.DataTableName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDataFormatConversionConfiguration(v **types.DataFormatConversionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataFormatConversionConfiguration if *v == nil { sv = &types.DataFormatConversionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "InputFormatConfiguration": if err := awsAwsjson11_deserializeDocumentInputFormatConfiguration(&sv.InputFormatConfiguration, value); err != nil { return err } case "OutputFormatConfiguration": if err := awsAwsjson11_deserializeDocumentOutputFormatConfiguration(&sv.OutputFormatConfiguration, value); err != nil { return err } case "SchemaConfiguration": if err := awsAwsjson11_deserializeDocumentSchemaConfiguration(&sv.SchemaConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDeliveryStreamDescription(v **types.DeliveryStreamDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeliveryStreamDescription if *v == nil { sv = &types.DeliveryStreamDescription{} } else { sv = *v } for key, value := range shape { switch key { case "CreateTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DeliveryStreamARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamARN to be of type string, got %T instead", value) } sv.DeliveryStreamARN = ptr.String(jtv) } case "DeliveryStreamEncryptionConfiguration": if err := awsAwsjson11_deserializeDocumentDeliveryStreamEncryptionConfiguration(&sv.DeliveryStreamEncryptionConfiguration, value); err != nil { return err } case "DeliveryStreamName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamName to be of type string, got %T instead", value) } sv.DeliveryStreamName = ptr.String(jtv) } case "DeliveryStreamStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamStatus to be of type string, got %T instead", value) } sv.DeliveryStreamStatus = types.DeliveryStreamStatus(jtv) } case "DeliveryStreamType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamType to be of type string, got %T instead", value) } sv.DeliveryStreamType = types.DeliveryStreamType(jtv) } case "Destinations": if err := awsAwsjson11_deserializeDocumentDestinationDescriptionList(&sv.Destinations, value); err != nil { return err } case "FailureDescription": if err := awsAwsjson11_deserializeDocumentFailureDescription(&sv.FailureDescription, value); err != nil { return err } case "HasMoreDestinations": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.HasMoreDestinations = ptr.Bool(jtv) } case "LastUpdateTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Source": if err := awsAwsjson11_deserializeDocumentSourceDescription(&sv.Source, value); err != nil { return err } case "VersionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamVersionId to be of type string, got %T instead", value) } sv.VersionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDeliveryStreamEncryptionConfiguration(v **types.DeliveryStreamEncryptionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeliveryStreamEncryptionConfiguration if *v == nil { sv = &types.DeliveryStreamEncryptionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FailureDescription": if err := awsAwsjson11_deserializeDocumentFailureDescription(&sv.FailureDescription, value); err != nil { return err } case "KeyARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AWSKMSKeyARN to be of type string, got %T instead", value) } sv.KeyARN = ptr.String(jtv) } case "KeyType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KeyType to be of type string, got %T instead", value) } sv.KeyType = types.KeyType(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamEncryptionStatus to be of type string, got %T instead", value) } sv.Status = types.DeliveryStreamEncryptionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDeliveryStreamNameList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamName to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDeserializer(v **types.Deserializer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Deserializer if *v == nil { sv = &types.Deserializer{} } else { sv = *v } for key, value := range shape { switch key { case "HiveJsonSerDe": if err := awsAwsjson11_deserializeDocumentHiveJsonSerDe(&sv.HiveJsonSerDe, value); err != nil { return err } case "OpenXJsonSerDe": if err := awsAwsjson11_deserializeDocumentOpenXJsonSerDe(&sv.OpenXJsonSerDe, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDestinationDescription(v **types.DestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DestinationDescription if *v == nil { sv = &types.DestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "AmazonOpenSearchServerlessDestinationDescription": if err := awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessDestinationDescription(&sv.AmazonOpenSearchServerlessDestinationDescription, value); err != nil { return err } case "AmazonopensearchserviceDestinationDescription": if err := awsAwsjson11_deserializeDocumentAmazonopensearchserviceDestinationDescription(&sv.AmazonopensearchserviceDestinationDescription, value); err != nil { return err } case "DestinationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) } sv.DestinationId = ptr.String(jtv) } case "ElasticsearchDestinationDescription": if err := awsAwsjson11_deserializeDocumentElasticsearchDestinationDescription(&sv.ElasticsearchDestinationDescription, value); err != nil { return err } case "ExtendedS3DestinationDescription": if err := awsAwsjson11_deserializeDocumentExtendedS3DestinationDescription(&sv.ExtendedS3DestinationDescription, value); err != nil { return err } case "HttpEndpointDestinationDescription": if err := awsAwsjson11_deserializeDocumentHttpEndpointDestinationDescription(&sv.HttpEndpointDestinationDescription, value); err != nil { return err } case "RedshiftDestinationDescription": if err := awsAwsjson11_deserializeDocumentRedshiftDestinationDescription(&sv.RedshiftDestinationDescription, value); err != nil { return err } case "S3DestinationDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil { return err } case "SplunkDestinationDescription": if err := awsAwsjson11_deserializeDocumentSplunkDestinationDescription(&sv.SplunkDestinationDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDestinationDescriptionList(v *[]types.DestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.DestinationDescription if *v == nil { cv = []types.DestinationDescription{} } else { cv = *v } for _, value := range shape { var col types.DestinationDescription destAddr := &col if err := awsAwsjson11_deserializeDocumentDestinationDescription(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDynamicPartitioningConfiguration(v **types.DynamicPartitioningConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DynamicPartitioningConfiguration if *v == nil { sv = &types.DynamicPartitioningConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "RetryOptions": if err := awsAwsjson11_deserializeDocumentRetryOptions(&sv.RetryOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentElasticsearchBufferingHints(v **types.ElasticsearchBufferingHints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ElasticsearchBufferingHints if *v == nil { sv = &types.ElasticsearchBufferingHints{} } else { sv = *v } for key, value := range shape { switch key { case "IntervalInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ElasticsearchBufferingIntervalInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IntervalInSeconds = ptr.Int32(int32(i64)) } case "SizeInMBs": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ElasticsearchBufferingSizeInMBs to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInMBs = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentElasticsearchDestinationDescription(v **types.ElasticsearchDestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ElasticsearchDestinationDescription if *v == nil { sv = &types.ElasticsearchDestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "BufferingHints": if err := awsAwsjson11_deserializeDocumentElasticsearchBufferingHints(&sv.BufferingHints, value); err != nil { return err } case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "ClusterEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ElasticsearchClusterEndpoint to be of type string, got %T instead", value) } sv.ClusterEndpoint = ptr.String(jtv) } case "DomainARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ElasticsearchDomainARN to be of type string, got %T instead", value) } sv.DomainARN = ptr.String(jtv) } case "IndexName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ElasticsearchIndexName to be of type string, got %T instead", value) } sv.IndexName = ptr.String(jtv) } case "IndexRotationPeriod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ElasticsearchIndexRotationPeriod to be of type string, got %T instead", value) } sv.IndexRotationPeriod = types.ElasticsearchIndexRotationPeriod(jtv) } case "ProcessingConfiguration": if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil { return err } case "RetryOptions": if err := awsAwsjson11_deserializeDocumentElasticsearchRetryOptions(&sv.RetryOptions, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "S3BackupMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ElasticsearchS3BackupMode to be of type string, got %T instead", value) } sv.S3BackupMode = types.ElasticsearchS3BackupMode(jtv) } case "S3DestinationDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil { return err } case "TypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ElasticsearchTypeName to be of type string, got %T instead", value) } sv.TypeName = ptr.String(jtv) } case "VpcConfigurationDescription": if err := awsAwsjson11_deserializeDocumentVpcConfigurationDescription(&sv.VpcConfigurationDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentElasticsearchRetryOptions(v **types.ElasticsearchRetryOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ElasticsearchRetryOptions if *v == nil { sv = &types.ElasticsearchRetryOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ElasticsearchRetryDurationInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EncryptionConfiguration if *v == nil { sv = &types.EncryptionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "KMSEncryptionConfig": if err := awsAwsjson11_deserializeDocumentKMSEncryptionConfig(&sv.KMSEncryptionConfig, value); err != nil { return err } case "NoEncryptionConfig": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NoEncryptionConfig to be of type string, got %T instead", value) } sv.NoEncryptionConfig = types.NoEncryptionConfig(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentExtendedS3DestinationDescription(v **types.ExtendedS3DestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExtendedS3DestinationDescription if *v == nil { sv = &types.ExtendedS3DestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "BucketARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BucketARN to be of type string, got %T instead", value) } sv.BucketARN = ptr.String(jtv) } case "BufferingHints": if err := awsAwsjson11_deserializeDocumentBufferingHints(&sv.BufferingHints, value); err != nil { return err } case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "CompressionFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CompressionFormat to be of type string, got %T instead", value) } sv.CompressionFormat = types.CompressionFormat(jtv) } case "DataFormatConversionConfiguration": if err := awsAwsjson11_deserializeDocumentDataFormatConversionConfiguration(&sv.DataFormatConversionConfiguration, value); err != nil { return err } case "DynamicPartitioningConfiguration": if err := awsAwsjson11_deserializeDocumentDynamicPartitioningConfiguration(&sv.DynamicPartitioningConfiguration, value); err != nil { return err } case "EncryptionConfiguration": if err := awsAwsjson11_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil { return err } case "ErrorOutputPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorOutputPrefix to be of type string, got %T instead", value) } sv.ErrorOutputPrefix = ptr.String(jtv) } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "ProcessingConfiguration": if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "S3BackupDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3BackupDescription, value); err != nil { return err } case "S3BackupMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3BackupMode to be of type string, got %T instead", value) } sv.S3BackupMode = types.S3BackupMode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentFailureDescription(v **types.FailureDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FailureDescription if *v == nil { sv = &types.FailureDescription{} } else { sv = *v } for key, value := range shape { switch key { case "Details": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Details = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamFailureType to be of type string, got %T instead", value) } sv.Type = types.DeliveryStreamFailureType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHiveJsonSerDe(v **types.HiveJsonSerDe, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HiveJsonSerDe if *v == nil { sv = &types.HiveJsonSerDe{} } else { sv = *v } for key, value := range shape { switch key { case "TimestampFormats": if err := awsAwsjson11_deserializeDocumentListOfNonEmptyStrings(&sv.TimestampFormats, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHttpEndpointBufferingHints(v **types.HttpEndpointBufferingHints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HttpEndpointBufferingHints if *v == nil { sv = &types.HttpEndpointBufferingHints{} } else { sv = *v } for key, value := range shape { switch key { case "IntervalInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected HttpEndpointBufferingIntervalInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IntervalInSeconds = ptr.Int32(int32(i64)) } case "SizeInMBs": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected HttpEndpointBufferingSizeInMBs to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInMBs = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHttpEndpointCommonAttribute(v **types.HttpEndpointCommonAttribute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HttpEndpointCommonAttribute if *v == nil { sv = &types.HttpEndpointCommonAttribute{} } else { sv = *v } for key, value := range shape { switch key { case "AttributeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HttpEndpointAttributeName to be of type string, got %T instead", value) } sv.AttributeName = ptr.String(jtv) } case "AttributeValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HttpEndpointAttributeValue to be of type string, got %T instead", value) } sv.AttributeValue = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHttpEndpointCommonAttributesList(v *[]types.HttpEndpointCommonAttribute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.HttpEndpointCommonAttribute if *v == nil { cv = []types.HttpEndpointCommonAttribute{} } else { cv = *v } for _, value := range shape { var col types.HttpEndpointCommonAttribute destAddr := &col if err := awsAwsjson11_deserializeDocumentHttpEndpointCommonAttribute(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentHttpEndpointDescription(v **types.HttpEndpointDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HttpEndpointDescription if *v == nil { sv = &types.HttpEndpointDescription{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HttpEndpointName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HttpEndpointUrl to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHttpEndpointDestinationDescription(v **types.HttpEndpointDestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HttpEndpointDestinationDescription if *v == nil { sv = &types.HttpEndpointDestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "BufferingHints": if err := awsAwsjson11_deserializeDocumentHttpEndpointBufferingHints(&sv.BufferingHints, value); err != nil { return err } case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "EndpointConfiguration": if err := awsAwsjson11_deserializeDocumentHttpEndpointDescription(&sv.EndpointConfiguration, value); err != nil { return err } case "ProcessingConfiguration": if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil { return err } case "RequestConfiguration": if err := awsAwsjson11_deserializeDocumentHttpEndpointRequestConfiguration(&sv.RequestConfiguration, value); err != nil { return err } case "RetryOptions": if err := awsAwsjson11_deserializeDocumentHttpEndpointRetryOptions(&sv.RetryOptions, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "S3BackupMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HttpEndpointS3BackupMode to be of type string, got %T instead", value) } sv.S3BackupMode = types.HttpEndpointS3BackupMode(jtv) } case "S3DestinationDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHttpEndpointRequestConfiguration(v **types.HttpEndpointRequestConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HttpEndpointRequestConfiguration if *v == nil { sv = &types.HttpEndpointRequestConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CommonAttributes": if err := awsAwsjson11_deserializeDocumentHttpEndpointCommonAttributesList(&sv.CommonAttributes, value); err != nil { return err } case "ContentEncoding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentEncoding to be of type string, got %T instead", value) } sv.ContentEncoding = types.ContentEncoding(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHttpEndpointRetryOptions(v **types.HttpEndpointRetryOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HttpEndpointRetryOptions if *v == nil { sv = &types.HttpEndpointRetryOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected HttpEndpointRetryDurationInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInputFormatConfiguration(v **types.InputFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InputFormatConfiguration if *v == nil { sv = &types.InputFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Deserializer": if err := awsAwsjson11_deserializeDocumentDeserializer(&sv.Deserializer, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidArgumentException(v **types.InvalidArgumentException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidArgumentException if *v == nil { sv = &types.InvalidArgumentException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentInvalidKMSResourceException(v **types.InvalidKMSResourceException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidKMSResourceException if *v == nil { sv = &types.InvalidKMSResourceException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentKinesisStreamSourceDescription(v **types.KinesisStreamSourceDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.KinesisStreamSourceDescription if *v == nil { sv = &types.KinesisStreamSourceDescription{} } else { sv = *v } for key, value := range shape { switch key { case "DeliveryStartTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DeliveryStartTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DeliveryStartTimestamp to be a JSON Number, got %T instead", value) } } case "KinesisStreamARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KinesisStreamARN to be of type string, got %T instead", value) } sv.KinesisStreamARN = ptr.String(jtv) } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentKMSEncryptionConfig(v **types.KMSEncryptionConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.KMSEncryptionConfig if *v == nil { sv = &types.KMSEncryptionConfig{} } else { sv = *v } for key, value := range shape { switch key { case "AWSKMSKeyARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AWSKMSKeyARN to be of type string, got %T instead", value) } sv.AWSKMSKeyARN = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentListOfNonEmptyStrings(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListOfNonEmptyStringsWithoutWhitespace(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentListTagsForDeliveryStreamOutputTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentOpenXJsonSerDe(v **types.OpenXJsonSerDe, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.OpenXJsonSerDe if *v == nil { sv = &types.OpenXJsonSerDe{} } else { sv = *v } for key, value := range shape { switch key { case "CaseInsensitive": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.CaseInsensitive = ptr.Bool(jtv) } case "ColumnToJsonKeyMappings": if err := awsAwsjson11_deserializeDocumentColumnToJsonKeyMappings(&sv.ColumnToJsonKeyMappings, value); err != nil { return err } case "ConvertDotsInJsonKeysToUnderscores": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.ConvertDotsInJsonKeysToUnderscores = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOrcSerDe(v **types.OrcSerDe, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.OrcSerDe if *v == nil { sv = &types.OrcSerDe{} } else { sv = *v } for key, value := range shape { switch key { case "BlockSizeBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BlockSizeBytes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BlockSizeBytes = ptr.Int32(int32(i64)) } case "BloomFilterColumns": if err := awsAwsjson11_deserializeDocumentListOfNonEmptyStringsWithoutWhitespace(&sv.BloomFilterColumns, value); err != nil { return err } case "BloomFilterFalsePositiveProbability": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.BloomFilterFalsePositiveProbability = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.BloomFilterFalsePositiveProbability = ptr.Float64(f64) default: return fmt.Errorf("expected Proportion to be a JSON Number, got %T instead", value) } } case "Compression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrcCompression to be of type string, got %T instead", value) } sv.Compression = types.OrcCompression(jtv) } case "DictionaryKeyThreshold": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DictionaryKeyThreshold = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.DictionaryKeyThreshold = ptr.Float64(f64) default: return fmt.Errorf("expected Proportion to be a JSON Number, got %T instead", value) } } case "EnablePadding": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.EnablePadding = ptr.Bool(jtv) } case "FormatVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OrcFormatVersion to be of type string, got %T instead", value) } sv.FormatVersion = types.OrcFormatVersion(jtv) } case "PaddingTolerance": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.PaddingTolerance = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.PaddingTolerance = ptr.Float64(f64) default: return fmt.Errorf("expected Proportion to be a JSON Number, got %T instead", value) } } case "RowIndexStride": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrcRowIndexStride to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowIndexStride = ptr.Int32(int32(i64)) } case "StripeSizeBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrcStripeSizeBytes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StripeSizeBytes = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentOutputFormatConfiguration(v **types.OutputFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.OutputFormatConfiguration if *v == nil { sv = &types.OutputFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Serializer": if err := awsAwsjson11_deserializeDocumentSerializer(&sv.Serializer, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParquetSerDe(v **types.ParquetSerDe, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ParquetSerDe if *v == nil { sv = &types.ParquetSerDe{} } else { sv = *v } for key, value := range shape { switch key { case "BlockSizeBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BlockSizeBytes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BlockSizeBytes = ptr.Int32(int32(i64)) } case "Compression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParquetCompression to be of type string, got %T instead", value) } sv.Compression = types.ParquetCompression(jtv) } case "EnableDictionaryCompression": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.EnableDictionaryCompression = ptr.Bool(jtv) } case "MaxPaddingBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NonNegativeIntegerObject to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxPaddingBytes = ptr.Int32(int32(i64)) } case "PageSizeBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ParquetPageSizeBytes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PageSizeBytes = ptr.Int32(int32(i64)) } case "WriterVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParquetWriterVersion to be of type string, got %T instead", value) } sv.WriterVersion = types.ParquetWriterVersion(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProcessingConfiguration(v **types.ProcessingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProcessingConfiguration if *v == nil { sv = &types.ProcessingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "Processors": if err := awsAwsjson11_deserializeDocumentProcessorList(&sv.Processors, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProcessor(v **types.Processor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Processor if *v == nil { sv = &types.Processor{} } else { sv = *v } for key, value := range shape { switch key { case "Parameters": if err := awsAwsjson11_deserializeDocumentProcessorParameterList(&sv.Parameters, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProcessorType to be of type string, got %T instead", value) } sv.Type = types.ProcessorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProcessorList(v *[]types.Processor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Processor if *v == nil { cv = []types.Processor{} } else { cv = *v } for _, value := range shape { var col types.Processor destAddr := &col if err := awsAwsjson11_deserializeDocumentProcessor(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentProcessorParameter(v **types.ProcessorParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProcessorParameter if *v == nil { sv = &types.ProcessorParameter{} } else { sv = *v } for key, value := range shape { switch key { case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProcessorParameterName to be of type string, got %T instead", value) } sv.ParameterName = types.ProcessorParameterName(jtv) } case "ParameterValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ProcessorParameterValue to be of type string, got %T instead", value) } sv.ParameterValue = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentProcessorParameterList(v *[]types.ProcessorParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ProcessorParameter if *v == nil { cv = []types.ProcessorParameter{} } else { cv = *v } for _, value := range shape { var col types.ProcessorParameter destAddr := &col if err := awsAwsjson11_deserializeDocumentProcessorParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntry(v **types.PutRecordBatchResponseEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PutRecordBatchResponseEntry if *v == nil { sv = &types.PutRecordBatchResponseEntry{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "RecordId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PutResponseRecordId to be of type string, got %T instead", value) } sv.RecordId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntryList(v *[]types.PutRecordBatchResponseEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.PutRecordBatchResponseEntry if *v == nil { cv = []types.PutRecordBatchResponseEntry{} } else { cv = *v } for _, value := range shape { var col types.PutRecordBatchResponseEntry destAddr := &col if err := awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntry(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentRedshiftDestinationDescription(v **types.RedshiftDestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RedshiftDestinationDescription if *v == nil { sv = &types.RedshiftDestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "ClusterJDBCURL": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterJDBCURL to be of type string, got %T instead", value) } sv.ClusterJDBCURL = ptr.String(jtv) } case "CopyCommand": if err := awsAwsjson11_deserializeDocumentCopyCommand(&sv.CopyCommand, value); err != nil { return err } case "ProcessingConfiguration": if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil { return err } case "RetryOptions": if err := awsAwsjson11_deserializeDocumentRedshiftRetryOptions(&sv.RetryOptions, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "S3BackupDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3BackupDescription, value); err != nil { return err } case "S3BackupMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RedshiftS3BackupMode to be of type string, got %T instead", value) } sv.S3BackupMode = types.RedshiftS3BackupMode(jtv) } case "S3DestinationDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil { return err } case "Username": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Username to be of type string, got %T instead", value) } sv.Username = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRedshiftRetryOptions(v **types.RedshiftRetryOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RedshiftRetryOptions if *v == nil { sv = &types.RedshiftRetryOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RedshiftRetryDurationInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceInUseException if *v == nil { sv = &types.ResourceInUseException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRetryOptions(v **types.RetryOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RetryOptions if *v == nil { sv = &types.RetryOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RetryDurationInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3DestinationDescription(v **types.S3DestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3DestinationDescription if *v == nil { sv = &types.S3DestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "BucketARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BucketARN to be of type string, got %T instead", value) } sv.BucketARN = ptr.String(jtv) } case "BufferingHints": if err := awsAwsjson11_deserializeDocumentBufferingHints(&sv.BufferingHints, value); err != nil { return err } case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "CompressionFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CompressionFormat to be of type string, got %T instead", value) } sv.CompressionFormat = types.CompressionFormat(jtv) } case "EncryptionConfiguration": if err := awsAwsjson11_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil { return err } case "ErrorOutputPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorOutputPrefix to be of type string, got %T instead", value) } sv.ErrorOutputPrefix = ptr.String(jtv) } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSchemaConfiguration(v **types.SchemaConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SchemaConfiguration if *v == nil { sv = &types.SchemaConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CatalogId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } sv.CatalogId = ptr.String(jtv) } case "DatabaseName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } sv.DatabaseName = ptr.String(jtv) } case "Region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "TableName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } sv.TableName = ptr.String(jtv) } case "VersionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } sv.VersionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSecurityGroupIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentSerializer(v **types.Serializer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Serializer if *v == nil { sv = &types.Serializer{} } else { sv = *v } for key, value := range shape { switch key { case "OrcSerDe": if err := awsAwsjson11_deserializeDocumentOrcSerDe(&sv.OrcSerDe, value); err != nil { return err } case "ParquetSerDe": if err := awsAwsjson11_deserializeDocumentParquetSerDe(&sv.ParquetSerDe, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSourceDescription(v **types.SourceDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SourceDescription if *v == nil { sv = &types.SourceDescription{} } else { sv = *v } for key, value := range shape { switch key { case "KinesisStreamSourceDescription": if err := awsAwsjson11_deserializeDocumentKinesisStreamSourceDescription(&sv.KinesisStreamSourceDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSplunkDestinationDescription(v **types.SplunkDestinationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SplunkDestinationDescription if *v == nil { sv = &types.SplunkDestinationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLoggingOptions": if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil { return err } case "HECAcknowledgmentTimeoutInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected HECAcknowledgmentTimeoutInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.HECAcknowledgmentTimeoutInSeconds = ptr.Int32(int32(i64)) } case "HECEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HECEndpoint to be of type string, got %T instead", value) } sv.HECEndpoint = ptr.String(jtv) } case "HECEndpointType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HECEndpointType to be of type string, got %T instead", value) } sv.HECEndpointType = types.HECEndpointType(jtv) } case "HECToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HECToken to be of type string, got %T instead", value) } sv.HECToken = ptr.String(jtv) } case "ProcessingConfiguration": if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil { return err } case "RetryOptions": if err := awsAwsjson11_deserializeDocumentSplunkRetryOptions(&sv.RetryOptions, value); err != nil { return err } case "S3BackupMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SplunkS3BackupMode to be of type string, got %T instead", value) } sv.S3BackupMode = types.SplunkS3BackupMode(jtv) } case "S3DestinationDescription": if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSplunkRetryOptions(v **types.SplunkRetryOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SplunkRetryOptions if *v == nil { sv = &types.SplunkRetryOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SplunkRetryDurationInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DurationInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSubnetIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentVpcConfigurationDescription(v **types.VpcConfigurationDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VpcConfigurationDescription if *v == nil { sv = &types.VpcConfigurationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "SecurityGroupIds": if err := awsAwsjson11_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsAwsjson11_deserializeDocumentSubnetIdList(&sv.SubnetIds, value); err != nil { return err } case "VpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateDeliveryStreamOutput(v **CreateDeliveryStreamOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDeliveryStreamOutput if *v == nil { sv = &CreateDeliveryStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DeliveryStreamARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliveryStreamARN to be of type string, got %T instead", value) } sv.DeliveryStreamARN = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteDeliveryStreamOutput(v **DeleteDeliveryStreamOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteDeliveryStreamOutput if *v == nil { sv = &DeleteDeliveryStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeDeliveryStreamOutput(v **DescribeDeliveryStreamOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDeliveryStreamOutput if *v == nil { sv = &DescribeDeliveryStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DeliveryStreamDescription": if err := awsAwsjson11_deserializeDocumentDeliveryStreamDescription(&sv.DeliveryStreamDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListDeliveryStreamsOutput(v **ListDeliveryStreamsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDeliveryStreamsOutput if *v == nil { sv = &ListDeliveryStreamsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DeliveryStreamNames": if err := awsAwsjson11_deserializeDocumentDeliveryStreamNameList(&sv.DeliveryStreamNames, value); err != nil { return err } case "HasMoreDeliveryStreams": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.HasMoreDeliveryStreams = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListTagsForDeliveryStreamOutput(v **ListTagsForDeliveryStreamOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForDeliveryStreamOutput if *v == nil { sv = &ListTagsForDeliveryStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HasMoreTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.HasMoreTags = ptr.Bool(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentListTagsForDeliveryStreamOutputTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPutRecordBatchOutput(v **PutRecordBatchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutRecordBatchOutput if *v == nil { sv = &PutRecordBatchOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "FailedPutCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NonNegativeIntegerObject to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.FailedPutCount = ptr.Int32(int32(i64)) } case "RequestResponses": if err := awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntryList(&sv.RequestResponses, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPutRecordOutput(v **PutRecordOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutRecordOutput if *v == nil { sv = &PutRecordOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "RecordId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PutResponseRecordId to be of type string, got %T instead", value) } sv.RecordId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartDeliveryStreamEncryptionOutput(v **StartDeliveryStreamEncryptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartDeliveryStreamEncryptionOutput if *v == nil { sv = &StartDeliveryStreamEncryptionOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStopDeliveryStreamEncryptionOutput(v **StopDeliveryStreamEncryptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StopDeliveryStreamEncryptionOutput if *v == nil { sv = &StopDeliveryStreamEncryptionOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTagDeliveryStreamOutput(v **TagDeliveryStreamOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TagDeliveryStreamOutput if *v == nil { sv = &TagDeliveryStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUntagDeliveryStreamOutput(v **UntagDeliveryStreamOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UntagDeliveryStreamOutput if *v == nil { sv = &UntagDeliveryStreamOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateDestinationOutput(v **UpdateDestinationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDestinationOutput if *v == nil { sv = &UpdateDestinationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil }