Bumps [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) from 1.13.14 to 1.13.19. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mq/v1.13.14...credentials/v1.13.19) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
18628 lines
470 KiB
Go
18628 lines
470 KiB
Go
// Code generated by smithy-go-codegen DO NOT EDIT.
|
|
|
|
package dynamodb
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"encoding/base64"
|
|
"encoding/json"
|
|
"fmt"
|
|
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
|
|
"github.com/aws/aws-sdk-go-v2/service/dynamodb/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"
|
|
"io/ioutil"
|
|
"math"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
func deserializeS3Expires(v string) (*time.Time, error) {
|
|
t, err := smithytime.ParseHTTPDate(v)
|
|
if err != nil {
|
|
return nil, nil
|
|
}
|
|
return &t, nil
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpBatchExecuteStatement struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpBatchExecuteStatement) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpBatchExecuteStatement) 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, awsAwsjson10_deserializeOpErrorBatchExecuteStatement(response, &metadata)
|
|
}
|
|
output := &BatchExecuteStatementOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentBatchExecuteStatementOutput(&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 awsAwsjson10_deserializeOpErrorBatchExecuteStatement(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpBatchGetItem struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpBatchGetItem) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpBatchGetItem) 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, awsAwsjson10_deserializeOpErrorBatchGetItem(response, &metadata)
|
|
}
|
|
output := &BatchGetItemOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentBatchGetItemOutput(&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 awsAwsjson10_deserializeOpErrorBatchGetItem(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpBatchWriteItem struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpBatchWriteItem) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpBatchWriteItem) 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, awsAwsjson10_deserializeOpErrorBatchWriteItem(response, &metadata)
|
|
}
|
|
output := &BatchWriteItemOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentBatchWriteItemOutput(&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 awsAwsjson10_deserializeOpErrorBatchWriteItem(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ItemCollectionSizeLimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpCreateBackup struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpCreateBackup) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpCreateBackup) 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, awsAwsjson10_deserializeOpErrorCreateBackup(response, &metadata)
|
|
}
|
|
output := &CreateBackupOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentCreateBackupOutput(&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 awsAwsjson10_deserializeOpErrorCreateBackup(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("BackupInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorBackupInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ContinuousBackupsUnavailableException", errorCode):
|
|
return awsAwsjson10_deserializeErrorContinuousBackupsUnavailableException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpCreateGlobalTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpCreateGlobalTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpCreateGlobalTable) 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, awsAwsjson10_deserializeOpErrorCreateGlobalTable(response, &metadata)
|
|
}
|
|
output := &CreateGlobalTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentCreateGlobalTableOutput(&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 awsAwsjson10_deserializeOpErrorCreateGlobalTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("GlobalTableAlreadyExistsException", errorCode):
|
|
return awsAwsjson10_deserializeErrorGlobalTableAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpCreateTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpCreateTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpCreateTable) 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, awsAwsjson10_deserializeOpErrorCreateTable(response, &metadata)
|
|
}
|
|
output := &CreateTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentCreateTableOutput(&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 awsAwsjson10_deserializeOpErrorCreateTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDeleteBackup struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDeleteBackup) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDeleteBackup) 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, awsAwsjson10_deserializeOpErrorDeleteBackup(response, &metadata)
|
|
}
|
|
output := &DeleteBackupOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDeleteBackupOutput(&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 awsAwsjson10_deserializeOpErrorDeleteBackup(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("BackupInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorBackupInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("BackupNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorBackupNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDeleteItem struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDeleteItem) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDeleteItem) 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, awsAwsjson10_deserializeOpErrorDeleteItem(response, &metadata)
|
|
}
|
|
output := &DeleteItemOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDeleteItemOutput(&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 awsAwsjson10_deserializeOpErrorDeleteItem(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ConditionalCheckFailedException", errorCode):
|
|
return awsAwsjson10_deserializeErrorConditionalCheckFailedException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ItemCollectionSizeLimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionConflictException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionConflictException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDeleteResourcePolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDeleteResourcePolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDeleteResourcePolicy) 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, awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response, &metadata)
|
|
}
|
|
output := &DeleteResourcePolicyOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDeleteResourcePolicyOutput(&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 awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("PolicyNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorPolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDeleteTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDeleteTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDeleteTable) 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, awsAwsjson10_deserializeOpErrorDeleteTable(response, &metadata)
|
|
}
|
|
output := &DeleteTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDeleteTableOutput(&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 awsAwsjson10_deserializeOpErrorDeleteTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeBackup struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeBackup) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeBackup) 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, awsAwsjson10_deserializeOpErrorDescribeBackup(response, &metadata)
|
|
}
|
|
output := &DescribeBackupOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeBackupOutput(&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 awsAwsjson10_deserializeOpErrorDescribeBackup(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("BackupNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorBackupNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeContinuousBackups struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeContinuousBackups) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeContinuousBackups) 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, awsAwsjson10_deserializeOpErrorDescribeContinuousBackups(response, &metadata)
|
|
}
|
|
output := &DescribeContinuousBackupsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeContinuousBackupsOutput(&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 awsAwsjson10_deserializeOpErrorDescribeContinuousBackups(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeContributorInsights struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeContributorInsights) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeContributorInsights) 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, awsAwsjson10_deserializeOpErrorDescribeContributorInsights(response, &metadata)
|
|
}
|
|
output := &DescribeContributorInsightsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeContributorInsightsOutput(&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 awsAwsjson10_deserializeOpErrorDescribeContributorInsights(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeEndpoints struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeEndpoints) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeEndpoints) 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, awsAwsjson10_deserializeOpErrorDescribeEndpoints(response, &metadata)
|
|
}
|
|
output := &DescribeEndpointsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeEndpointsOutput(&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 awsAwsjson10_deserializeOpErrorDescribeEndpoints(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeExport struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeExport) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeExport) 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, awsAwsjson10_deserializeOpErrorDescribeExport(response, &metadata)
|
|
}
|
|
output := &DescribeExportOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeExportOutput(&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 awsAwsjson10_deserializeOpErrorDescribeExport(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ExportNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorExportNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeGlobalTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeGlobalTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeGlobalTable) 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, awsAwsjson10_deserializeOpErrorDescribeGlobalTable(response, &metadata)
|
|
}
|
|
output := &DescribeGlobalTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeGlobalTableOutput(&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 awsAwsjson10_deserializeOpErrorDescribeGlobalTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("GlobalTableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorGlobalTableNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeGlobalTableSettings struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeGlobalTableSettings) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeGlobalTableSettings) 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, awsAwsjson10_deserializeOpErrorDescribeGlobalTableSettings(response, &metadata)
|
|
}
|
|
output := &DescribeGlobalTableSettingsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeGlobalTableSettingsOutput(&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 awsAwsjson10_deserializeOpErrorDescribeGlobalTableSettings(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("GlobalTableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorGlobalTableNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeImport struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeImport) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeImport) 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, awsAwsjson10_deserializeOpErrorDescribeImport(response, &metadata)
|
|
}
|
|
output := &DescribeImportOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeImportOutput(&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 awsAwsjson10_deserializeOpErrorDescribeImport(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ImportNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorImportNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeKinesisStreamingDestination struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeKinesisStreamingDestination) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeKinesisStreamingDestination) 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, awsAwsjson10_deserializeOpErrorDescribeKinesisStreamingDestination(response, &metadata)
|
|
}
|
|
output := &DescribeKinesisStreamingDestinationOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeKinesisStreamingDestinationOutput(&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 awsAwsjson10_deserializeOpErrorDescribeKinesisStreamingDestination(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeLimits struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeLimits) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeLimits) 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, awsAwsjson10_deserializeOpErrorDescribeLimits(response, &metadata)
|
|
}
|
|
output := &DescribeLimitsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeLimitsOutput(&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 awsAwsjson10_deserializeOpErrorDescribeLimits(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeTable) 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, awsAwsjson10_deserializeOpErrorDescribeTable(response, &metadata)
|
|
}
|
|
output := &DescribeTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeTableOutput(&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 awsAwsjson10_deserializeOpErrorDescribeTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeTableReplicaAutoScaling struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeTableReplicaAutoScaling) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeTableReplicaAutoScaling) 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, awsAwsjson10_deserializeOpErrorDescribeTableReplicaAutoScaling(response, &metadata)
|
|
}
|
|
output := &DescribeTableReplicaAutoScalingOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeTableReplicaAutoScalingOutput(&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 awsAwsjson10_deserializeOpErrorDescribeTableReplicaAutoScaling(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDescribeTimeToLive struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDescribeTimeToLive) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDescribeTimeToLive) 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, awsAwsjson10_deserializeOpErrorDescribeTimeToLive(response, &metadata)
|
|
}
|
|
output := &DescribeTimeToLiveOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDescribeTimeToLiveOutput(&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 awsAwsjson10_deserializeOpErrorDescribeTimeToLive(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpDisableKinesisStreamingDestination struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpDisableKinesisStreamingDestination) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpDisableKinesisStreamingDestination) 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, awsAwsjson10_deserializeOpErrorDisableKinesisStreamingDestination(response, &metadata)
|
|
}
|
|
output := &DisableKinesisStreamingDestinationOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentDisableKinesisStreamingDestinationOutput(&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 awsAwsjson10_deserializeOpErrorDisableKinesisStreamingDestination(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpEnableKinesisStreamingDestination struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpEnableKinesisStreamingDestination) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpEnableKinesisStreamingDestination) 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, awsAwsjson10_deserializeOpErrorEnableKinesisStreamingDestination(response, &metadata)
|
|
}
|
|
output := &EnableKinesisStreamingDestinationOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentEnableKinesisStreamingDestinationOutput(&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 awsAwsjson10_deserializeOpErrorEnableKinesisStreamingDestination(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpExecuteStatement struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpExecuteStatement) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpExecuteStatement) 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, awsAwsjson10_deserializeOpErrorExecuteStatement(response, &metadata)
|
|
}
|
|
output := &ExecuteStatementOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentExecuteStatementOutput(&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 awsAwsjson10_deserializeOpErrorExecuteStatement(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ConditionalCheckFailedException", errorCode):
|
|
return awsAwsjson10_deserializeErrorConditionalCheckFailedException(response, errorBody)
|
|
|
|
case strings.EqualFold("DuplicateItemException", errorCode):
|
|
return awsAwsjson10_deserializeErrorDuplicateItemException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("ItemCollectionSizeLimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionConflictException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionConflictException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpExecuteTransaction struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpExecuteTransaction) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpExecuteTransaction) 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, awsAwsjson10_deserializeOpErrorExecuteTransaction(response, &metadata)
|
|
}
|
|
output := &ExecuteTransactionOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentExecuteTransactionOutput(&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 awsAwsjson10_deserializeOpErrorExecuteTransaction(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
|
|
return awsAwsjson10_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionCanceledException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionCanceledException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionInProgressException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionInProgressException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpExportTableToPointInTime struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpExportTableToPointInTime) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpExportTableToPointInTime) 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, awsAwsjson10_deserializeOpErrorExportTableToPointInTime(response, &metadata)
|
|
}
|
|
output := &ExportTableToPointInTimeOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentExportTableToPointInTimeOutput(&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 awsAwsjson10_deserializeOpErrorExportTableToPointInTime(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ExportConflictException", errorCode):
|
|
return awsAwsjson10_deserializeErrorExportConflictException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidExportTimeException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidExportTimeException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("PointInTimeRecoveryUnavailableException", errorCode):
|
|
return awsAwsjson10_deserializeErrorPointInTimeRecoveryUnavailableException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpGetItem struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpGetItem) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpGetItem) 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, awsAwsjson10_deserializeOpErrorGetItem(response, &metadata)
|
|
}
|
|
output := &GetItemOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentGetItemOutput(&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 awsAwsjson10_deserializeOpErrorGetItem(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpGetResourcePolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpGetResourcePolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpGetResourcePolicy) 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, awsAwsjson10_deserializeOpErrorGetResourcePolicy(response, &metadata)
|
|
}
|
|
output := &GetResourcePolicyOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentGetResourcePolicyOutput(&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 awsAwsjson10_deserializeOpErrorGetResourcePolicy(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("PolicyNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorPolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpImportTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpImportTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpImportTable) 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, awsAwsjson10_deserializeOpErrorImportTable(response, &metadata)
|
|
}
|
|
output := &ImportTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentImportTableOutput(&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 awsAwsjson10_deserializeOpErrorImportTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ImportConflictException", errorCode):
|
|
return awsAwsjson10_deserializeErrorImportConflictException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpListBackups struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpListBackups) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpListBackups) 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, awsAwsjson10_deserializeOpErrorListBackups(response, &metadata)
|
|
}
|
|
output := &ListBackupsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentListBackupsOutput(&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 awsAwsjson10_deserializeOpErrorListBackups(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpListContributorInsights struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpListContributorInsights) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpListContributorInsights) 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, awsAwsjson10_deserializeOpErrorListContributorInsights(response, &metadata)
|
|
}
|
|
output := &ListContributorInsightsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentListContributorInsightsOutput(&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 awsAwsjson10_deserializeOpErrorListContributorInsights(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpListExports struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpListExports) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpListExports) 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, awsAwsjson10_deserializeOpErrorListExports(response, &metadata)
|
|
}
|
|
output := &ListExportsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentListExportsOutput(&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 awsAwsjson10_deserializeOpErrorListExports(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpListGlobalTables struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpListGlobalTables) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpListGlobalTables) 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, awsAwsjson10_deserializeOpErrorListGlobalTables(response, &metadata)
|
|
}
|
|
output := &ListGlobalTablesOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentListGlobalTablesOutput(&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 awsAwsjson10_deserializeOpErrorListGlobalTables(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpListImports struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpListImports) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpListImports) 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, awsAwsjson10_deserializeOpErrorListImports(response, &metadata)
|
|
}
|
|
output := &ListImportsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentListImportsOutput(&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 awsAwsjson10_deserializeOpErrorListImports(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpListTables struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpListTables) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpListTables) 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, awsAwsjson10_deserializeOpErrorListTables(response, &metadata)
|
|
}
|
|
output := &ListTablesOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentListTablesOutput(&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 awsAwsjson10_deserializeOpErrorListTables(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpListTagsOfResource struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpListTagsOfResource) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpListTagsOfResource) 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, awsAwsjson10_deserializeOpErrorListTagsOfResource(response, &metadata)
|
|
}
|
|
output := &ListTagsOfResourceOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentListTagsOfResourceOutput(&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 awsAwsjson10_deserializeOpErrorListTagsOfResource(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpPutItem struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpPutItem) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpPutItem) 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, awsAwsjson10_deserializeOpErrorPutItem(response, &metadata)
|
|
}
|
|
output := &PutItemOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentPutItemOutput(&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 awsAwsjson10_deserializeOpErrorPutItem(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ConditionalCheckFailedException", errorCode):
|
|
return awsAwsjson10_deserializeErrorConditionalCheckFailedException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ItemCollectionSizeLimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionConflictException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionConflictException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpPutResourcePolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpPutResourcePolicy) 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, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata)
|
|
}
|
|
output := &PutResourcePolicyOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&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 awsAwsjson10_deserializeOpErrorPutResourcePolicy(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("PolicyNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorPolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpQuery struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpQuery) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpQuery) 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, awsAwsjson10_deserializeOpErrorQuery(response, &metadata)
|
|
}
|
|
output := &QueryOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentQueryOutput(&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 awsAwsjson10_deserializeOpErrorQuery(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpRestoreTableFromBackup struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpRestoreTableFromBackup) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpRestoreTableFromBackup) 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, awsAwsjson10_deserializeOpErrorRestoreTableFromBackup(response, &metadata)
|
|
}
|
|
output := &RestoreTableFromBackupOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentRestoreTableFromBackupOutput(&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 awsAwsjson10_deserializeOpErrorRestoreTableFromBackup(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("BackupInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorBackupInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("BackupNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorBackupNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableAlreadyExistsException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableInUseException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpRestoreTableToPointInTime struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpRestoreTableToPointInTime) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpRestoreTableToPointInTime) 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, awsAwsjson10_deserializeOpErrorRestoreTableToPointInTime(response, &metadata)
|
|
}
|
|
output := &RestoreTableToPointInTimeOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentRestoreTableToPointInTimeOutput(&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 awsAwsjson10_deserializeOpErrorRestoreTableToPointInTime(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidRestoreTimeException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidRestoreTimeException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("PointInTimeRecoveryUnavailableException", errorCode):
|
|
return awsAwsjson10_deserializeErrorPointInTimeRecoveryUnavailableException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableAlreadyExistsException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpScan struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpScan) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpScan) 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, awsAwsjson10_deserializeOpErrorScan(response, &metadata)
|
|
}
|
|
output := &ScanOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentScanOutput(&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 awsAwsjson10_deserializeOpErrorScan(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpTagResource struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpTagResource) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpTagResource) 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, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata)
|
|
}
|
|
output := &TagResourceOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpErrorTagResource(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpTransactGetItems struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpTransactGetItems) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpTransactGetItems) 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, awsAwsjson10_deserializeOpErrorTransactGetItems(response, &metadata)
|
|
}
|
|
output := &TransactGetItemsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentTransactGetItemsOutput(&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 awsAwsjson10_deserializeOpErrorTransactGetItems(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionCanceledException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionCanceledException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpTransactWriteItems struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpTransactWriteItems) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpTransactWriteItems) 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, awsAwsjson10_deserializeOpErrorTransactWriteItems(response, &metadata)
|
|
}
|
|
output := &TransactWriteItemsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentTransactWriteItemsOutput(&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 awsAwsjson10_deserializeOpErrorTransactWriteItems(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("IdempotentParameterMismatchException", errorCode):
|
|
return awsAwsjson10_deserializeErrorIdempotentParameterMismatchException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionCanceledException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionCanceledException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionInProgressException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionInProgressException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUntagResource struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUntagResource) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUntagResource) 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, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata)
|
|
}
|
|
output := &UntagResourceOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpErrorUntagResource(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateContinuousBackups struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateContinuousBackups) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateContinuousBackups) 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, awsAwsjson10_deserializeOpErrorUpdateContinuousBackups(response, &metadata)
|
|
}
|
|
output := &UpdateContinuousBackupsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateContinuousBackupsOutput(&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 awsAwsjson10_deserializeOpErrorUpdateContinuousBackups(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ContinuousBackupsUnavailableException", errorCode):
|
|
return awsAwsjson10_deserializeErrorContinuousBackupsUnavailableException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateContributorInsights struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateContributorInsights) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateContributorInsights) 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, awsAwsjson10_deserializeOpErrorUpdateContributorInsights(response, &metadata)
|
|
}
|
|
output := &UpdateContributorInsightsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateContributorInsightsOutput(&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 awsAwsjson10_deserializeOpErrorUpdateContributorInsights(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateGlobalTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateGlobalTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateGlobalTable) 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, awsAwsjson10_deserializeOpErrorUpdateGlobalTable(response, &metadata)
|
|
}
|
|
output := &UpdateGlobalTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateGlobalTableOutput(&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 awsAwsjson10_deserializeOpErrorUpdateGlobalTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("GlobalTableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorGlobalTableNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ReplicaAlreadyExistsException", errorCode):
|
|
return awsAwsjson10_deserializeErrorReplicaAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("ReplicaNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorReplicaNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTableNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateGlobalTableSettings struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateGlobalTableSettings) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateGlobalTableSettings) 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, awsAwsjson10_deserializeOpErrorUpdateGlobalTableSettings(response, &metadata)
|
|
}
|
|
output := &UpdateGlobalTableSettingsOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateGlobalTableSettingsOutput(&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 awsAwsjson10_deserializeOpErrorUpdateGlobalTableSettings(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("GlobalTableNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorGlobalTableNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("IndexNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorIndexNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ReplicaNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorReplicaNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateItem struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateItem) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateItem) 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, awsAwsjson10_deserializeOpErrorUpdateItem(response, &metadata)
|
|
}
|
|
output := &UpdateItemOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateItemOutput(&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 awsAwsjson10_deserializeOpErrorUpdateItem(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ConditionalCheckFailedException", errorCode):
|
|
return awsAwsjson10_deserializeErrorConditionalCheckFailedException(response, errorBody)
|
|
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("ItemCollectionSizeLimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RequestLimitExceeded", errorCode):
|
|
return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("TransactionConflictException", errorCode):
|
|
return awsAwsjson10_deserializeErrorTransactionConflictException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination) 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, awsAwsjson10_deserializeOpErrorUpdateKinesisStreamingDestination(response, &metadata)
|
|
}
|
|
output := &UpdateKinesisStreamingDestinationOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateKinesisStreamingDestinationOutput(&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 awsAwsjson10_deserializeOpErrorUpdateKinesisStreamingDestination(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateTable struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateTable) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateTable) 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, awsAwsjson10_deserializeOpErrorUpdateTable(response, &metadata)
|
|
}
|
|
output := &UpdateTableOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateTableOutput(&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 awsAwsjson10_deserializeOpErrorUpdateTable(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateTableReplicaAutoScaling struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateTableReplicaAutoScaling) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateTableReplicaAutoScaling) 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, awsAwsjson10_deserializeOpErrorUpdateTableReplicaAutoScaling(response, &metadata)
|
|
}
|
|
output := &UpdateTableReplicaAutoScalingOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateTableReplicaAutoScalingOutput(&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 awsAwsjson10_deserializeOpErrorUpdateTableReplicaAutoScaling(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson10_deserializeOpUpdateTimeToLive struct {
|
|
}
|
|
|
|
func (*awsAwsjson10_deserializeOpUpdateTimeToLive) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson10_deserializeOpUpdateTimeToLive) 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, awsAwsjson10_deserializeOpErrorUpdateTimeToLive(response, &metadata)
|
|
}
|
|
output := &UpdateTimeToLiveOutput{}
|
|
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 = awsAwsjson10_deserializeOpDocumentUpdateTimeToLiveOutput(&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 awsAwsjson10_deserializeOpErrorUpdateTimeToLive(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")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InternalServerError", errorCode):
|
|
return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidEndpointException", errorCode):
|
|
return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceInUseException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody)
|
|
|
|
case strings.EqualFold("ResourceNotFoundException", errorCode):
|
|
return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsAwsjson10_deserializeErrorBackupInUseException(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.BackupInUseException{}
|
|
err := awsAwsjson10_deserializeDocumentBackupInUseException(&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 awsAwsjson10_deserializeErrorBackupNotFoundException(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.BackupNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentBackupNotFoundException(&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 awsAwsjson10_deserializeErrorConditionalCheckFailedException(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.ConditionalCheckFailedException{}
|
|
err := awsAwsjson10_deserializeDocumentConditionalCheckFailedException(&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 awsAwsjson10_deserializeErrorContinuousBackupsUnavailableException(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.ContinuousBackupsUnavailableException{}
|
|
err := awsAwsjson10_deserializeDocumentContinuousBackupsUnavailableException(&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 awsAwsjson10_deserializeErrorDuplicateItemException(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.DuplicateItemException{}
|
|
err := awsAwsjson10_deserializeDocumentDuplicateItemException(&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 awsAwsjson10_deserializeErrorExportConflictException(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.ExportConflictException{}
|
|
err := awsAwsjson10_deserializeDocumentExportConflictException(&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 awsAwsjson10_deserializeErrorExportNotFoundException(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.ExportNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentExportNotFoundException(&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 awsAwsjson10_deserializeErrorGlobalTableAlreadyExistsException(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.GlobalTableAlreadyExistsException{}
|
|
err := awsAwsjson10_deserializeDocumentGlobalTableAlreadyExistsException(&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 awsAwsjson10_deserializeErrorGlobalTableNotFoundException(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.GlobalTableNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentGlobalTableNotFoundException(&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 awsAwsjson10_deserializeErrorIdempotentParameterMismatchException(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.IdempotentParameterMismatchException{}
|
|
err := awsAwsjson10_deserializeDocumentIdempotentParameterMismatchException(&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 awsAwsjson10_deserializeErrorImportConflictException(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.ImportConflictException{}
|
|
err := awsAwsjson10_deserializeDocumentImportConflictException(&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 awsAwsjson10_deserializeErrorImportNotFoundException(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.ImportNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentImportNotFoundException(&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 awsAwsjson10_deserializeErrorIndexNotFoundException(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.IndexNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentIndexNotFoundException(&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 awsAwsjson10_deserializeErrorInternalServerError(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.InternalServerError{}
|
|
err := awsAwsjson10_deserializeDocumentInternalServerError(&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 awsAwsjson10_deserializeErrorInvalidEndpointException(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.InvalidEndpointException{}
|
|
err := awsAwsjson10_deserializeDocumentInvalidEndpointException(&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 awsAwsjson10_deserializeErrorInvalidExportTimeException(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.InvalidExportTimeException{}
|
|
err := awsAwsjson10_deserializeDocumentInvalidExportTimeException(&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 awsAwsjson10_deserializeErrorInvalidRestoreTimeException(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.InvalidRestoreTimeException{}
|
|
err := awsAwsjson10_deserializeDocumentInvalidRestoreTimeException(&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 awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(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.ItemCollectionSizeLimitExceededException{}
|
|
err := awsAwsjson10_deserializeDocumentItemCollectionSizeLimitExceededException(&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 awsAwsjson10_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 := awsAwsjson10_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 awsAwsjson10_deserializeErrorPointInTimeRecoveryUnavailableException(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.PointInTimeRecoveryUnavailableException{}
|
|
err := awsAwsjson10_deserializeDocumentPointInTimeRecoveryUnavailableException(&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 awsAwsjson10_deserializeErrorPolicyNotFoundException(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.PolicyNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentPolicyNotFoundException(&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 awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(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.ProvisionedThroughputExceededException{}
|
|
err := awsAwsjson10_deserializeDocumentProvisionedThroughputExceededException(&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 awsAwsjson10_deserializeErrorReplicaAlreadyExistsException(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.ReplicaAlreadyExistsException{}
|
|
err := awsAwsjson10_deserializeDocumentReplicaAlreadyExistsException(&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 awsAwsjson10_deserializeErrorReplicaNotFoundException(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.ReplicaNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentReplicaNotFoundException(&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 awsAwsjson10_deserializeErrorRequestLimitExceeded(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.RequestLimitExceeded{}
|
|
err := awsAwsjson10_deserializeDocumentRequestLimitExceeded(&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 awsAwsjson10_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 := awsAwsjson10_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 awsAwsjson10_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 := awsAwsjson10_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 awsAwsjson10_deserializeErrorTableAlreadyExistsException(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.TableAlreadyExistsException{}
|
|
err := awsAwsjson10_deserializeDocumentTableAlreadyExistsException(&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 awsAwsjson10_deserializeErrorTableInUseException(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.TableInUseException{}
|
|
err := awsAwsjson10_deserializeDocumentTableInUseException(&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 awsAwsjson10_deserializeErrorTableNotFoundException(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.TableNotFoundException{}
|
|
err := awsAwsjson10_deserializeDocumentTableNotFoundException(&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 awsAwsjson10_deserializeErrorTransactionCanceledException(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.TransactionCanceledException{}
|
|
err := awsAwsjson10_deserializeDocumentTransactionCanceledException(&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 awsAwsjson10_deserializeErrorTransactionConflictException(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.TransactionConflictException{}
|
|
err := awsAwsjson10_deserializeDocumentTransactionConflictException(&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 awsAwsjson10_deserializeErrorTransactionInProgressException(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.TransactionInProgressException{}
|
|
err := awsAwsjson10_deserializeDocumentTransactionInProgressException(&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 awsAwsjson10_deserializeDocumentArchivalSummary(v **types.ArchivalSummary, 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.ArchivalSummary
|
|
if *v == nil {
|
|
sv = &types.ArchivalSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ArchivalBackupArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.ArchivalBackupArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ArchivalDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ArchivalDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ArchivalReason":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ArchivalReason to be of type string, got %T instead", value)
|
|
}
|
|
sv.ArchivalReason = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAttributeDefinition(v **types.AttributeDefinition, 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.AttributeDefinition
|
|
if *v == nil {
|
|
sv = &types.AttributeDefinition{}
|
|
} 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 KeySchemaAttributeName to be of type string, got %T instead", value)
|
|
}
|
|
sv.AttributeName = ptr.String(jtv)
|
|
}
|
|
|
|
case "AttributeType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScalarAttributeType to be of type string, got %T instead", value)
|
|
}
|
|
sv.AttributeType = types.ScalarAttributeType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAttributeDefinitions(v *[]types.AttributeDefinition, 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.AttributeDefinition
|
|
if *v == nil {
|
|
cv = []types.AttributeDefinition{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.AttributeDefinition
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentAttributeDefinition(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAttributeMap(v *map[string]types.AttributeValue, 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]types.AttributeValue
|
|
if *v == nil {
|
|
mv = map[string]types.AttributeValue{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal types.AttributeValue
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentAttributeValue(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAttributeNameList(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 AttributeName to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAttributeValue(v *types.AttributeValue, 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 uv types.AttributeValue
|
|
loop:
|
|
for key, value := range shape {
|
|
if value == nil {
|
|
continue
|
|
}
|
|
switch key {
|
|
case "B":
|
|
var mv []byte
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BinaryAttributeValue to be []byte, got %T instead", value)
|
|
}
|
|
dv, err := base64.StdEncoding.DecodeString(jtv)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to base64 decode BinaryAttributeValue, %w", err)
|
|
}
|
|
mv = dv
|
|
}
|
|
uv = &types.AttributeValueMemberB{Value: mv}
|
|
break loop
|
|
|
|
case "BOOL":
|
|
var mv bool
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected BooleanAttributeValue to be of type *bool, got %T instead", value)
|
|
}
|
|
mv = jtv
|
|
}
|
|
uv = &types.AttributeValueMemberBOOL{Value: mv}
|
|
break loop
|
|
|
|
case "BS":
|
|
var mv [][]byte
|
|
if err := awsAwsjson10_deserializeDocumentBinarySetAttributeValue(&mv, value); err != nil {
|
|
return err
|
|
}
|
|
uv = &types.AttributeValueMemberBS{Value: mv}
|
|
break loop
|
|
|
|
case "L":
|
|
var mv []types.AttributeValue
|
|
if err := awsAwsjson10_deserializeDocumentListAttributeValue(&mv, value); err != nil {
|
|
return err
|
|
}
|
|
uv = &types.AttributeValueMemberL{Value: mv}
|
|
break loop
|
|
|
|
case "M":
|
|
var mv map[string]types.AttributeValue
|
|
if err := awsAwsjson10_deserializeDocumentMapAttributeValue(&mv, value); err != nil {
|
|
return err
|
|
}
|
|
uv = &types.AttributeValueMemberM{Value: mv}
|
|
break loop
|
|
|
|
case "N":
|
|
var mv string
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NumberAttributeValue to be of type string, got %T instead", value)
|
|
}
|
|
mv = jtv
|
|
}
|
|
uv = &types.AttributeValueMemberN{Value: mv}
|
|
break loop
|
|
|
|
case "NS":
|
|
var mv []string
|
|
if err := awsAwsjson10_deserializeDocumentNumberSetAttributeValue(&mv, value); err != nil {
|
|
return err
|
|
}
|
|
uv = &types.AttributeValueMemberNS{Value: mv}
|
|
break loop
|
|
|
|
case "NULL":
|
|
var mv bool
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected NullAttributeValue to be of type *bool, got %T instead", value)
|
|
}
|
|
mv = jtv
|
|
}
|
|
uv = &types.AttributeValueMemberNULL{Value: mv}
|
|
break loop
|
|
|
|
case "S":
|
|
var mv string
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected StringAttributeValue to be of type string, got %T instead", value)
|
|
}
|
|
mv = jtv
|
|
}
|
|
uv = &types.AttributeValueMemberS{Value: mv}
|
|
break loop
|
|
|
|
case "SS":
|
|
var mv []string
|
|
if err := awsAwsjson10_deserializeDocumentStringSetAttributeValue(&mv, value); err != nil {
|
|
return err
|
|
}
|
|
uv = &types.AttributeValueMemberSS{Value: mv}
|
|
break loop
|
|
|
|
default:
|
|
uv = &types.UnknownUnionMember{Tag: key}
|
|
break loop
|
|
|
|
}
|
|
}
|
|
*v = uv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAutoScalingPolicyDescription(v **types.AutoScalingPolicyDescription, 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.AutoScalingPolicyDescription
|
|
if *v == nil {
|
|
sv = &types.AutoScalingPolicyDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "PolicyName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected AutoScalingPolicyName to be of type string, got %T instead", value)
|
|
}
|
|
sv.PolicyName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TargetTrackingScalingPolicyConfiguration":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingTargetTrackingScalingPolicyConfigurationDescription(&sv.TargetTrackingScalingPolicyConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAutoScalingPolicyDescriptionList(v *[]types.AutoScalingPolicyDescription, 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.AutoScalingPolicyDescription
|
|
if *v == nil {
|
|
cv = []types.AutoScalingPolicyDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.AutoScalingPolicyDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingPolicyDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(v **types.AutoScalingSettingsDescription, 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.AutoScalingSettingsDescription
|
|
if *v == nil {
|
|
sv = &types.AutoScalingSettingsDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "AutoScalingDisabled":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.AutoScalingDisabled = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "AutoScalingRoleArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.AutoScalingRoleArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "MaximumUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaximumUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "MinimumUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MinimumUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "ScalingPolicies":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingPolicyDescriptionList(&sv.ScalingPolicies, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentAutoScalingTargetTrackingScalingPolicyConfigurationDescription(v **types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription, 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.AutoScalingTargetTrackingScalingPolicyConfigurationDescription
|
|
if *v == nil {
|
|
sv = &types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "DisableScaleIn":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.DisableScaleIn = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "ScaleInCooldown":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected IntegerObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ScaleInCooldown = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case "ScaleOutCooldown":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected IntegerObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ScaleOutCooldown = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case "TargetValue":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.TargetValue = 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.TargetValue = ptr.Float64(f64)
|
|
|
|
default:
|
|
return fmt.Errorf("expected DoubleObject to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBackupDescription(v **types.BackupDescription, 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.BackupDescription
|
|
if *v == nil {
|
|
sv = &types.BackupDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BackupDetails":
|
|
if err := awsAwsjson10_deserializeDocumentBackupDetails(&sv.BackupDetails, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "SourceTableDetails":
|
|
if err := awsAwsjson10_deserializeDocumentSourceTableDetails(&sv.SourceTableDetails, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "SourceTableFeatureDetails":
|
|
if err := awsAwsjson10_deserializeDocumentSourceTableFeatureDetails(&sv.SourceTableFeatureDetails, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBackupDetails(v **types.BackupDetails, 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.BackupDetails
|
|
if *v == nil {
|
|
sv = &types.BackupDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BackupArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "BackupCreationDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BackupCreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected BackupCreationDateTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "BackupExpiryDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BackupExpiryDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "BackupName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupName to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupName = ptr.String(jtv)
|
|
}
|
|
|
|
case "BackupSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupSizeBytes to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BackupSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "BackupStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupStatus = types.BackupStatus(jtv)
|
|
}
|
|
|
|
case "BackupType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupType to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupType = types.BackupType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBackupInUseException(v **types.BackupInUseException, 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.BackupInUseException
|
|
if *v == nil {
|
|
sv = &types.BackupInUseException{}
|
|
} 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 awsAwsjson10_deserializeDocumentBackupNotFoundException(v **types.BackupNotFoundException, 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.BackupNotFoundException
|
|
if *v == nil {
|
|
sv = &types.BackupNotFoundException{}
|
|
} 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 awsAwsjson10_deserializeDocumentBackupSummaries(v *[]types.BackupSummary, 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.BackupSummary
|
|
if *v == nil {
|
|
cv = []types.BackupSummary{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.BackupSummary
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentBackupSummary(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBackupSummary(v **types.BackupSummary, 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.BackupSummary
|
|
if *v == nil {
|
|
sv = &types.BackupSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BackupArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "BackupCreationDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BackupCreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected BackupCreationDateTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "BackupExpiryDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BackupExpiryDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "BackupName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupName to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupName = ptr.String(jtv)
|
|
}
|
|
|
|
case "BackupSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupSizeBytes to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BackupSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "BackupStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupStatus = types.BackupStatus(jtv)
|
|
}
|
|
|
|
case "BackupType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupType to be of type string, got %T instead", value)
|
|
}
|
|
sv.BackupType = types.BackupType(jtv)
|
|
}
|
|
|
|
case "TableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableId to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableId = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBatchGetRequestMap(v *map[string]types.KeysAndAttributes, 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]types.KeysAndAttributes
|
|
if *v == nil {
|
|
mv = map[string]types.KeysAndAttributes{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal types.KeysAndAttributes
|
|
mapVar := parsedVal
|
|
destAddr := &mapVar
|
|
if err := awsAwsjson10_deserializeDocumentKeysAndAttributes(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = *destAddr
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBatchGetResponseMap(v *map[string][]map[string]types.AttributeValue, 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][]map[string]types.AttributeValue
|
|
if *v == nil {
|
|
mv = map[string][]map[string]types.AttributeValue{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal []map[string]types.AttributeValue
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentItemList(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBatchStatementError(v **types.BatchStatementError, 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.BatchStatementError
|
|
if *v == nil {
|
|
sv = &types.BatchStatementError{}
|
|
} 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 BatchStatementErrorCodeEnum to be of type string, got %T instead", value)
|
|
}
|
|
sv.Code = types.BatchStatementErrorCodeEnum(jtv)
|
|
}
|
|
|
|
case "Item":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Item, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBatchStatementResponse(v **types.BatchStatementResponse, 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.BatchStatementResponse
|
|
if *v == nil {
|
|
sv = &types.BatchStatementResponse{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Error":
|
|
if err := awsAwsjson10_deserializeDocumentBatchStatementError(&sv.Error, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Item":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Item, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBatchWriteItemRequestMap(v *map[string][]types.WriteRequest, 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][]types.WriteRequest
|
|
if *v == nil {
|
|
mv = map[string][]types.WriteRequest{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal []types.WriteRequest
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentWriteRequests(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBillingModeSummary(v **types.BillingModeSummary, 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.BillingModeSummary
|
|
if *v == nil {
|
|
sv = &types.BillingModeSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BillingMode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BillingMode to be of type string, got %T instead", value)
|
|
}
|
|
sv.BillingMode = types.BillingMode(jtv)
|
|
}
|
|
|
|
case "LastUpdateToPayPerRequestDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastUpdateToPayPerRequestDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentBinarySetAttributeValue(v *[][]byte, 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 [][]byte
|
|
if *v == nil {
|
|
cv = [][]byte{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col []byte
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BinaryAttributeValue to be []byte, got %T instead", value)
|
|
}
|
|
dv, err := base64.StdEncoding.DecodeString(jtv)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to base64 decode BinaryAttributeValue, %w", err)
|
|
}
|
|
col = dv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentCancellationReason(v **types.CancellationReason, 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.CancellationReason
|
|
if *v == nil {
|
|
sv = &types.CancellationReason{}
|
|
} 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 Code to be of type string, got %T instead", value)
|
|
}
|
|
sv.Code = ptr.String(jtv)
|
|
}
|
|
|
|
case "Item":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Item, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
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 awsAwsjson10_deserializeDocumentCancellationReasonList(v *[]types.CancellationReason, 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.CancellationReason
|
|
if *v == nil {
|
|
cv = []types.CancellationReason{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.CancellationReason
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentCancellationReason(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentCapacity(v **types.Capacity, 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.Capacity
|
|
if *v == nil {
|
|
sv = &types.Capacity{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "CapacityUnits":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CapacityUnits = 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.CapacityUnits = ptr.Float64(f64)
|
|
|
|
default:
|
|
return fmt.Errorf("expected ConsumedCapacityUnits to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ReadCapacityUnits":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReadCapacityUnits = 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.ReadCapacityUnits = ptr.Float64(f64)
|
|
|
|
default:
|
|
return fmt.Errorf("expected ConsumedCapacityUnits to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "WriteCapacityUnits":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.WriteCapacityUnits = 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.WriteCapacityUnits = ptr.Float64(f64)
|
|
|
|
default:
|
|
return fmt.Errorf("expected ConsumedCapacityUnits to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentConditionalCheckFailedException(v **types.ConditionalCheckFailedException, 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.ConditionalCheckFailedException
|
|
if *v == nil {
|
|
sv = &types.ConditionalCheckFailedException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Item":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Item, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
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 awsAwsjson10_deserializeDocumentConsumedCapacity(v **types.ConsumedCapacity, 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.ConsumedCapacity
|
|
if *v == nil {
|
|
sv = &types.ConsumedCapacity{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "CapacityUnits":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CapacityUnits = 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.CapacityUnits = ptr.Float64(f64)
|
|
|
|
default:
|
|
return fmt.Errorf("expected ConsumedCapacityUnits to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "GlobalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentSecondaryIndexesCapacityMap(&sv.GlobalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LocalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentSecondaryIndexesCapacityMap(&sv.LocalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ReadCapacityUnits":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReadCapacityUnits = 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.ReadCapacityUnits = ptr.Float64(f64)
|
|
|
|
default:
|
|
return fmt.Errorf("expected ConsumedCapacityUnits to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "Table":
|
|
if err := awsAwsjson10_deserializeDocumentCapacity(&sv.Table, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "WriteCapacityUnits":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.WriteCapacityUnits = 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.WriteCapacityUnits = ptr.Float64(f64)
|
|
|
|
default:
|
|
return fmt.Errorf("expected ConsumedCapacityUnits to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentConsumedCapacityMultiple(v *[]types.ConsumedCapacity, 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.ConsumedCapacity
|
|
if *v == nil {
|
|
cv = []types.ConsumedCapacity{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ConsumedCapacity
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentContinuousBackupsDescription(v **types.ContinuousBackupsDescription, 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.ContinuousBackupsDescription
|
|
if *v == nil {
|
|
sv = &types.ContinuousBackupsDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ContinuousBackupsStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ContinuousBackupsStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ContinuousBackupsStatus = types.ContinuousBackupsStatus(jtv)
|
|
}
|
|
|
|
case "PointInTimeRecoveryDescription":
|
|
if err := awsAwsjson10_deserializeDocumentPointInTimeRecoveryDescription(&sv.PointInTimeRecoveryDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentContinuousBackupsUnavailableException(v **types.ContinuousBackupsUnavailableException, 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.ContinuousBackupsUnavailableException
|
|
if *v == nil {
|
|
sv = &types.ContinuousBackupsUnavailableException{}
|
|
} 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 awsAwsjson10_deserializeDocumentContributorInsightsRuleList(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 ContributorInsightsRule to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentContributorInsightsSummaries(v *[]types.ContributorInsightsSummary, 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.ContributorInsightsSummary
|
|
if *v == nil {
|
|
cv = []types.ContributorInsightsSummary{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ContributorInsightsSummary
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentContributorInsightsSummary(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentContributorInsightsSummary(v **types.ContributorInsightsSummary, 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.ContributorInsightsSummary
|
|
if *v == nil {
|
|
sv = &types.ContributorInsightsSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ContributorInsightsStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ContributorInsightsStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ContributorInsightsStatus = types.ContributorInsightsStatus(jtv)
|
|
}
|
|
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentCsvHeaderList(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 CsvHeader to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentCsvOptions(v **types.CsvOptions, 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.CsvOptions
|
|
if *v == nil {
|
|
sv = &types.CsvOptions{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Delimiter":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CsvDelimiter to be of type string, got %T instead", value)
|
|
}
|
|
sv.Delimiter = ptr.String(jtv)
|
|
}
|
|
|
|
case "HeaderList":
|
|
if err := awsAwsjson10_deserializeDocumentCsvHeaderList(&sv.HeaderList, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentDeleteRequest(v **types.DeleteRequest, 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.DeleteRequest
|
|
if *v == nil {
|
|
sv = &types.DeleteRequest{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Key":
|
|
if err := awsAwsjson10_deserializeDocumentKey(&sv.Key, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentDuplicateItemException(v **types.DuplicateItemException, 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.DuplicateItemException
|
|
if *v == nil {
|
|
sv = &types.DuplicateItemException{}
|
|
} 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 awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(v **types.EnableKinesisStreamingConfiguration, 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.EnableKinesisStreamingConfiguration
|
|
if *v == nil {
|
|
sv = &types.EnableKinesisStreamingConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ApproximateCreationDateTimePrecision":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value)
|
|
}
|
|
sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentEndpoint(v **types.Endpoint, 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.Endpoint
|
|
if *v == nil {
|
|
sv = &types.Endpoint{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Address":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.Address = ptr.String(jtv)
|
|
}
|
|
|
|
case "CachePeriodInMinutes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CachePeriodInMinutes = i64
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentEndpoints(v *[]types.Endpoint, 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.Endpoint
|
|
if *v == nil {
|
|
cv = []types.Endpoint{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Endpoint
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentEndpoint(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentExportConflictException(v **types.ExportConflictException, 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.ExportConflictException
|
|
if *v == nil {
|
|
sv = &types.ExportConflictException{}
|
|
} 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 awsAwsjson10_deserializeDocumentExportDescription(v **types.ExportDescription, 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.ExportDescription
|
|
if *v == nil {
|
|
sv = &types.ExportDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BilledSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected BilledSizeBytes to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BilledSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "ClientToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.ClientToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "EndTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ExportEndTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ExportArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ExportFormat":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportFormat to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportFormat = types.ExportFormat(jtv)
|
|
}
|
|
|
|
case "ExportManifest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportManifest to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportManifest = ptr.String(jtv)
|
|
}
|
|
|
|
case "ExportStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportStatus = types.ExportStatus(jtv)
|
|
}
|
|
|
|
case "ExportTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ExportTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ExportTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ExportType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportType = types.ExportType(jtv)
|
|
}
|
|
|
|
case "FailureCode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureCode = ptr.String(jtv)
|
|
}
|
|
|
|
case "FailureMessage":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FailureMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureMessage = ptr.String(jtv)
|
|
}
|
|
|
|
case "IncrementalExportSpecification":
|
|
if err := awsAwsjson10_deserializeDocumentIncrementalExportSpecification(&sv.IncrementalExportSpecification, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ItemCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected ItemCount to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ItemCount = ptr.Int64(i64)
|
|
}
|
|
|
|
case "S3Bucket":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3Bucket = ptr.String(jtv)
|
|
}
|
|
|
|
case "S3BucketOwner":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3BucketOwner to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3BucketOwner = ptr.String(jtv)
|
|
}
|
|
|
|
case "S3Prefix":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3Prefix to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3Prefix = ptr.String(jtv)
|
|
}
|
|
|
|
case "S3SseAlgorithm":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3SseAlgorithm to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3SseAlgorithm = types.S3SseAlgorithm(jtv)
|
|
}
|
|
|
|
case "S3SseKmsKeyId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3SseKmsKeyId to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3SseKmsKeyId = ptr.String(jtv)
|
|
}
|
|
|
|
case "StartTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ExportStartTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "TableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableId to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentExportNotFoundException(v **types.ExportNotFoundException, 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.ExportNotFoundException
|
|
if *v == nil {
|
|
sv = &types.ExportNotFoundException{}
|
|
} 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 awsAwsjson10_deserializeDocumentExportSummaries(v *[]types.ExportSummary, 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.ExportSummary
|
|
if *v == nil {
|
|
cv = []types.ExportSummary{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ExportSummary
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentExportSummary(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentExportSummary(v **types.ExportSummary, 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.ExportSummary
|
|
if *v == nil {
|
|
sv = &types.ExportSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ExportArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ExportStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportStatus = types.ExportStatus(jtv)
|
|
}
|
|
|
|
case "ExportType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportType = types.ExportType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentExpressionAttributeNameMap(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 AttributeName to be of type string, got %T instead", value)
|
|
}
|
|
parsedVal = jtv
|
|
}
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentFailureException(v **types.FailureException, 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.FailureException
|
|
if *v == nil {
|
|
sv = &types.FailureException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ExceptionDescription":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionDescription to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExceptionDescription = ptr.String(jtv)
|
|
}
|
|
|
|
case "ExceptionName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionName to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExceptionName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalSecondaryIndex(v **types.GlobalSecondaryIndex, 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.GlobalSecondaryIndex
|
|
if *v == nil {
|
|
sv = &types.GlobalSecondaryIndex{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "OnDemandThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Projection":
|
|
if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescription(v **types.GlobalSecondaryIndexDescription, 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.GlobalSecondaryIndexDescription
|
|
if *v == nil {
|
|
sv = &types.GlobalSecondaryIndexDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Backfilling":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected Backfilling to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.Backfilling = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "IndexArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "IndexSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.IndexSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "IndexStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexStatus = types.IndexStatus(jtv)
|
|
}
|
|
|
|
case "ItemCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ItemCount = ptr.Int64(i64)
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "OnDemandThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Projection":
|
|
if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughputDescription(&sv.ProvisionedThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescriptionList(v *[]types.GlobalSecondaryIndexDescription, 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.GlobalSecondaryIndexDescription
|
|
if *v == nil {
|
|
cv = []types.GlobalSecondaryIndexDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.GlobalSecondaryIndexDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexes(v *[]types.GlobalSecondaryIndexInfo, 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.GlobalSecondaryIndexInfo
|
|
if *v == nil {
|
|
cv = []types.GlobalSecondaryIndexInfo{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.GlobalSecondaryIndexInfo
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndexInfo(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexInfo(v **types.GlobalSecondaryIndexInfo, 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.GlobalSecondaryIndexInfo
|
|
if *v == nil {
|
|
sv = &types.GlobalSecondaryIndexInfo{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "OnDemandThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Projection":
|
|
if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexList(v *[]types.GlobalSecondaryIndex, 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.GlobalSecondaryIndex
|
|
if *v == nil {
|
|
cv = []types.GlobalSecondaryIndex{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.GlobalSecondaryIndex
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndex(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalTable(v **types.GlobalTable, 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.GlobalTable
|
|
if *v == nil {
|
|
sv = &types.GlobalTable{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalTableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.GlobalTableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicationGroup":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaList(&sv.ReplicationGroup, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalTableAlreadyExistsException(v **types.GlobalTableAlreadyExistsException, 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.GlobalTableAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.GlobalTableAlreadyExistsException{}
|
|
} 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 awsAwsjson10_deserializeDocumentGlobalTableDescription(v **types.GlobalTableDescription, 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.GlobalTableDescription
|
|
if *v == nil {
|
|
sv = &types.GlobalTableDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "CreationDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "GlobalTableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected GlobalTableArnString to be of type string, got %T instead", value)
|
|
}
|
|
sv.GlobalTableArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "GlobalTableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.GlobalTableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "GlobalTableStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected GlobalTableStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.GlobalTableStatus = types.GlobalTableStatus(jtv)
|
|
}
|
|
|
|
case "ReplicationGroup":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaDescriptionList(&sv.ReplicationGroup, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalTableList(v *[]types.GlobalTable, 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.GlobalTable
|
|
if *v == nil {
|
|
cv = []types.GlobalTable{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.GlobalTable
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentGlobalTable(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentGlobalTableNotFoundException(v **types.GlobalTableNotFoundException, 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.GlobalTableNotFoundException
|
|
if *v == nil {
|
|
sv = &types.GlobalTableNotFoundException{}
|
|
} 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 awsAwsjson10_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, 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.IdempotentParameterMismatchException
|
|
if *v == nil {
|
|
sv = &types.IdempotentParameterMismatchException{}
|
|
} 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 awsAwsjson10_deserializeDocumentImportConflictException(v **types.ImportConflictException, 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.ImportConflictException
|
|
if *v == nil {
|
|
sv = &types.ImportConflictException{}
|
|
} 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 awsAwsjson10_deserializeDocumentImportNotFoundException(v **types.ImportNotFoundException, 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.ImportNotFoundException
|
|
if *v == nil {
|
|
sv = &types.ImportNotFoundException{}
|
|
} 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 awsAwsjson10_deserializeDocumentImportSummary(v **types.ImportSummary, 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.ImportSummary
|
|
if *v == nil {
|
|
sv = &types.ImportSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "CloudWatchLogGroupArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CloudWatchLogGroupArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.CloudWatchLogGroupArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "EndTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ImportEndTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ImportArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImportArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImportArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ImportStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImportStatus = types.ImportStatus(jtv)
|
|
}
|
|
|
|
case "InputFormat":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected InputFormat to be of type string, got %T instead", value)
|
|
}
|
|
sv.InputFormat = types.InputFormat(jtv)
|
|
}
|
|
|
|
case "S3BucketSource":
|
|
if err := awsAwsjson10_deserializeDocumentS3BucketSource(&sv.S3BucketSource, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "StartTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ImportStartTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "TableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableArn = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentImportSummaryList(v *[]types.ImportSummary, 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.ImportSummary
|
|
if *v == nil {
|
|
cv = []types.ImportSummary{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ImportSummary
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentImportSummary(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentImportTableDescription(v **types.ImportTableDescription, 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.ImportTableDescription
|
|
if *v == nil {
|
|
sv = &types.ImportTableDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ClientToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.ClientToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "CloudWatchLogGroupArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CloudWatchLogGroupArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.CloudWatchLogGroupArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "EndTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ImportEndTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ErrorCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected ErrorCount to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ErrorCount = i64
|
|
}
|
|
|
|
case "FailureCode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureCode = ptr.String(jtv)
|
|
}
|
|
|
|
case "FailureMessage":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FailureMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureMessage = ptr.String(jtv)
|
|
}
|
|
|
|
case "ImportArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImportArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImportArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ImportedItemCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImportedItemCount to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ImportedItemCount = i64
|
|
}
|
|
|
|
case "ImportStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImportStatus = types.ImportStatus(jtv)
|
|
}
|
|
|
|
case "InputCompressionType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected InputCompressionType to be of type string, got %T instead", value)
|
|
}
|
|
sv.InputCompressionType = types.InputCompressionType(jtv)
|
|
}
|
|
|
|
case "InputFormat":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected InputFormat to be of type string, got %T instead", value)
|
|
}
|
|
sv.InputFormat = types.InputFormat(jtv)
|
|
}
|
|
|
|
case "InputFormatOptions":
|
|
if err := awsAwsjson10_deserializeDocumentInputFormatOptions(&sv.InputFormatOptions, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProcessedItemCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected ProcessedItemCount to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ProcessedItemCount = i64
|
|
}
|
|
|
|
case "ProcessedSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ProcessedSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "S3BucketSource":
|
|
if err := awsAwsjson10_deserializeDocumentS3BucketSource(&sv.S3BucketSource, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "StartTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ImportStartTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "TableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableCreationParameters":
|
|
if err := awsAwsjson10_deserializeDocumentTableCreationParameters(&sv.TableCreationParameters, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableId to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentIncrementalExportSpecification(v **types.IncrementalExportSpecification, 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.IncrementalExportSpecification
|
|
if *v == nil {
|
|
sv = &types.IncrementalExportSpecification{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ExportFromTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ExportFromTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ExportFromTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ExportToTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ExportToTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ExportToTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ExportViewType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportViewType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ExportViewType = types.ExportViewType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentIndexNotFoundException(v **types.IndexNotFoundException, 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.IndexNotFoundException
|
|
if *v == nil {
|
|
sv = &types.IndexNotFoundException{}
|
|
} 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 awsAwsjson10_deserializeDocumentInputFormatOptions(v **types.InputFormatOptions, 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.InputFormatOptions
|
|
if *v == nil {
|
|
sv = &types.InputFormatOptions{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Csv":
|
|
if err := awsAwsjson10_deserializeDocumentCsvOptions(&sv.Csv, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentInternalServerError(v **types.InternalServerError, 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.InternalServerError
|
|
if *v == nil {
|
|
sv = &types.InternalServerError{}
|
|
} 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 awsAwsjson10_deserializeDocumentInvalidEndpointException(v **types.InvalidEndpointException, 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.InvalidEndpointException
|
|
if *v == nil {
|
|
sv = &types.InvalidEndpointException{}
|
|
} 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 String to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentInvalidExportTimeException(v **types.InvalidExportTimeException, 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.InvalidExportTimeException
|
|
if *v == nil {
|
|
sv = &types.InvalidExportTimeException{}
|
|
} 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 awsAwsjson10_deserializeDocumentInvalidRestoreTimeException(v **types.InvalidRestoreTimeException, 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.InvalidRestoreTimeException
|
|
if *v == nil {
|
|
sv = &types.InvalidRestoreTimeException{}
|
|
} 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 awsAwsjson10_deserializeDocumentItemCollectionKeyAttributeMap(v *map[string]types.AttributeValue, 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]types.AttributeValue
|
|
if *v == nil {
|
|
mv = map[string]types.AttributeValue{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal types.AttributeValue
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentAttributeValue(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentItemCollectionMetrics(v **types.ItemCollectionMetrics, 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.ItemCollectionMetrics
|
|
if *v == nil {
|
|
sv = &types.ItemCollectionMetrics{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ItemCollectionKey":
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionKeyAttributeMap(&sv.ItemCollectionKey, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "SizeEstimateRangeGB":
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionSizeEstimateRange(&sv.SizeEstimateRangeGB, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentItemCollectionMetricsMultiple(v *[]types.ItemCollectionMetrics, 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.ItemCollectionMetrics
|
|
if *v == nil {
|
|
cv = []types.ItemCollectionMetrics{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ItemCollectionMetrics
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionMetrics(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentItemCollectionMetricsPerTable(v *map[string][]types.ItemCollectionMetrics, 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][]types.ItemCollectionMetrics
|
|
if *v == nil {
|
|
mv = map[string][]types.ItemCollectionMetrics{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal []types.ItemCollectionMetrics
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionMetricsMultiple(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentItemCollectionSizeEstimateRange(v *[]float64, 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 []float64
|
|
if *v == nil {
|
|
cv = []float64{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col float64
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
col = 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)
|
|
|
|
}
|
|
col = f64
|
|
|
|
default:
|
|
return fmt.Errorf("expected ItemCollectionSizeEstimateBound to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentItemCollectionSizeLimitExceededException(v **types.ItemCollectionSizeLimitExceededException, 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.ItemCollectionSizeLimitExceededException
|
|
if *v == nil {
|
|
sv = &types.ItemCollectionSizeLimitExceededException{}
|
|
} 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 awsAwsjson10_deserializeDocumentItemList(v *[]map[string]types.AttributeValue, 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 []map[string]types.AttributeValue
|
|
if *v == nil {
|
|
cv = []map[string]types.AttributeValue{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col map[string]types.AttributeValue
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&col, value); err != nil {
|
|
return err
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentItemResponse(v **types.ItemResponse, 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.ItemResponse
|
|
if *v == nil {
|
|
sv = &types.ItemResponse{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Item":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Item, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentItemResponseList(v *[]types.ItemResponse, 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.ItemResponse
|
|
if *v == nil {
|
|
cv = []types.ItemResponse{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ItemResponse
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentItemResponse(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentKey(v *map[string]types.AttributeValue, 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]types.AttributeValue
|
|
if *v == nil {
|
|
mv = map[string]types.AttributeValue{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal types.AttributeValue
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentAttributeValue(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentKeyList(v *[]map[string]types.AttributeValue, 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 []map[string]types.AttributeValue
|
|
if *v == nil {
|
|
cv = []map[string]types.AttributeValue{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col map[string]types.AttributeValue
|
|
if err := awsAwsjson10_deserializeDocumentKey(&col, value); err != nil {
|
|
return err
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentKeysAndAttributes(v **types.KeysAndAttributes, 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.KeysAndAttributes
|
|
if *v == nil {
|
|
sv = &types.KeysAndAttributes{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "AttributesToGet":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeNameList(&sv.AttributesToGet, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ConsistentRead":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected ConsistentRead to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.ConsistentRead = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "ExpressionAttributeNames":
|
|
if err := awsAwsjson10_deserializeDocumentExpressionAttributeNameMap(&sv.ExpressionAttributeNames, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Keys":
|
|
if err := awsAwsjson10_deserializeDocumentKeyList(&sv.Keys, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProjectionExpression":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ProjectionExpression to be of type string, got %T instead", value)
|
|
}
|
|
sv.ProjectionExpression = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentKeySchema(v *[]types.KeySchemaElement, 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.KeySchemaElement
|
|
if *v == nil {
|
|
cv = []types.KeySchemaElement{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.KeySchemaElement
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentKeySchemaElement(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentKeySchemaElement(v **types.KeySchemaElement, 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.KeySchemaElement
|
|
if *v == nil {
|
|
sv = &types.KeySchemaElement{}
|
|
} 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 KeySchemaAttributeName to be of type string, got %T instead", value)
|
|
}
|
|
sv.AttributeName = 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)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentKinesisDataStreamDestination(v **types.KinesisDataStreamDestination, 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.KinesisDataStreamDestination
|
|
if *v == nil {
|
|
sv = &types.KinesisDataStreamDestination{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ApproximateCreationDateTimePrecision":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value)
|
|
}
|
|
sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv)
|
|
}
|
|
|
|
case "DestinationStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected DestinationStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.DestinationStatus = types.DestinationStatus(jtv)
|
|
}
|
|
|
|
case "DestinationStatusDescription":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.DestinationStatusDescription = ptr.String(jtv)
|
|
}
|
|
|
|
case "StreamArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.StreamArn = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentKinesisDataStreamDestinations(v *[]types.KinesisDataStreamDestination, 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.KinesisDataStreamDestination
|
|
if *v == nil {
|
|
cv = []types.KinesisDataStreamDestination{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.KinesisDataStreamDestination
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentKinesisDataStreamDestination(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_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 awsAwsjson10_deserializeDocumentListAttributeValue(v *[]types.AttributeValue, 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.AttributeValue
|
|
if *v == nil {
|
|
cv = []types.AttributeValue{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.AttributeValue
|
|
if err := awsAwsjson10_deserializeDocumentAttributeValue(&col, value); err != nil {
|
|
return err
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentLocalSecondaryIndexDescription(v **types.LocalSecondaryIndexDescription, 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.LocalSecondaryIndexDescription
|
|
if *v == nil {
|
|
sv = &types.LocalSecondaryIndexDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "IndexArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "IndexSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.IndexSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "ItemCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ItemCount = ptr.Int64(i64)
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Projection":
|
|
if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentLocalSecondaryIndexDescriptionList(v *[]types.LocalSecondaryIndexDescription, 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.LocalSecondaryIndexDescription
|
|
if *v == nil {
|
|
cv = []types.LocalSecondaryIndexDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.LocalSecondaryIndexDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentLocalSecondaryIndexDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentLocalSecondaryIndexes(v *[]types.LocalSecondaryIndexInfo, 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.LocalSecondaryIndexInfo
|
|
if *v == nil {
|
|
cv = []types.LocalSecondaryIndexInfo{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.LocalSecondaryIndexInfo
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentLocalSecondaryIndexInfo(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentLocalSecondaryIndexInfo(v **types.LocalSecondaryIndexInfo, 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.LocalSecondaryIndexInfo
|
|
if *v == nil {
|
|
sv = &types.LocalSecondaryIndexInfo{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Projection":
|
|
if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentMapAttributeValue(v *map[string]types.AttributeValue, 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]types.AttributeValue
|
|
if *v == nil {
|
|
mv = map[string]types.AttributeValue{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal types.AttributeValue
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentAttributeValue(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentNonKeyAttributeNameList(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 NonKeyAttributeName to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentNumberSetAttributeValue(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 NumberAttributeValue to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentOnDemandThroughput(v **types.OnDemandThroughput, 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.OnDemandThroughput
|
|
if *v == nil {
|
|
sv = &types.OnDemandThroughput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "MaxReadRequestUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxReadRequestUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "MaxWriteRequestUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxWriteRequestUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentOnDemandThroughputOverride(v **types.OnDemandThroughputOverride, 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.OnDemandThroughputOverride
|
|
if *v == nil {
|
|
sv = &types.OnDemandThroughputOverride{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "MaxReadRequestUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxReadRequestUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentPartiQLBatchResponse(v *[]types.BatchStatementResponse, 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.BatchStatementResponse
|
|
if *v == nil {
|
|
cv = []types.BatchStatementResponse{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.BatchStatementResponse
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentBatchStatementResponse(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentPointInTimeRecoveryDescription(v **types.PointInTimeRecoveryDescription, 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.PointInTimeRecoveryDescription
|
|
if *v == nil {
|
|
sv = &types.PointInTimeRecoveryDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "EarliestRestorableDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.EarliestRestorableDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "LatestRestorableDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LatestRestorableDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "PointInTimeRecoveryStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PointInTimeRecoveryStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.PointInTimeRecoveryStatus = types.PointInTimeRecoveryStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentPointInTimeRecoveryUnavailableException(v **types.PointInTimeRecoveryUnavailableException, 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.PointInTimeRecoveryUnavailableException
|
|
if *v == nil {
|
|
sv = &types.PointInTimeRecoveryUnavailableException{}
|
|
} 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 awsAwsjson10_deserializeDocumentPolicyNotFoundException(v **types.PolicyNotFoundException, 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.PolicyNotFoundException
|
|
if *v == nil {
|
|
sv = &types.PolicyNotFoundException{}
|
|
} 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 awsAwsjson10_deserializeDocumentProjection(v **types.Projection, 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.Projection
|
|
if *v == nil {
|
|
sv = &types.Projection{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "NonKeyAttributes":
|
|
if err := awsAwsjson10_deserializeDocumentNonKeyAttributeNameList(&sv.NonKeyAttributes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProjectionType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ProjectionType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ProjectionType = types.ProjectionType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentProvisionedThroughput(v **types.ProvisionedThroughput, 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.ProvisionedThroughput
|
|
if *v == nil {
|
|
sv = &types.ProvisionedThroughput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ReadCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReadCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "WriteCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.WriteCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentProvisionedThroughputDescription(v **types.ProvisionedThroughputDescription, 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.ProvisionedThroughputDescription
|
|
if *v == nil {
|
|
sv = &types.ProvisionedThroughputDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "LastDecreaseDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastDecreaseDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "LastIncreaseDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastIncreaseDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "NumberOfDecreasesToday":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.NumberOfDecreasesToday = ptr.Int64(i64)
|
|
}
|
|
|
|
case "ReadCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected NonNegativeLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReadCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "WriteCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected NonNegativeLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.WriteCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentProvisionedThroughputExceededException(v **types.ProvisionedThroughputExceededException, 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.ProvisionedThroughputExceededException
|
|
if *v == nil {
|
|
sv = &types.ProvisionedThroughputExceededException{}
|
|
} 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 awsAwsjson10_deserializeDocumentProvisionedThroughputOverride(v **types.ProvisionedThroughputOverride, 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.ProvisionedThroughputOverride
|
|
if *v == nil {
|
|
sv = &types.ProvisionedThroughputOverride{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ReadCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReadCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentPutItemInputAttributeMap(v *map[string]types.AttributeValue, 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]types.AttributeValue
|
|
if *v == nil {
|
|
mv = map[string]types.AttributeValue{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal types.AttributeValue
|
|
mapVar := parsedVal
|
|
if err := awsAwsjson10_deserializeDocumentAttributeValue(&mapVar, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = mapVar
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentPutRequest(v **types.PutRequest, 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.PutRequest
|
|
if *v == nil {
|
|
sv = &types.PutRequest{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Item":
|
|
if err := awsAwsjson10_deserializeDocumentPutItemInputAttributeMap(&sv.Item, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplica(v **types.Replica, 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.Replica
|
|
if *v == nil {
|
|
sv = &types.Replica{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "RegionName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegionName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegionName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaAlreadyExistsException(v **types.ReplicaAlreadyExistsException, 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.ReplicaAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.ReplicaAlreadyExistsException{}
|
|
} 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 awsAwsjson10_deserializeDocumentReplicaAutoScalingDescription(v **types.ReplicaAutoScalingDescription, 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.ReplicaAutoScalingDescription
|
|
if *v == nil {
|
|
sv = &types.ReplicaAutoScalingDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexAutoScalingDescriptionList(&sv.GlobalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "RegionName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegionName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegionName = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicaProvisionedReadCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ReplicaProvisionedReadCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ReplicaProvisionedWriteCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ReplicaProvisionedWriteCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ReplicaStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ReplicaStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ReplicaStatus = types.ReplicaStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaAutoScalingDescriptionList(v *[]types.ReplicaAutoScalingDescription, 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.ReplicaAutoScalingDescription
|
|
if *v == nil {
|
|
cv = []types.ReplicaAutoScalingDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicaAutoScalingDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentReplicaAutoScalingDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaDescription(v **types.ReplicaDescription, 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.ReplicaDescription
|
|
if *v == nil {
|
|
sv = &types.ReplicaDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexDescriptionList(&sv.GlobalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "KMSMasterKeyId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected KMSMasterKeyId to be of type string, got %T instead", value)
|
|
}
|
|
sv.KMSMasterKeyId = ptr.String(jtv)
|
|
}
|
|
|
|
case "OnDemandThroughputOverride":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughputOverride(&sv.OnDemandThroughputOverride, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughputOverride":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "RegionName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegionName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegionName = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicaInaccessibleDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReplicaInaccessibleDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "ReplicaStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ReplicaStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ReplicaStatus = types.ReplicaStatus(jtv)
|
|
}
|
|
|
|
case "ReplicaStatusDescription":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ReplicaStatusDescription to be of type string, got %T instead", value)
|
|
}
|
|
sv.ReplicaStatusDescription = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicaStatusPercentProgress":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ReplicaStatusPercentProgress to be of type string, got %T instead", value)
|
|
}
|
|
sv.ReplicaStatusPercentProgress = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicaTableClassSummary":
|
|
if err := awsAwsjson10_deserializeDocumentTableClassSummary(&sv.ReplicaTableClassSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaDescriptionList(v *[]types.ReplicaDescription, 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.ReplicaDescription
|
|
if *v == nil {
|
|
cv = []types.ReplicaDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicaDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentReplicaDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexAutoScalingDescription(v **types.ReplicaGlobalSecondaryIndexAutoScalingDescription, 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.ReplicaGlobalSecondaryIndexAutoScalingDescription
|
|
if *v == nil {
|
|
sv = &types.ReplicaGlobalSecondaryIndexAutoScalingDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "IndexStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexStatus = types.IndexStatus(jtv)
|
|
}
|
|
|
|
case "ProvisionedReadCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ProvisionedReadCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedWriteCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ProvisionedWriteCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexAutoScalingDescriptionList(v *[]types.ReplicaGlobalSecondaryIndexAutoScalingDescription, 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.ReplicaGlobalSecondaryIndexAutoScalingDescription
|
|
if *v == nil {
|
|
cv = []types.ReplicaGlobalSecondaryIndexAutoScalingDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicaGlobalSecondaryIndexAutoScalingDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexAutoScalingDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexDescription(v **types.ReplicaGlobalSecondaryIndexDescription, 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.ReplicaGlobalSecondaryIndexDescription
|
|
if *v == nil {
|
|
sv = &types.ReplicaGlobalSecondaryIndexDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "OnDemandThroughputOverride":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughputOverride(&sv.OnDemandThroughputOverride, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughputOverride":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexDescriptionList(v *[]types.ReplicaGlobalSecondaryIndexDescription, 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.ReplicaGlobalSecondaryIndexDescription
|
|
if *v == nil {
|
|
cv = []types.ReplicaGlobalSecondaryIndexDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicaGlobalSecondaryIndexDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexSettingsDescription(v **types.ReplicaGlobalSecondaryIndexSettingsDescription, 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.ReplicaGlobalSecondaryIndexSettingsDescription
|
|
if *v == nil {
|
|
sv = &types.ReplicaGlobalSecondaryIndexSettingsDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "IndexStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexStatus = types.IndexStatus(jtv)
|
|
}
|
|
|
|
case "ProvisionedReadCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ProvisionedReadCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedReadCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ProvisionedReadCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "ProvisionedWriteCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ProvisionedWriteCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedWriteCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ProvisionedWriteCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexSettingsDescriptionList(v *[]types.ReplicaGlobalSecondaryIndexSettingsDescription, 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.ReplicaGlobalSecondaryIndexSettingsDescription
|
|
if *v == nil {
|
|
cv = []types.ReplicaGlobalSecondaryIndexSettingsDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicaGlobalSecondaryIndexSettingsDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexSettingsDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaList(v *[]types.Replica, 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.Replica
|
|
if *v == nil {
|
|
cv = []types.Replica{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Replica
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentReplica(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaNotFoundException(v **types.ReplicaNotFoundException, 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.ReplicaNotFoundException
|
|
if *v == nil {
|
|
sv = &types.ReplicaNotFoundException{}
|
|
} 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 awsAwsjson10_deserializeDocumentReplicaSettingsDescription(v **types.ReplicaSettingsDescription, 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.ReplicaSettingsDescription
|
|
if *v == nil {
|
|
sv = &types.ReplicaSettingsDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "RegionName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegionName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegionName = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicaBillingModeSummary":
|
|
if err := awsAwsjson10_deserializeDocumentBillingModeSummary(&sv.ReplicaBillingModeSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ReplicaGlobalSecondaryIndexSettings":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexSettingsDescriptionList(&sv.ReplicaGlobalSecondaryIndexSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ReplicaProvisionedReadCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ReplicaProvisionedReadCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ReplicaProvisionedReadCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected NonNegativeLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReplicaProvisionedReadCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "ReplicaProvisionedWriteCapacityAutoScalingSettings":
|
|
if err := awsAwsjson10_deserializeDocumentAutoScalingSettingsDescription(&sv.ReplicaProvisionedWriteCapacityAutoScalingSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ReplicaProvisionedWriteCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected NonNegativeLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ReplicaProvisionedWriteCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "ReplicaStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ReplicaStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ReplicaStatus = types.ReplicaStatus(jtv)
|
|
}
|
|
|
|
case "ReplicaTableClassSummary":
|
|
if err := awsAwsjson10_deserializeDocumentTableClassSummary(&sv.ReplicaTableClassSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentReplicaSettingsDescriptionList(v *[]types.ReplicaSettingsDescription, 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.ReplicaSettingsDescription
|
|
if *v == nil {
|
|
cv = []types.ReplicaSettingsDescription{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicaSettingsDescription
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentReplicaSettingsDescription(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentRequestLimitExceeded(v **types.RequestLimitExceeded, 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.RequestLimitExceeded
|
|
if *v == nil {
|
|
sv = &types.RequestLimitExceeded{}
|
|
} 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 awsAwsjson10_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 awsAwsjson10_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 awsAwsjson10_deserializeDocumentRestoreSummary(v **types.RestoreSummary, 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.RestoreSummary
|
|
if *v == nil {
|
|
sv = &types.RestoreSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "RestoreDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.RestoreDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "RestoreInProgress":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected RestoreInProgress to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.RestoreInProgress = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "SourceBackupArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.SourceBackupArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "SourceTableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.SourceTableArn = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentS3BucketSource(v **types.S3BucketSource, 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.S3BucketSource
|
|
if *v == nil {
|
|
sv = &types.S3BucketSource{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "S3Bucket":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3Bucket = ptr.String(jtv)
|
|
}
|
|
|
|
case "S3BucketOwner":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3BucketOwner to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3BucketOwner = ptr.String(jtv)
|
|
}
|
|
|
|
case "S3KeyPrefix":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected S3Prefix to be of type string, got %T instead", value)
|
|
}
|
|
sv.S3KeyPrefix = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentSecondaryIndexesCapacityMap(v *map[string]types.Capacity, 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]types.Capacity
|
|
if *v == nil {
|
|
mv = map[string]types.Capacity{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal types.Capacity
|
|
mapVar := parsedVal
|
|
destAddr := &mapVar
|
|
if err := awsAwsjson10_deserializeDocumentCapacity(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
parsedVal = *destAddr
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentSourceTableDetails(v **types.SourceTableDetails, 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.SourceTableDetails
|
|
if *v == nil {
|
|
sv = &types.SourceTableDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BillingMode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BillingMode to be of type string, got %T instead", value)
|
|
}
|
|
sv.BillingMode = types.BillingMode(jtv)
|
|
}
|
|
|
|
case "ItemCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected ItemCount to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ItemCount = ptr.Int64(i64)
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "OnDemandThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableCreationDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.TableCreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected TableCreationDateTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "TableId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableId to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableId = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.TableSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentSourceTableFeatureDetails(v **types.SourceTableFeatureDetails, 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.SourceTableFeatureDetails
|
|
if *v == nil {
|
|
sv = &types.SourceTableFeatureDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndexes(&sv.GlobalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LocalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentLocalSecondaryIndexes(&sv.LocalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "SSEDescription":
|
|
if err := awsAwsjson10_deserializeDocumentSSEDescription(&sv.SSEDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "StreamDescription":
|
|
if err := awsAwsjson10_deserializeDocumentStreamSpecification(&sv.StreamDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TimeToLiveDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTimeToLiveDescription(&sv.TimeToLiveDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentSSEDescription(v **types.SSEDescription, 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.SSEDescription
|
|
if *v == nil {
|
|
sv = &types.SSEDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "InaccessibleEncryptionDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.InaccessibleEncryptionDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "KMSMasterKeyArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected KMSMasterKeyArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.KMSMasterKeyArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "SSEType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected SSEType to be of type string, got %T instead", value)
|
|
}
|
|
sv.SSEType = types.SSEType(jtv)
|
|
}
|
|
|
|
case "Status":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected SSEStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.Status = types.SSEStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentSSESpecification(v **types.SSESpecification, 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.SSESpecification
|
|
if *v == nil {
|
|
sv = &types.SSESpecification{}
|
|
} 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 SSEEnabled to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.Enabled = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "KMSMasterKeyId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected KMSMasterKeyId to be of type string, got %T instead", value)
|
|
}
|
|
sv.KMSMasterKeyId = ptr.String(jtv)
|
|
}
|
|
|
|
case "SSEType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected SSEType to be of type string, got %T instead", value)
|
|
}
|
|
sv.SSEType = types.SSEType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentStreamSpecification(v **types.StreamSpecification, 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.StreamSpecification
|
|
if *v == nil {
|
|
sv = &types.StreamSpecification{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "StreamEnabled":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected StreamEnabled to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.StreamEnabled = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "StreamViewType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected StreamViewType to be of type string, got %T instead", value)
|
|
}
|
|
sv.StreamViewType = types.StreamViewType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentStringSetAttributeValue(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 StringAttributeValue to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTableAlreadyExistsException(v **types.TableAlreadyExistsException, 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.TableAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.TableAlreadyExistsException{}
|
|
} 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 awsAwsjson10_deserializeDocumentTableAutoScalingDescription(v **types.TableAutoScalingDescription, 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.TableAutoScalingDescription
|
|
if *v == nil {
|
|
sv = &types.TableAutoScalingDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Replicas":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaAutoScalingDescriptionList(&sv.Replicas, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableStatus = types.TableStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTableClassSummary(v **types.TableClassSummary, 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.TableClassSummary
|
|
if *v == nil {
|
|
sv = &types.TableClassSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "LastUpdateDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastUpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "TableClass":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableClass to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableClass = types.TableClass(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTableCreationParameters(v **types.TableCreationParameters, 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.TableCreationParameters
|
|
if *v == nil {
|
|
sv = &types.TableCreationParameters{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "AttributeDefinitions":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeDefinitions(&sv.AttributeDefinitions, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "BillingMode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BillingMode to be of type string, got %T instead", value)
|
|
}
|
|
sv.BillingMode = types.BillingMode(jtv)
|
|
}
|
|
|
|
case "GlobalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndexList(&sv.GlobalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "OnDemandThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "SSESpecification":
|
|
if err := awsAwsjson10_deserializeDocumentSSESpecification(&sv.SSESpecification, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTableDescription(v **types.TableDescription, 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.TableDescription
|
|
if *v == nil {
|
|
sv = &types.TableDescription{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ArchivalSummary":
|
|
if err := awsAwsjson10_deserializeDocumentArchivalSummary(&sv.ArchivalSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "AttributeDefinitions":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeDefinitions(&sv.AttributeDefinitions, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "BillingModeSummary":
|
|
if err := awsAwsjson10_deserializeDocumentBillingModeSummary(&sv.BillingModeSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "CreationDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "DeletionProtectionEnabled":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected DeletionProtectionEnabled to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.DeletionProtectionEnabled = ptr.Bool(jtv)
|
|
}
|
|
|
|
case "GlobalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescriptionList(&sv.GlobalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "GlobalTableVersion":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.GlobalTableVersion = ptr.String(jtv)
|
|
}
|
|
|
|
case "ItemCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ItemCount = ptr.Int64(i64)
|
|
}
|
|
|
|
case "KeySchema":
|
|
if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LatestStreamArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.LatestStreamArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "LatestStreamLabel":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.LatestStreamLabel = ptr.String(jtv)
|
|
}
|
|
|
|
case "LocalSecondaryIndexes":
|
|
if err := awsAwsjson10_deserializeDocumentLocalSecondaryIndexDescriptionList(&sv.LocalSecondaryIndexes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "OnDemandThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ProvisionedThroughput":
|
|
if err := awsAwsjson10_deserializeDocumentProvisionedThroughputDescription(&sv.ProvisionedThroughput, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Replicas":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaDescriptionList(&sv.Replicas, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "RestoreSummary":
|
|
if err := awsAwsjson10_deserializeDocumentRestoreSummary(&sv.RestoreSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "SSEDescription":
|
|
if err := awsAwsjson10_deserializeDocumentSSEDescription(&sv.SSEDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "StreamSpecification":
|
|
if err := awsAwsjson10_deserializeDocumentStreamSpecification(&sv.StreamSpecification, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableClassSummary":
|
|
if err := awsAwsjson10_deserializeDocumentTableClassSummary(&sv.TableClassSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableId to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableId = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableSizeBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.TableSizeBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "TableStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableStatus = types.TableStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTableInUseException(v **types.TableInUseException, 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.TableInUseException
|
|
if *v == nil {
|
|
sv = &types.TableInUseException{}
|
|
} 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 awsAwsjson10_deserializeDocumentTableNameList(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 TableName to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTableNotFoundException(v **types.TableNotFoundException, 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.TableNotFoundException
|
|
if *v == nil {
|
|
sv = &types.TableNotFoundException{}
|
|
} 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 awsAwsjson10_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 TagKeyString 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 TagValueString to be of type string, got %T instead", value)
|
|
}
|
|
sv.Value = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTagList(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 := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTimeToLiveDescription(v **types.TimeToLiveDescription, 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.TimeToLiveDescription
|
|
if *v == nil {
|
|
sv = &types.TimeToLiveDescription{}
|
|
} 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 TimeToLiveAttributeName to be of type string, got %T instead", value)
|
|
}
|
|
sv.AttributeName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TimeToLiveStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TimeToLiveStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.TimeToLiveStatus = types.TimeToLiveStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTimeToLiveSpecification(v **types.TimeToLiveSpecification, 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.TimeToLiveSpecification
|
|
if *v == nil {
|
|
sv = &types.TimeToLiveSpecification{}
|
|
} 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 TimeToLiveAttributeName to be of type string, got %T instead", value)
|
|
}
|
|
sv.AttributeName = ptr.String(jtv)
|
|
}
|
|
|
|
case "Enabled":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected TimeToLiveEnabled to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.Enabled = ptr.Bool(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentTransactionCanceledException(v **types.TransactionCanceledException, 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.TransactionCanceledException
|
|
if *v == nil {
|
|
sv = &types.TransactionCanceledException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "CancellationReasons":
|
|
if err := awsAwsjson10_deserializeDocumentCancellationReasonList(&sv.CancellationReasons, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
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 awsAwsjson10_deserializeDocumentTransactionConflictException(v **types.TransactionConflictException, 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.TransactionConflictException
|
|
if *v == nil {
|
|
sv = &types.TransactionConflictException{}
|
|
} 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 awsAwsjson10_deserializeDocumentTransactionInProgressException(v **types.TransactionInProgressException, 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.TransactionInProgressException
|
|
if *v == nil {
|
|
sv = &types.TransactionInProgressException{}
|
|
} 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 awsAwsjson10_deserializeDocumentUpdateKinesisStreamingConfiguration(v **types.UpdateKinesisStreamingConfiguration, 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.UpdateKinesisStreamingConfiguration
|
|
if *v == nil {
|
|
sv = &types.UpdateKinesisStreamingConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ApproximateCreationDateTimePrecision":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value)
|
|
}
|
|
sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentWriteRequest(v **types.WriteRequest, 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.WriteRequest
|
|
if *v == nil {
|
|
sv = &types.WriteRequest{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "DeleteRequest":
|
|
if err := awsAwsjson10_deserializeDocumentDeleteRequest(&sv.DeleteRequest, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "PutRequest":
|
|
if err := awsAwsjson10_deserializeDocumentPutRequest(&sv.PutRequest, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeDocumentWriteRequests(v *[]types.WriteRequest, 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.WriteRequest
|
|
if *v == nil {
|
|
cv = []types.WriteRequest{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.WriteRequest
|
|
destAddr := &col
|
|
if err := awsAwsjson10_deserializeDocumentWriteRequest(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentBatchExecuteStatementOutput(v **BatchExecuteStatementOutput, 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 *BatchExecuteStatementOutput
|
|
if *v == nil {
|
|
sv = &BatchExecuteStatementOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacityMultiple(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Responses":
|
|
if err := awsAwsjson10_deserializeDocumentPartiQLBatchResponse(&sv.Responses, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentBatchGetItemOutput(v **BatchGetItemOutput, 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 *BatchGetItemOutput
|
|
if *v == nil {
|
|
sv = &BatchGetItemOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacityMultiple(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Responses":
|
|
if err := awsAwsjson10_deserializeDocumentBatchGetResponseMap(&sv.Responses, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "UnprocessedKeys":
|
|
if err := awsAwsjson10_deserializeDocumentBatchGetRequestMap(&sv.UnprocessedKeys, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentBatchWriteItemOutput(v **BatchWriteItemOutput, 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 *BatchWriteItemOutput
|
|
if *v == nil {
|
|
sv = &BatchWriteItemOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacityMultiple(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ItemCollectionMetrics":
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionMetricsPerTable(&sv.ItemCollectionMetrics, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "UnprocessedItems":
|
|
if err := awsAwsjson10_deserializeDocumentBatchWriteItemRequestMap(&sv.UnprocessedItems, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentCreateBackupOutput(v **CreateBackupOutput, 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 *CreateBackupOutput
|
|
if *v == nil {
|
|
sv = &CreateBackupOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BackupDetails":
|
|
if err := awsAwsjson10_deserializeDocumentBackupDetails(&sv.BackupDetails, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentCreateGlobalTableOutput(v **CreateGlobalTableOutput, 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 *CreateGlobalTableOutput
|
|
if *v == nil {
|
|
sv = &CreateGlobalTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalTableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentGlobalTableDescription(&sv.GlobalTableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentCreateTableOutput(v **CreateTableOutput, 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 *CreateTableOutput
|
|
if *v == nil {
|
|
sv = &CreateTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTableDescription(&sv.TableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDeleteBackupOutput(v **DeleteBackupOutput, 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 *DeleteBackupOutput
|
|
if *v == nil {
|
|
sv = &DeleteBackupOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BackupDescription":
|
|
if err := awsAwsjson10_deserializeDocumentBackupDescription(&sv.BackupDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDeleteItemOutput(v **DeleteItemOutput, 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 *DeleteItemOutput
|
|
if *v == nil {
|
|
sv = &DeleteItemOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Attributes":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Attributes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ItemCollectionMetrics":
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionMetrics(&sv.ItemCollectionMetrics, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDeleteResourcePolicyOutput(v **DeleteResourcePolicyOutput, 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 *DeleteResourcePolicyOutput
|
|
if *v == nil {
|
|
sv = &DeleteResourcePolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "RevisionId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PolicyRevisionId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RevisionId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDeleteTableOutput(v **DeleteTableOutput, 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 *DeleteTableOutput
|
|
if *v == nil {
|
|
sv = &DeleteTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTableDescription(&sv.TableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeBackupOutput(v **DescribeBackupOutput, 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 *DescribeBackupOutput
|
|
if *v == nil {
|
|
sv = &DescribeBackupOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BackupDescription":
|
|
if err := awsAwsjson10_deserializeDocumentBackupDescription(&sv.BackupDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeContinuousBackupsOutput(v **DescribeContinuousBackupsOutput, 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 *DescribeContinuousBackupsOutput
|
|
if *v == nil {
|
|
sv = &DescribeContinuousBackupsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ContinuousBackupsDescription":
|
|
if err := awsAwsjson10_deserializeDocumentContinuousBackupsDescription(&sv.ContinuousBackupsDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeContributorInsightsOutput(v **DescribeContributorInsightsOutput, 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 *DescribeContributorInsightsOutput
|
|
if *v == nil {
|
|
sv = &DescribeContributorInsightsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ContributorInsightsRuleList":
|
|
if err := awsAwsjson10_deserializeDocumentContributorInsightsRuleList(&sv.ContributorInsightsRuleList, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ContributorInsightsStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ContributorInsightsStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ContributorInsightsStatus = types.ContributorInsightsStatus(jtv)
|
|
}
|
|
|
|
case "FailureException":
|
|
if err := awsAwsjson10_deserializeDocumentFailureException(&sv.FailureException, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "LastUpdateDateTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastUpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected LastUpdateDateTime to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeEndpointsOutput(v **DescribeEndpointsOutput, 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 *DescribeEndpointsOutput
|
|
if *v == nil {
|
|
sv = &DescribeEndpointsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Endpoints":
|
|
if err := awsAwsjson10_deserializeDocumentEndpoints(&sv.Endpoints, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeExportOutput(v **DescribeExportOutput, 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 *DescribeExportOutput
|
|
if *v == nil {
|
|
sv = &DescribeExportOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ExportDescription":
|
|
if err := awsAwsjson10_deserializeDocumentExportDescription(&sv.ExportDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeGlobalTableOutput(v **DescribeGlobalTableOutput, 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 *DescribeGlobalTableOutput
|
|
if *v == nil {
|
|
sv = &DescribeGlobalTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalTableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentGlobalTableDescription(&sv.GlobalTableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeGlobalTableSettingsOutput(v **DescribeGlobalTableSettingsOutput, 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 *DescribeGlobalTableSettingsOutput
|
|
if *v == nil {
|
|
sv = &DescribeGlobalTableSettingsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalTableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.GlobalTableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicaSettings":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaSettingsDescriptionList(&sv.ReplicaSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeImportOutput(v **DescribeImportOutput, 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 *DescribeImportOutput
|
|
if *v == nil {
|
|
sv = &DescribeImportOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ImportTableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentImportTableDescription(&sv.ImportTableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeKinesisStreamingDestinationOutput(v **DescribeKinesisStreamingDestinationOutput, 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 *DescribeKinesisStreamingDestinationOutput
|
|
if *v == nil {
|
|
sv = &DescribeKinesisStreamingDestinationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "KinesisDataStreamDestinations":
|
|
if err := awsAwsjson10_deserializeDocumentKinesisDataStreamDestinations(&sv.KinesisDataStreamDestinations, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeLimitsOutput(v **DescribeLimitsOutput, 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 *DescribeLimitsOutput
|
|
if *v == nil {
|
|
sv = &DescribeLimitsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "AccountMaxReadCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.AccountMaxReadCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "AccountMaxWriteCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.AccountMaxWriteCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "TableMaxReadCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.TableMaxReadCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
case "TableMaxWriteCapacityUnits":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PositiveLongObject to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.TableMaxWriteCapacityUnits = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeTableOutput(v **DescribeTableOutput, 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 *DescribeTableOutput
|
|
if *v == nil {
|
|
sv = &DescribeTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Table":
|
|
if err := awsAwsjson10_deserializeDocumentTableDescription(&sv.Table, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeTableReplicaAutoScalingOutput(v **DescribeTableReplicaAutoScalingOutput, 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 *DescribeTableReplicaAutoScalingOutput
|
|
if *v == nil {
|
|
sv = &DescribeTableReplicaAutoScalingOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TableAutoScalingDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTableAutoScalingDescription(&sv.TableAutoScalingDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDescribeTimeToLiveOutput(v **DescribeTimeToLiveOutput, 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 *DescribeTimeToLiveOutput
|
|
if *v == nil {
|
|
sv = &DescribeTimeToLiveOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TimeToLiveDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTimeToLiveDescription(&sv.TimeToLiveDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentDisableKinesisStreamingDestinationOutput(v **DisableKinesisStreamingDestinationOutput, 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 *DisableKinesisStreamingDestinationOutput
|
|
if *v == nil {
|
|
sv = &DisableKinesisStreamingDestinationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "DestinationStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected DestinationStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.DestinationStatus = types.DestinationStatus(jtv)
|
|
}
|
|
|
|
case "EnableKinesisStreamingConfiguration":
|
|
if err := awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(&sv.EnableKinesisStreamingConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "StreamArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.StreamArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentEnableKinesisStreamingDestinationOutput(v **EnableKinesisStreamingDestinationOutput, 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 *EnableKinesisStreamingDestinationOutput
|
|
if *v == nil {
|
|
sv = &EnableKinesisStreamingDestinationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "DestinationStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected DestinationStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.DestinationStatus = types.DestinationStatus(jtv)
|
|
}
|
|
|
|
case "EnableKinesisStreamingConfiguration":
|
|
if err := awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(&sv.EnableKinesisStreamingConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "StreamArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.StreamArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentExecuteStatementOutput(v **ExecuteStatementOutput, 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 *ExecuteStatementOutput
|
|
if *v == nil {
|
|
sv = &ExecuteStatementOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Items":
|
|
if err := awsAwsjson10_deserializeDocumentItemList(&sv.Items, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LastEvaluatedKey":
|
|
if err := awsAwsjson10_deserializeDocumentKey(&sv.LastEvaluatedKey, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "NextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PartiQLNextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentExecuteTransactionOutput(v **ExecuteTransactionOutput, 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 *ExecuteTransactionOutput
|
|
if *v == nil {
|
|
sv = &ExecuteTransactionOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacityMultiple(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Responses":
|
|
if err := awsAwsjson10_deserializeDocumentItemResponseList(&sv.Responses, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentExportTableToPointInTimeOutput(v **ExportTableToPointInTimeOutput, 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 *ExportTableToPointInTimeOutput
|
|
if *v == nil {
|
|
sv = &ExportTableToPointInTimeOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ExportDescription":
|
|
if err := awsAwsjson10_deserializeDocumentExportDescription(&sv.ExportDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentGetItemOutput(v **GetItemOutput, 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 *GetItemOutput
|
|
if *v == nil {
|
|
sv = &GetItemOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Item":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Item, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, 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 *GetResourcePolicyOutput
|
|
if *v == nil {
|
|
sv = &GetResourcePolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Policy":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ResourcePolicy to be of type string, got %T instead", value)
|
|
}
|
|
sv.Policy = ptr.String(jtv)
|
|
}
|
|
|
|
case "RevisionId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PolicyRevisionId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RevisionId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentImportTableOutput(v **ImportTableOutput, 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 *ImportTableOutput
|
|
if *v == nil {
|
|
sv = &ImportTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ImportTableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentImportTableDescription(&sv.ImportTableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentListBackupsOutput(v **ListBackupsOutput, 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 *ListBackupsOutput
|
|
if *v == nil {
|
|
sv = &ListBackupsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "BackupSummaries":
|
|
if err := awsAwsjson10_deserializeDocumentBackupSummaries(&sv.BackupSummaries, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LastEvaluatedBackupArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BackupArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.LastEvaluatedBackupArn = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentListContributorInsightsOutput(v **ListContributorInsightsOutput, 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 *ListContributorInsightsOutput
|
|
if *v == nil {
|
|
sv = &ListContributorInsightsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ContributorInsightsSummaries":
|
|
if err := awsAwsjson10_deserializeDocumentContributorInsightsSummaries(&sv.ContributorInsightsSummaries, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "NextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentListExportsOutput(v **ListExportsOutput, 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 *ListExportsOutput
|
|
if *v == nil {
|
|
sv = &ListExportsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ExportSummaries":
|
|
if err := awsAwsjson10_deserializeDocumentExportSummaries(&sv.ExportSummaries, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "NextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExportNextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentListGlobalTablesOutput(v **ListGlobalTablesOutput, 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 *ListGlobalTablesOutput
|
|
if *v == nil {
|
|
sv = &ListGlobalTablesOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalTables":
|
|
if err := awsAwsjson10_deserializeDocumentGlobalTableList(&sv.GlobalTables, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LastEvaluatedGlobalTableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.LastEvaluatedGlobalTableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentListImportsOutput(v **ListImportsOutput, 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 *ListImportsOutput
|
|
if *v == nil {
|
|
sv = &ListImportsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ImportSummaryList":
|
|
if err := awsAwsjson10_deserializeDocumentImportSummaryList(&sv.ImportSummaryList, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "NextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImportNextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentListTablesOutput(v **ListTablesOutput, 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 *ListTablesOutput
|
|
if *v == nil {
|
|
sv = &ListTablesOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "LastEvaluatedTableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.LastEvaluatedTableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableNames":
|
|
if err := awsAwsjson10_deserializeDocumentTableNameList(&sv.TableNames, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentListTagsOfResourceOutput(v **ListTagsOfResourceOutput, 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 *ListTagsOfResourceOutput
|
|
if *v == nil {
|
|
sv = &ListTagsOfResourceOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "NextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "Tags":
|
|
if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentPutItemOutput(v **PutItemOutput, 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 *PutItemOutput
|
|
if *v == nil {
|
|
sv = &PutItemOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Attributes":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Attributes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ItemCollectionMetrics":
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionMetrics(&sv.ItemCollectionMetrics, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, 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 *PutResourcePolicyOutput
|
|
if *v == nil {
|
|
sv = &PutResourcePolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "RevisionId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PolicyRevisionId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RevisionId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentQueryOutput(v **QueryOutput, 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 *QueryOutput
|
|
if *v == nil {
|
|
sv = &QueryOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Count":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Count = int32(i64)
|
|
}
|
|
|
|
case "Items":
|
|
if err := awsAwsjson10_deserializeDocumentItemList(&sv.Items, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LastEvaluatedKey":
|
|
if err := awsAwsjson10_deserializeDocumentKey(&sv.LastEvaluatedKey, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ScannedCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ScannedCount = int32(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentRestoreTableFromBackupOutput(v **RestoreTableFromBackupOutput, 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 *RestoreTableFromBackupOutput
|
|
if *v == nil {
|
|
sv = &RestoreTableFromBackupOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTableDescription(&sv.TableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentRestoreTableToPointInTimeOutput(v **RestoreTableToPointInTimeOutput, 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 *RestoreTableToPointInTimeOutput
|
|
if *v == nil {
|
|
sv = &RestoreTableToPointInTimeOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTableDescription(&sv.TableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentScanOutput(v **ScanOutput, 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 *ScanOutput
|
|
if *v == nil {
|
|
sv = &ScanOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Count":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Count = int32(i64)
|
|
}
|
|
|
|
case "Items":
|
|
if err := awsAwsjson10_deserializeDocumentItemList(&sv.Items, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "LastEvaluatedKey":
|
|
if err := awsAwsjson10_deserializeDocumentKey(&sv.LastEvaluatedKey, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ScannedCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ScannedCount = int32(i64)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentTransactGetItemsOutput(v **TransactGetItemsOutput, 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 *TransactGetItemsOutput
|
|
if *v == nil {
|
|
sv = &TransactGetItemsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacityMultiple(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "Responses":
|
|
if err := awsAwsjson10_deserializeDocumentItemResponseList(&sv.Responses, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentTransactWriteItemsOutput(v **TransactWriteItemsOutput, 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 *TransactWriteItemsOutput
|
|
if *v == nil {
|
|
sv = &TransactWriteItemsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacityMultiple(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ItemCollectionMetrics":
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionMetricsPerTable(&sv.ItemCollectionMetrics, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateContinuousBackupsOutput(v **UpdateContinuousBackupsOutput, 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 *UpdateContinuousBackupsOutput
|
|
if *v == nil {
|
|
sv = &UpdateContinuousBackupsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ContinuousBackupsDescription":
|
|
if err := awsAwsjson10_deserializeDocumentContinuousBackupsDescription(&sv.ContinuousBackupsDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateContributorInsightsOutput(v **UpdateContributorInsightsOutput, 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 *UpdateContributorInsightsOutput
|
|
if *v == nil {
|
|
sv = &UpdateContributorInsightsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "ContributorInsightsStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ContributorInsightsStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.ContributorInsightsStatus = types.ContributorInsightsStatus(jtv)
|
|
}
|
|
|
|
case "IndexName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected IndexName to be of type string, got %T instead", value)
|
|
}
|
|
sv.IndexName = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateGlobalTableOutput(v **UpdateGlobalTableOutput, 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 *UpdateGlobalTableOutput
|
|
if *v == nil {
|
|
sv = &UpdateGlobalTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalTableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentGlobalTableDescription(&sv.GlobalTableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateGlobalTableSettingsOutput(v **UpdateGlobalTableSettingsOutput, 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 *UpdateGlobalTableSettingsOutput
|
|
if *v == nil {
|
|
sv = &UpdateGlobalTableSettingsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "GlobalTableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.GlobalTableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "ReplicaSettings":
|
|
if err := awsAwsjson10_deserializeDocumentReplicaSettingsDescriptionList(&sv.ReplicaSettings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateItemOutput(v **UpdateItemOutput, 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 *UpdateItemOutput
|
|
if *v == nil {
|
|
sv = &UpdateItemOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Attributes":
|
|
if err := awsAwsjson10_deserializeDocumentAttributeMap(&sv.Attributes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ConsumedCapacity":
|
|
if err := awsAwsjson10_deserializeDocumentConsumedCapacity(&sv.ConsumedCapacity, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "ItemCollectionMetrics":
|
|
if err := awsAwsjson10_deserializeDocumentItemCollectionMetrics(&sv.ItemCollectionMetrics, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateKinesisStreamingDestinationOutput(v **UpdateKinesisStreamingDestinationOutput, 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 *UpdateKinesisStreamingDestinationOutput
|
|
if *v == nil {
|
|
sv = &UpdateKinesisStreamingDestinationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "DestinationStatus":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected DestinationStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.DestinationStatus = types.DestinationStatus(jtv)
|
|
}
|
|
|
|
case "StreamArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.StreamArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "TableName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TableName to be of type string, got %T instead", value)
|
|
}
|
|
sv.TableName = ptr.String(jtv)
|
|
}
|
|
|
|
case "UpdateKinesisStreamingConfiguration":
|
|
if err := awsAwsjson10_deserializeDocumentUpdateKinesisStreamingConfiguration(&sv.UpdateKinesisStreamingConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateTableOutput(v **UpdateTableOutput, 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 *UpdateTableOutput
|
|
if *v == nil {
|
|
sv = &UpdateTableOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TableDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTableDescription(&sv.TableDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateTableReplicaAutoScalingOutput(v **UpdateTableReplicaAutoScalingOutput, 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 *UpdateTableReplicaAutoScalingOutput
|
|
if *v == nil {
|
|
sv = &UpdateTableReplicaAutoScalingOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TableAutoScalingDescription":
|
|
if err := awsAwsjson10_deserializeDocumentTableAutoScalingDescription(&sv.TableAutoScalingDescription, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson10_deserializeOpDocumentUpdateTimeToLiveOutput(v **UpdateTimeToLiveOutput, 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 *UpdateTimeToLiveOutput
|
|
if *v == nil {
|
|
sv = &UpdateTimeToLiveOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "TimeToLiveSpecification":
|
|
if err := awsAwsjson10_deserializeDocumentTimeToLiveSpecification(&sv.TimeToLiveSpecification, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type protocolErrorInfo struct {
|
|
Type string `json:"__type"`
|
|
Message string
|
|
Code any // nonstandard for awsjson but some services do present the type here
|
|
}
|
|
|
|
func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) {
|
|
var errInfo protocolErrorInfo
|
|
if err := decoder.Decode(&errInfo); err != nil {
|
|
if err == io.EOF {
|
|
return errInfo, nil
|
|
}
|
|
return errInfo, err
|
|
}
|
|
|
|
return errInfo, nil
|
|
}
|
|
|
|
func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) {
|
|
if len(headerType) != 0 {
|
|
return headerType, true
|
|
} else if len(bodyInfo.Type) != 0 {
|
|
return bodyInfo.Type, true
|
|
} else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 {
|
|
return code, true
|
|
}
|
|
return "", false
|
|
}
|