// Code generated by smithy-go-codegen DO NOT EDIT. package pipes import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/pipes/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" "strconv" "strings" ) type awsRestjson1_deserializeOpCreatePipe struct { } func (*awsRestjson1_deserializeOpCreatePipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreatePipe) 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, awsRestjson1_deserializeOpErrorCreatePipe(response, &metadata) } output := &CreatePipeOutput{} 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 = awsRestjson1_deserializeOpDocumentCreatePipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreatePipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreatePipeOutput(v **CreatePipeOutput, 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 *CreatePipeOutput if *v == nil { sv = &CreatePipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "CurrentState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) } sv.CurrentState = types.PipeState(jtv) } case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) } sv.DesiredState = types.RequestedPipeState(jtv) } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeletePipe struct { } func (*awsRestjson1_deserializeOpDeletePipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeletePipe) 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, awsRestjson1_deserializeOpErrorDeletePipe(response, &metadata) } output := &DeletePipeOutput{} 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 = awsRestjson1_deserializeOpDocumentDeletePipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeletePipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeletePipeOutput(v **DeletePipeOutput, 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 *DeletePipeOutput if *v == nil { sv = &DeletePipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "CurrentState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) } sv.CurrentState = types.PipeState(jtv) } case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestedPipeStateDescribeResponse to be of type string, got %T instead", value) } sv.DesiredState = types.RequestedPipeStateDescribeResponse(jtv) } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribePipe struct { } func (*awsRestjson1_deserializeOpDescribePipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribePipe) 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, awsRestjson1_deserializeOpErrorDescribePipe(response, &metadata) } output := &DescribePipeOutput{} 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 = awsRestjson1_deserializeOpDocumentDescribePipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDescribePipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribePipeOutput(v **DescribePipeOutput, 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 *DescribePipeOutput if *v == nil { sv = &DescribePipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "CurrentState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) } sv.CurrentState = types.PipeState(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestedPipeStateDescribeResponse to be of type string, got %T instead", value) } sv.DesiredState = types.RequestedPipeStateDescribeResponse(jtv) } case "Enrichment": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OptionalArn to be of type string, got %T instead", value) } sv.Enrichment = ptr.String(jtv) } case "EnrichmentParameters": if err := awsRestjson1_deserializeDocumentPipeEnrichmentParameters(&sv.EnrichmentParameters, value); err != nil { return err } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "Source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnOrUrl to be of type string, got %T instead", value) } sv.Source = ptr.String(jtv) } case "SourceParameters": if err := awsRestjson1_deserializeDocumentPipeSourceParameters(&sv.SourceParameters, value); err != nil { return err } case "StateReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeStateReason to be of type string, got %T instead", value) } sv.StateReason = ptr.String(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "Target": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Target = ptr.String(jtv) } case "TargetParameters": if err := awsRestjson1_deserializeDocumentPipeTargetParameters(&sv.TargetParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListPipes struct { } func (*awsRestjson1_deserializeOpListPipes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListPipes) 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, awsRestjson1_deserializeOpErrorListPipes(response, &metadata) } output := &ListPipesOutput{} 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 = awsRestjson1_deserializeOpDocumentListPipesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListPipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListPipesOutput(v **ListPipesOutput, 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 *ListPipesOutput if *v == nil { sv = &ListPipesOutput{} } 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 NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Pipes": if err := awsRestjson1_deserializeDocumentPipeList(&sv.Pipes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) 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, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} 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 = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartPipe struct { } func (*awsRestjson1_deserializeOpStartPipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartPipe) 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, awsRestjson1_deserializeOpErrorStartPipe(response, &metadata) } output := &StartPipeOutput{} 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 = awsRestjson1_deserializeOpDocumentStartPipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStartPipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartPipeOutput(v **StartPipeOutput, 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 *StartPipeOutput if *v == nil { sv = &StartPipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "CurrentState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) } sv.CurrentState = types.PipeState(jtv) } case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) } sv.DesiredState = types.RequestedPipeState(jtv) } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStopPipe struct { } func (*awsRestjson1_deserializeOpStopPipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopPipe) 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, awsRestjson1_deserializeOpErrorStopPipe(response, &metadata) } output := &StopPipeOutput{} 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 = awsRestjson1_deserializeOpDocumentStopPipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStopPipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStopPipeOutput(v **StopPipeOutput, 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 *StopPipeOutput if *v == nil { sv = &StopPipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "CurrentState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) } sv.CurrentState = types.PipeState(jtv) } case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) } sv.DesiredState = types.RequestedPipeState(jtv) } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_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, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_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, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdatePipe struct { } func (*awsRestjson1_deserializeOpUpdatePipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdatePipe) 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, awsRestjson1_deserializeOpErrorUpdatePipe(response, &metadata) } output := &UpdatePipeOutput{} 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 = awsRestjson1_deserializeOpDocumentUpdatePipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdatePipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdatePipeOutput(v **UpdatePipeOutput, 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 *UpdatePipeOutput if *v == nil { sv = &UpdatePipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "CurrentState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) } sv.CurrentState = types.PipeState(jtv) } case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) } sv.DesiredState = types.RequestedPipeState(jtv) } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeOpHttpBindingsInternalException(v *types.InternalException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) vv, err := strconv.ParseInt(headerValues[0], 0, 32) if err != nil { return err } v.RetryAfterSeconds = ptr.Int32(int32(vv)) } return nil } func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) vv, err := strconv.ParseInt(headerValues[0], 0, 32) if err != nil { return err } v.RetryAfterSeconds = ptr.Int32(int32(vv)) } return nil } func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} 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 } err := awsRestjson1_deserializeDocumentConflictException(&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 awsRestjson1_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalException{} 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 } err := awsRestjson1_deserializeDocumentInternalException(&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) if err := awsRestjson1_deserializeOpHttpBindingsInternalException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} 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 } err := awsRestjson1_deserializeDocumentNotFoundException(&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 awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} 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 } err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&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 awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} 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 } err := awsRestjson1_deserializeDocumentThrottlingException(&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) if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} 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 } err := awsRestjson1_deserializeDocumentValidationException(&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 awsRestjson1_deserializeDocumentAwsVpcConfiguration(v **types.AwsVpcConfiguration, 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.AwsVpcConfiguration if *v == nil { sv = &types.AwsVpcConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "AssignPublicIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssignPublicIp to be of type string, got %T instead", value) } sv.AssignPublicIp = types.AssignPublicIp(jtv) } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil { return err } case "Subnets": if err := awsRestjson1_deserializeDocumentSubnets(&sv.Subnets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchArrayProperties(v **types.BatchArrayProperties, 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.BatchArrayProperties if *v == nil { sv = &types.BatchArrayProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Size": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BatchArraySize to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Size = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchContainerOverrides(v **types.BatchContainerOverrides, 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.BatchContainerOverrides if *v == nil { sv = &types.BatchContainerOverrides{} } else { sv = *v } for key, value := range shape { switch key { case "Command": if err := awsRestjson1_deserializeDocumentStringList(&sv.Command, value); err != nil { return err } case "Environment": if err := awsRestjson1_deserializeDocumentBatchEnvironmentVariableList(&sv.Environment, value); err != nil { return err } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "ResourceRequirements": if err := awsRestjson1_deserializeDocumentBatchResourceRequirementsList(&sv.ResourceRequirements, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchDependsOn(v *[]types.BatchJobDependency, 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.BatchJobDependency if *v == nil { cv = []types.BatchJobDependency{} } else { cv = *v } for _, value := range shape { var col types.BatchJobDependency destAddr := &col if err := awsRestjson1_deserializeDocumentBatchJobDependency(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBatchEnvironmentVariable(v **types.BatchEnvironmentVariable, 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.BatchEnvironmentVariable if *v == nil { sv = &types.BatchEnvironmentVariable{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchEnvironmentVariableList(v *[]types.BatchEnvironmentVariable, 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.BatchEnvironmentVariable if *v == nil { cv = []types.BatchEnvironmentVariable{} } else { cv = *v } for _, value := range shape { var col types.BatchEnvironmentVariable destAddr := &col if err := awsRestjson1_deserializeDocumentBatchEnvironmentVariable(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBatchJobDependency(v **types.BatchJobDependency, 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.BatchJobDependency if *v == nil { sv = &types.BatchJobDependency{} } else { sv = *v } for key, value := range shape { switch key { case "JobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.JobId = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BatchJobDependencyType to be of type string, got %T instead", value) } sv.Type = types.BatchJobDependencyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchParametersMap(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 String to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentBatchResourceRequirement(v **types.BatchResourceRequirement, 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.BatchResourceRequirement if *v == nil { sv = &types.BatchResourceRequirement{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BatchResourceRequirementType to be of type string, got %T instead", value) } sv.Type = types.BatchResourceRequirementType(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchResourceRequirementsList(v *[]types.BatchResourceRequirement, 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.BatchResourceRequirement if *v == nil { cv = []types.BatchResourceRequirement{} } else { cv = *v } for _, value := range shape { var col types.BatchResourceRequirement destAddr := &col if err := awsRestjson1_deserializeDocumentBatchResourceRequirement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBatchRetryStrategy(v **types.BatchRetryStrategy, 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.BatchRetryStrategy if *v == nil { sv = &types.BatchRetryStrategy{} } else { sv = *v } for key, value := range shape { switch key { case "Attempts": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BatchRetryAttempts to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Attempts = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCapacityProviderStrategy(v *[]types.CapacityProviderStrategyItem, 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.CapacityProviderStrategyItem if *v == nil { cv = []types.CapacityProviderStrategyItem{} } else { cv = *v } for _, value := range shape { var col types.CapacityProviderStrategyItem destAddr := &col if err := awsRestjson1_deserializeDocumentCapacityProviderStrategyItem(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCapacityProviderStrategyItem(v **types.CapacityProviderStrategyItem, 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.CapacityProviderStrategyItem if *v == nil { sv = &types.CapacityProviderStrategyItem{} } else { sv = *v } for key, value := range shape { switch key { case "base": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected CapacityProviderStrategyItemBase to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Base = int32(i64) } case "capacityProvider": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CapacityProvider to be of type string, got %T instead", value) } sv.CapacityProvider = ptr.String(jtv) } case "weight": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected CapacityProviderStrategyItemWeight to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Weight = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, 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.ConflictException if *v == nil { sv = &types.ConflictException{} } 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) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDeadLetterConfig(v **types.DeadLetterConfig, 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.DeadLetterConfig if *v == nil { sv = &types.DeadLetterConfig{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcsContainerOverride(v **types.EcsContainerOverride, 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.EcsContainerOverride if *v == nil { sv = &types.EcsContainerOverride{} } else { sv = *v } for key, value := range shape { switch key { case "Command": if err := awsRestjson1_deserializeDocumentStringList(&sv.Command, value); err != nil { return err } case "Cpu": 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.Cpu = ptr.Int32(int32(i64)) } case "Environment": if err := awsRestjson1_deserializeDocumentEcsEnvironmentVariableList(&sv.Environment, value); err != nil { return err } case "EnvironmentFiles": if err := awsRestjson1_deserializeDocumentEcsEnvironmentFileList(&sv.EnvironmentFiles, value); err != nil { return err } case "Memory": 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.Memory = ptr.Int32(int32(i64)) } case "MemoryReservation": 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.MemoryReservation = ptr.Int32(int32(i64)) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ResourceRequirements": if err := awsRestjson1_deserializeDocumentEcsResourceRequirementsList(&sv.ResourceRequirements, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcsContainerOverrideList(v *[]types.EcsContainerOverride, 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.EcsContainerOverride if *v == nil { cv = []types.EcsContainerOverride{} } else { cv = *v } for _, value := range shape { var col types.EcsContainerOverride destAddr := &col if err := awsRestjson1_deserializeDocumentEcsContainerOverride(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEcsEnvironmentFile(v **types.EcsEnvironmentFile, 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.EcsEnvironmentFile if *v == nil { sv = &types.EcsEnvironmentFile{} } else { sv = *v } for key, value := range shape { switch key { case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EcsEnvironmentFileType to be of type string, got %T instead", value) } sv.Type = types.EcsEnvironmentFileType(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcsEnvironmentFileList(v *[]types.EcsEnvironmentFile, 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.EcsEnvironmentFile if *v == nil { cv = []types.EcsEnvironmentFile{} } else { cv = *v } for _, value := range shape { var col types.EcsEnvironmentFile destAddr := &col if err := awsRestjson1_deserializeDocumentEcsEnvironmentFile(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEcsEnvironmentVariable(v **types.EcsEnvironmentVariable, 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.EcsEnvironmentVariable if *v == nil { sv = &types.EcsEnvironmentVariable{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcsEnvironmentVariableList(v *[]types.EcsEnvironmentVariable, 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.EcsEnvironmentVariable if *v == nil { cv = []types.EcsEnvironmentVariable{} } else { cv = *v } for _, value := range shape { var col types.EcsEnvironmentVariable destAddr := &col if err := awsRestjson1_deserializeDocumentEcsEnvironmentVariable(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEcsEphemeralStorage(v **types.EcsEphemeralStorage, 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.EcsEphemeralStorage if *v == nil { sv = &types.EcsEphemeralStorage{} } else { sv = *v } for key, value := range shape { switch key { case "sizeInGiB": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EphemeralStorageSize to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInGiB = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverride(v **types.EcsInferenceAcceleratorOverride, 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.EcsInferenceAcceleratorOverride if *v == nil { sv = &types.EcsInferenceAcceleratorOverride{} } else { sv = *v } for key, value := range shape { switch key { case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "deviceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DeviceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverrideList(v *[]types.EcsInferenceAcceleratorOverride, 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.EcsInferenceAcceleratorOverride if *v == nil { cv = []types.EcsInferenceAcceleratorOverride{} } else { cv = *v } for _, value := range shape { var col types.EcsInferenceAcceleratorOverride destAddr := &col if err := awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverride(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEcsResourceRequirement(v **types.EcsResourceRequirement, 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.EcsResourceRequirement if *v == nil { sv = &types.EcsResourceRequirement{} } else { sv = *v } for key, value := range shape { switch key { case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EcsResourceRequirementType to be of type string, got %T instead", value) } sv.Type = types.EcsResourceRequirementType(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcsResourceRequirementsList(v *[]types.EcsResourceRequirement, 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.EcsResourceRequirement if *v == nil { cv = []types.EcsResourceRequirement{} } else { cv = *v } for _, value := range shape { var col types.EcsResourceRequirement destAddr := &col if err := awsRestjson1_deserializeDocumentEcsResourceRequirement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEcsTaskOverride(v **types.EcsTaskOverride, 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.EcsTaskOverride if *v == nil { sv = &types.EcsTaskOverride{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerOverrides": if err := awsRestjson1_deserializeDocumentEcsContainerOverrideList(&sv.ContainerOverrides, value); err != nil { return err } case "Cpu": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Cpu = ptr.String(jtv) } case "EphemeralStorage": if err := awsRestjson1_deserializeDocumentEcsEphemeralStorage(&sv.EphemeralStorage, value); err != nil { return err } case "ExecutionRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnOrJsonPath to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } case "InferenceAcceleratorOverrides": if err := awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverrideList(&sv.InferenceAcceleratorOverrides, value); err != nil { return err } case "Memory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Memory = ptr.String(jtv) } case "TaskRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnOrJsonPath to be of type string, got %T instead", value) } sv.TaskRoleArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEventBridgeEventResourceList(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 ArnOrJsonPath to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilter(v **types.Filter, 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.Filter if *v == nil { sv = &types.Filter{} } else { sv = *v } for key, value := range shape { switch key { case "Pattern": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EventPattern to be of type string, got %T instead", value) } sv.Pattern = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterCriteria(v **types.FilterCriteria, 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.FilterCriteria if *v == nil { sv = &types.FilterCriteria{} } else { sv = *v } for key, value := range shape { switch key { case "Filters": if err := awsRestjson1_deserializeDocumentFilterList(&sv.Filters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterList(v *[]types.Filter, 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.Filter if *v == nil { cv = []types.Filter{} } else { cv = *v } for _, value := range shape { var col types.Filter destAddr := &col if err := awsRestjson1_deserializeDocumentFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentHeaderParametersMap(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 HeaderValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, 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.InternalException if *v == nil { sv = &types.InternalException{} } 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) } case "retryAfterSeconds": 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.RetryAfterSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKafkaBootstrapServers(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 EndpointString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMQBrokerAccessCredentials(v *types.MQBrokerAccessCredentials, 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.MQBrokerAccessCredentials loop: for key, value := range shape { if value == nil { continue } switch key { case "BasicAuth": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } mv = jtv } uv = &types.MQBrokerAccessCredentialsMemberBasicAuth{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentMSKAccessCredentials(v *types.MSKAccessCredentials, 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.MSKAccessCredentials loop: for key, value := range shape { if value == nil { continue } switch key { case "ClientCertificateTlsAuth": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } mv = jtv } uv = &types.MSKAccessCredentialsMemberClientCertificateTlsAuth{Value: mv} break loop case "SaslScram512Auth": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } mv = jtv } uv = &types.MSKAccessCredentialsMemberSaslScram512Auth{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentNetworkConfiguration(v **types.NetworkConfiguration, 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.NetworkConfiguration if *v == nil { sv = &types.NetworkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "awsvpcConfiguration": if err := awsRestjson1_deserializeDocumentAwsVpcConfiguration(&sv.AwsvpcConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, 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.NotFoundException if *v == nil { sv = &types.NotFoundException{} } 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 awsRestjson1_deserializeDocumentPathParameterList(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 PathParameter to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPipe(v **types.Pipe, 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.Pipe if *v == nil { sv = &types.Pipe{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "CurrentState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) } sv.CurrentState = types.PipeState(jtv) } case "DesiredState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) } sv.DesiredState = types.RequestedPipeState(jtv) } case "Enrichment": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OptionalArn to be of type string, got %T instead", value) } sv.Enrichment = ptr.String(jtv) } case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnOrUrl to be of type string, got %T instead", value) } sv.Source = ptr.String(jtv) } case "StateReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeStateReason to be of type string, got %T instead", value) } sv.StateReason = ptr.String(jtv) } case "Target": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Target = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeEnrichmentHttpParameters(v **types.PipeEnrichmentHttpParameters, 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.PipeEnrichmentHttpParameters if *v == nil { sv = &types.PipeEnrichmentHttpParameters{} } else { sv = *v } for key, value := range shape { switch key { case "HeaderParameters": if err := awsRestjson1_deserializeDocumentHeaderParametersMap(&sv.HeaderParameters, value); err != nil { return err } case "PathParameterValues": if err := awsRestjson1_deserializeDocumentPathParameterList(&sv.PathParameterValues, value); err != nil { return err } case "QueryStringParameters": if err := awsRestjson1_deserializeDocumentQueryStringParametersMap(&sv.QueryStringParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeEnrichmentParameters(v **types.PipeEnrichmentParameters, 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.PipeEnrichmentParameters if *v == nil { sv = &types.PipeEnrichmentParameters{} } else { sv = *v } for key, value := range shape { switch key { case "HttpParameters": if err := awsRestjson1_deserializeDocumentPipeEnrichmentHttpParameters(&sv.HttpParameters, value); err != nil { return err } case "InputTemplate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InputTemplate to be of type string, got %T instead", value) } sv.InputTemplate = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeList(v *[]types.Pipe, 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.Pipe if *v == nil { cv = []types.Pipe{} } else { cv = *v } for _, value := range shape { var col types.Pipe destAddr := &col if err := awsRestjson1_deserializeDocumentPipe(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPipeSourceActiveMQBrokerParameters(v **types.PipeSourceActiveMQBrokerParameters, 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.PipeSourceActiveMQBrokerParameters if *v == nil { sv = &types.PipeSourceActiveMQBrokerParameters{} } else { sv = *v } for key, value := range shape { switch key { case "BatchSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BatchSize = ptr.Int32(int32(i64)) } case "Credentials": if err := awsRestjson1_deserializeDocumentMQBrokerAccessCredentials(&sv.Credentials, value); err != nil { return err } case "MaximumBatchingWindowInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) } case "QueueName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MQBrokerQueueName to be of type string, got %T instead", value) } sv.QueueName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeSourceDynamoDBStreamParameters(v **types.PipeSourceDynamoDBStreamParameters, 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.PipeSourceDynamoDBStreamParameters if *v == nil { sv = &types.PipeSourceDynamoDBStreamParameters{} } else { sv = *v } for key, value := range shape { switch key { case "BatchSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BatchSize = ptr.Int32(int32(i64)) } case "DeadLetterConfig": if err := awsRestjson1_deserializeDocumentDeadLetterConfig(&sv.DeadLetterConfig, value); err != nil { return err } case "MaximumBatchingWindowInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) } case "MaximumRecordAgeInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumRecordAgeInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumRecordAgeInSeconds = ptr.Int32(int32(i64)) } case "MaximumRetryAttempts": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumRetryAttemptsESM to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) } case "OnPartialBatchItemFailure": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OnPartialBatchItemFailureStreams to be of type string, got %T instead", value) } sv.OnPartialBatchItemFailure = types.OnPartialBatchItemFailureStreams(jtv) } case "ParallelizationFactor": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ParallelizationFactor = ptr.Int32(int32(i64)) } case "StartingPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DynamoDBStreamStartPosition to be of type string, got %T instead", value) } sv.StartingPosition = types.DynamoDBStreamStartPosition(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeSourceKinesisStreamParameters(v **types.PipeSourceKinesisStreamParameters, 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.PipeSourceKinesisStreamParameters if *v == nil { sv = &types.PipeSourceKinesisStreamParameters{} } else { sv = *v } for key, value := range shape { switch key { case "BatchSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BatchSize = ptr.Int32(int32(i64)) } case "DeadLetterConfig": if err := awsRestjson1_deserializeDocumentDeadLetterConfig(&sv.DeadLetterConfig, value); err != nil { return err } case "MaximumBatchingWindowInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) } case "MaximumRecordAgeInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumRecordAgeInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumRecordAgeInSeconds = ptr.Int32(int32(i64)) } case "MaximumRetryAttempts": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumRetryAttemptsESM to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) } case "OnPartialBatchItemFailure": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OnPartialBatchItemFailureStreams to be of type string, got %T instead", value) } sv.OnPartialBatchItemFailure = types.OnPartialBatchItemFailureStreams(jtv) } case "ParallelizationFactor": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ParallelizationFactor = ptr.Int32(int32(i64)) } case "StartingPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KinesisStreamStartPosition to be of type string, got %T instead", value) } sv.StartingPosition = types.KinesisStreamStartPosition(jtv) } case "StartingPositionTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartingPositionTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeSourceManagedStreamingKafkaParameters(v **types.PipeSourceManagedStreamingKafkaParameters, 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.PipeSourceManagedStreamingKafkaParameters if *v == nil { sv = &types.PipeSourceManagedStreamingKafkaParameters{} } else { sv = *v } for key, value := range shape { switch key { case "BatchSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BatchSize = ptr.Int32(int32(i64)) } case "ConsumerGroupID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected URI to be of type string, got %T instead", value) } sv.ConsumerGroupID = ptr.String(jtv) } case "Credentials": if err := awsRestjson1_deserializeDocumentMSKAccessCredentials(&sv.Credentials, value); err != nil { return err } case "MaximumBatchingWindowInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) } case "StartingPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MSKStartPosition to be of type string, got %T instead", value) } sv.StartingPosition = types.MSKStartPosition(jtv) } case "TopicName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KafkaTopicName to be of type string, got %T instead", value) } sv.TopicName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeSourceParameters(v **types.PipeSourceParameters, 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.PipeSourceParameters if *v == nil { sv = &types.PipeSourceParameters{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveMQBrokerParameters": if err := awsRestjson1_deserializeDocumentPipeSourceActiveMQBrokerParameters(&sv.ActiveMQBrokerParameters, value); err != nil { return err } case "DynamoDBStreamParameters": if err := awsRestjson1_deserializeDocumentPipeSourceDynamoDBStreamParameters(&sv.DynamoDBStreamParameters, value); err != nil { return err } case "FilterCriteria": if err := awsRestjson1_deserializeDocumentFilterCriteria(&sv.FilterCriteria, value); err != nil { return err } case "KinesisStreamParameters": if err := awsRestjson1_deserializeDocumentPipeSourceKinesisStreamParameters(&sv.KinesisStreamParameters, value); err != nil { return err } case "ManagedStreamingKafkaParameters": if err := awsRestjson1_deserializeDocumentPipeSourceManagedStreamingKafkaParameters(&sv.ManagedStreamingKafkaParameters, value); err != nil { return err } case "RabbitMQBrokerParameters": if err := awsRestjson1_deserializeDocumentPipeSourceRabbitMQBrokerParameters(&sv.RabbitMQBrokerParameters, value); err != nil { return err } case "SelfManagedKafkaParameters": if err := awsRestjson1_deserializeDocumentPipeSourceSelfManagedKafkaParameters(&sv.SelfManagedKafkaParameters, value); err != nil { return err } case "SqsQueueParameters": if err := awsRestjson1_deserializeDocumentPipeSourceSqsQueueParameters(&sv.SqsQueueParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeSourceRabbitMQBrokerParameters(v **types.PipeSourceRabbitMQBrokerParameters, 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.PipeSourceRabbitMQBrokerParameters if *v == nil { sv = &types.PipeSourceRabbitMQBrokerParameters{} } else { sv = *v } for key, value := range shape { switch key { case "BatchSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BatchSize = ptr.Int32(int32(i64)) } case "Credentials": if err := awsRestjson1_deserializeDocumentMQBrokerAccessCredentials(&sv.Credentials, value); err != nil { return err } case "MaximumBatchingWindowInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) } case "QueueName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MQBrokerQueueName to be of type string, got %T instead", value) } sv.QueueName = ptr.String(jtv) } case "VirtualHost": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected URI to be of type string, got %T instead", value) } sv.VirtualHost = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeSourceSelfManagedKafkaParameters(v **types.PipeSourceSelfManagedKafkaParameters, 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.PipeSourceSelfManagedKafkaParameters if *v == nil { sv = &types.PipeSourceSelfManagedKafkaParameters{} } else { sv = *v } for key, value := range shape { switch key { case "AdditionalBootstrapServers": if err := awsRestjson1_deserializeDocumentKafkaBootstrapServers(&sv.AdditionalBootstrapServers, value); err != nil { return err } case "BatchSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BatchSize = ptr.Int32(int32(i64)) } case "ConsumerGroupID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected URI to be of type string, got %T instead", value) } sv.ConsumerGroupID = ptr.String(jtv) } case "Credentials": if err := awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationCredentials(&sv.Credentials, value); err != nil { return err } case "MaximumBatchingWindowInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) } case "ServerRootCaCertificate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } sv.ServerRootCaCertificate = ptr.String(jtv) } case "StartingPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SelfManagedKafkaStartPosition to be of type string, got %T instead", value) } sv.StartingPosition = types.SelfManagedKafkaStartPosition(jtv) } case "TopicName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KafkaTopicName to be of type string, got %T instead", value) } sv.TopicName = ptr.String(jtv) } case "Vpc": if err := awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationVpc(&sv.Vpc, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeSourceSqsQueueParameters(v **types.PipeSourceSqsQueueParameters, 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.PipeSourceSqsQueueParameters if *v == nil { sv = &types.PipeSourceSqsQueueParameters{} } else { sv = *v } for key, value := range shape { switch key { case "BatchSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BatchSize = ptr.Int32(int32(i64)) } case "MaximumBatchingWindowInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetBatchJobParameters(v **types.PipeTargetBatchJobParameters, 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.PipeTargetBatchJobParameters if *v == nil { sv = &types.PipeTargetBatchJobParameters{} } else { sv = *v } for key, value := range shape { switch key { case "ArrayProperties": if err := awsRestjson1_deserializeDocumentBatchArrayProperties(&sv.ArrayProperties, value); err != nil { return err } case "ContainerOverrides": if err := awsRestjson1_deserializeDocumentBatchContainerOverrides(&sv.ContainerOverrides, value); err != nil { return err } case "DependsOn": if err := awsRestjson1_deserializeDocumentBatchDependsOn(&sv.DependsOn, value); err != nil { return err } case "JobDefinition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.JobDefinition = ptr.String(jtv) } case "JobName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.JobName = ptr.String(jtv) } case "Parameters": if err := awsRestjson1_deserializeDocumentBatchParametersMap(&sv.Parameters, value); err != nil { return err } case "RetryStrategy": if err := awsRestjson1_deserializeDocumentBatchRetryStrategy(&sv.RetryStrategy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetCloudWatchLogsParameters(v **types.PipeTargetCloudWatchLogsParameters, 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.PipeTargetCloudWatchLogsParameters if *v == nil { sv = &types.PipeTargetCloudWatchLogsParameters{} } else { sv = *v } for key, value := range shape { switch key { case "LogStreamName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value) } sv.LogStreamName = ptr.String(jtv) } case "Timestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JsonPath to be of type string, got %T instead", value) } sv.Timestamp = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetEcsTaskParameters(v **types.PipeTargetEcsTaskParameters, 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.PipeTargetEcsTaskParameters if *v == nil { sv = &types.PipeTargetEcsTaskParameters{} } else { sv = *v } for key, value := range shape { switch key { case "CapacityProviderStrategy": if err := awsRestjson1_deserializeDocumentCapacityProviderStrategy(&sv.CapacityProviderStrategy, value); err != nil { return err } case "EnableECSManagedTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableECSManagedTags = jtv } case "EnableExecuteCommand": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableExecuteCommand = jtv } case "Group": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Group = ptr.String(jtv) } case "LaunchType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchType to be of type string, got %T instead", value) } sv.LaunchType = types.LaunchType(jtv) } case "NetworkConfiguration": if err := awsRestjson1_deserializeDocumentNetworkConfiguration(&sv.NetworkConfiguration, value); err != nil { return err } case "Overrides": if err := awsRestjson1_deserializeDocumentEcsTaskOverride(&sv.Overrides, value); err != nil { return err } case "PlacementConstraints": if err := awsRestjson1_deserializeDocumentPlacementConstraints(&sv.PlacementConstraints, value); err != nil { return err } case "PlacementStrategy": if err := awsRestjson1_deserializeDocumentPlacementStrategies(&sv.PlacementStrategy, value); err != nil { return err } case "PlatformVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PlatformVersion = ptr.String(jtv) } case "PropagateTags": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PropagateTags to be of type string, got %T instead", value) } sv.PropagateTags = types.PropagateTags(jtv) } case "ReferenceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReferenceId to be of type string, got %T instead", value) } sv.ReferenceId = ptr.String(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } case "TaskCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LimitMin1 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TaskCount = ptr.Int32(int32(i64)) } case "TaskDefinitionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArnOrJsonPath to be of type string, got %T instead", value) } sv.TaskDefinitionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetEventBridgeEventBusParameters(v **types.PipeTargetEventBridgeEventBusParameters, 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.PipeTargetEventBridgeEventBusParameters if *v == nil { sv = &types.PipeTargetEventBridgeEventBusParameters{} } else { sv = *v } for key, value := range shape { switch key { case "DetailType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EventBridgeDetailType to be of type string, got %T instead", value) } sv.DetailType = ptr.String(jtv) } case "EndpointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EventBridgeEndpointId to be of type string, got %T instead", value) } sv.EndpointId = ptr.String(jtv) } case "Resources": if err := awsRestjson1_deserializeDocumentEventBridgeEventResourceList(&sv.Resources, value); err != nil { return err } case "Source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EventBridgeEventSource to be of type string, got %T instead", value) } sv.Source = ptr.String(jtv) } case "Time": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JsonPath to be of type string, got %T instead", value) } sv.Time = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetHttpParameters(v **types.PipeTargetHttpParameters, 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.PipeTargetHttpParameters if *v == nil { sv = &types.PipeTargetHttpParameters{} } else { sv = *v } for key, value := range shape { switch key { case "HeaderParameters": if err := awsRestjson1_deserializeDocumentHeaderParametersMap(&sv.HeaderParameters, value); err != nil { return err } case "PathParameterValues": if err := awsRestjson1_deserializeDocumentPathParameterList(&sv.PathParameterValues, value); err != nil { return err } case "QueryStringParameters": if err := awsRestjson1_deserializeDocumentQueryStringParametersMap(&sv.QueryStringParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetKinesisStreamParameters(v **types.PipeTargetKinesisStreamParameters, 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.PipeTargetKinesisStreamParameters if *v == nil { sv = &types.PipeTargetKinesisStreamParameters{} } else { sv = *v } for key, value := range shape { switch key { case "PartitionKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KinesisPartitionKey to be of type string, got %T instead", value) } sv.PartitionKey = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetLambdaFunctionParameters(v **types.PipeTargetLambdaFunctionParameters, 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.PipeTargetLambdaFunctionParameters if *v == nil { sv = &types.PipeTargetLambdaFunctionParameters{} } else { sv = *v } for key, value := range shape { switch key { case "InvocationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeTargetInvocationType to be of type string, got %T instead", value) } sv.InvocationType = types.PipeTargetInvocationType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetParameters(v **types.PipeTargetParameters, 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.PipeTargetParameters if *v == nil { sv = &types.PipeTargetParameters{} } else { sv = *v } for key, value := range shape { switch key { case "BatchJobParameters": if err := awsRestjson1_deserializeDocumentPipeTargetBatchJobParameters(&sv.BatchJobParameters, value); err != nil { return err } case "CloudWatchLogsParameters": if err := awsRestjson1_deserializeDocumentPipeTargetCloudWatchLogsParameters(&sv.CloudWatchLogsParameters, value); err != nil { return err } case "EcsTaskParameters": if err := awsRestjson1_deserializeDocumentPipeTargetEcsTaskParameters(&sv.EcsTaskParameters, value); err != nil { return err } case "EventBridgeEventBusParameters": if err := awsRestjson1_deserializeDocumentPipeTargetEventBridgeEventBusParameters(&sv.EventBridgeEventBusParameters, value); err != nil { return err } case "HttpParameters": if err := awsRestjson1_deserializeDocumentPipeTargetHttpParameters(&sv.HttpParameters, value); err != nil { return err } case "InputTemplate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InputTemplate to be of type string, got %T instead", value) } sv.InputTemplate = ptr.String(jtv) } case "KinesisStreamParameters": if err := awsRestjson1_deserializeDocumentPipeTargetKinesisStreamParameters(&sv.KinesisStreamParameters, value); err != nil { return err } case "LambdaFunctionParameters": if err := awsRestjson1_deserializeDocumentPipeTargetLambdaFunctionParameters(&sv.LambdaFunctionParameters, value); err != nil { return err } case "RedshiftDataParameters": if err := awsRestjson1_deserializeDocumentPipeTargetRedshiftDataParameters(&sv.RedshiftDataParameters, value); err != nil { return err } case "SageMakerPipelineParameters": if err := awsRestjson1_deserializeDocumentPipeTargetSageMakerPipelineParameters(&sv.SageMakerPipelineParameters, value); err != nil { return err } case "SqsQueueParameters": if err := awsRestjson1_deserializeDocumentPipeTargetSqsQueueParameters(&sv.SqsQueueParameters, value); err != nil { return err } case "StepFunctionStateMachineParameters": if err := awsRestjson1_deserializeDocumentPipeTargetStateMachineParameters(&sv.StepFunctionStateMachineParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetRedshiftDataParameters(v **types.PipeTargetRedshiftDataParameters, 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.PipeTargetRedshiftDataParameters if *v == nil { sv = &types.PipeTargetRedshiftDataParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "DbUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DbUser to be of type string, got %T instead", value) } sv.DbUser = ptr.String(jtv) } case "SecretManagerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArnOrJsonPath to be of type string, got %T instead", value) } sv.SecretManagerArn = ptr.String(jtv) } case "Sqls": if err := awsRestjson1_deserializeDocumentSqls(&sv.Sqls, value); err != nil { return err } case "StatementName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatementName to be of type string, got %T instead", value) } sv.StatementName = ptr.String(jtv) } case "WithEvent": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.WithEvent = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetSageMakerPipelineParameters(v **types.PipeTargetSageMakerPipelineParameters, 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.PipeTargetSageMakerPipelineParameters if *v == nil { sv = &types.PipeTargetSageMakerPipelineParameters{} } else { sv = *v } for key, value := range shape { switch key { case "PipelineParameterList": if err := awsRestjson1_deserializeDocumentSageMakerPipelineParameterList(&sv.PipelineParameterList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetSqsQueueParameters(v **types.PipeTargetSqsQueueParameters, 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.PipeTargetSqsQueueParameters if *v == nil { sv = &types.PipeTargetSqsQueueParameters{} } else { sv = *v } for key, value := range shape { switch key { case "MessageDeduplicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MessageDeduplicationId to be of type string, got %T instead", value) } sv.MessageDeduplicationId = ptr.String(jtv) } case "MessageGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MessageGroupId to be of type string, got %T instead", value) } sv.MessageGroupId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPipeTargetStateMachineParameters(v **types.PipeTargetStateMachineParameters, 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.PipeTargetStateMachineParameters if *v == nil { sv = &types.PipeTargetStateMachineParameters{} } else { sv = *v } for key, value := range shape { switch key { case "InvocationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipeTargetInvocationType to be of type string, got %T instead", value) } sv.InvocationType = types.PipeTargetInvocationType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPlacementConstraint(v **types.PlacementConstraint, 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.PlacementConstraint if *v == nil { sv = &types.PlacementConstraint{} } else { sv = *v } for key, value := range shape { switch key { case "expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PlacementConstraintExpression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PlacementConstraintType to be of type string, got %T instead", value) } sv.Type = types.PlacementConstraintType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPlacementConstraints(v *[]types.PlacementConstraint, 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.PlacementConstraint if *v == nil { cv = []types.PlacementConstraint{} } else { cv = *v } for _, value := range shape { var col types.PlacementConstraint destAddr := &col if err := awsRestjson1_deserializeDocumentPlacementConstraint(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPlacementStrategies(v *[]types.PlacementStrategy, 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.PlacementStrategy if *v == nil { cv = []types.PlacementStrategy{} } else { cv = *v } for _, value := range shape { var col types.PlacementStrategy destAddr := &col if err := awsRestjson1_deserializeDocumentPlacementStrategy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPlacementStrategy(v **types.PlacementStrategy, 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.PlacementStrategy if *v == nil { sv = &types.PlacementStrategy{} } else { sv = *v } for key, value := range shape { switch key { case "field": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PlacementStrategyField to be of type string, got %T instead", value) } sv.Field = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PlacementStrategyType to be of type string, got %T instead", value) } sv.Type = types.PlacementStrategyType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentQueryStringParametersMap(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 QueryStringValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentSageMakerPipelineParameter(v **types.SageMakerPipelineParameter, 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.SageMakerPipelineParameter if *v == nil { sv = &types.SageMakerPipelineParameter{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SageMakerPipelineParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SageMakerPipelineParameterValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSageMakerPipelineParameterList(v *[]types.SageMakerPipelineParameter, 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.SageMakerPipelineParameter if *v == nil { cv = []types.SageMakerPipelineParameter{} } else { cv = *v } for _, value := range shape { var col types.SageMakerPipelineParameter destAddr := &col if err := awsRestjson1_deserializeDocumentSageMakerPipelineParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSecurityGroupIds(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 SecurityGroupId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSecurityGroups(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 SecurityGroup to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationCredentials(v *types.SelfManagedKafkaAccessConfigurationCredentials, 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.SelfManagedKafkaAccessConfigurationCredentials loop: for key, value := range shape { if value == nil { continue } switch key { case "BasicAuth": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } mv = jtv } uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberBasicAuth{Value: mv} break loop case "ClientCertificateTlsAuth": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } mv = jtv } uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberClientCertificateTlsAuth{Value: mv} break loop case "SaslScram256Auth": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } mv = jtv } uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram256Auth{Value: mv} break loop case "SaslScram512Auth": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) } mv = jtv } uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram512Auth{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationVpc(v **types.SelfManagedKafkaAccessConfigurationVpc, 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.SelfManagedKafkaAccessConfigurationVpc if *v == nil { sv = &types.SelfManagedKafkaAccessConfigurationVpc{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityGroup": if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroup, value); err != nil { return err } case "Subnets": if err := awsRestjson1_deserializeDocumentSubnetIds(&sv.Subnets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } 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) } case "quotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSqls(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 Sql to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringList(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 String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubnetIds(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 SubnetId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubnets(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 Subnet to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTagMap(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 TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } 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) } case "quotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "retryAfterSeconds": 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.RetryAfterSeconds = ptr.Int32(int32(i64)) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "fieldList": if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, 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 awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, 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.ValidationExceptionField if *v == nil { sv = &types.ValidationExceptionField{} } 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) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField if *v == nil { cv = []types.ValidationExceptionField{} } else { cv = *v } for _, value := range shape { var col types.ValidationExceptionField destAddr := &col if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil }