// Code generated by smithy-go-codegen DO NOT EDIT. package mgn import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/mgn/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" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "math" "strconv" "strings" ) type awsRestjson1_deserializeOpArchiveApplication struct { } func (*awsRestjson1_deserializeOpArchiveApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpArchiveApplication) 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_deserializeOpErrorArchiveApplication(response, &metadata) } output := &ArchiveApplicationOutput{} 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_deserializeOpDocumentArchiveApplicationOutput(&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_deserializeOpErrorArchiveApplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentArchiveApplicationOutput(v **ArchiveApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ArchiveApplicationOutput if *v == nil { sv = &ArchiveApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpArchiveWave struct { } func (*awsRestjson1_deserializeOpArchiveWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpArchiveWave) 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_deserializeOpErrorArchiveWave(response, &metadata) } output := &ArchiveWaveOutput{} 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_deserializeOpDocumentArchiveWaveOutput(&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_deserializeOpErrorArchiveWave(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentArchiveWaveOutput(v **ArchiveWaveOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ArchiveWaveOutput if *v == nil { sv = &ArchiveWaveOutput{} } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpAssociateApplications struct { } func (*awsRestjson1_deserializeOpAssociateApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAssociateApplications) 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_deserializeOpErrorAssociateApplications(response, &metadata) } output := &AssociateApplicationsOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorAssociateApplications(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpAssociateSourceServers struct { } func (*awsRestjson1_deserializeOpAssociateSourceServers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAssociateSourceServers) 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_deserializeOpErrorAssociateSourceServers(response, &metadata) } output := &AssociateSourceServersOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorAssociateSourceServers(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpChangeServerLifeCycleState struct { } func (*awsRestjson1_deserializeOpChangeServerLifeCycleState) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpChangeServerLifeCycleState) 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_deserializeOpErrorChangeServerLifeCycleState(response, &metadata) } output := &ChangeServerLifeCycleStateOutput{} 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_deserializeOpDocumentChangeServerLifeCycleStateOutput(&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_deserializeOpErrorChangeServerLifeCycleState(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentChangeServerLifeCycleStateOutput(v **ChangeServerLifeCycleStateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ChangeServerLifeCycleStateOutput if *v == nil { sv = &ChangeServerLifeCycleStateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateApplication struct { } func (*awsRestjson1_deserializeOpCreateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateApplication) 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_deserializeOpErrorCreateApplication(response, &metadata) } output := &CreateApplicationOutput{} 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_deserializeOpDocumentCreateApplicationOutput(&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_deserializeOpErrorCreateApplication(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("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateApplicationOutput if *v == nil { sv = &CreateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateLaunchConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpCreateLaunchConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateLaunchConfigurationTemplate) 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_deserializeOpErrorCreateLaunchConfigurationTemplate(response, &metadata) } output := &CreateLaunchConfigurationTemplateOutput{} 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_deserializeOpDocumentCreateLaunchConfigurationTemplateOutput(&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_deserializeOpErrorCreateLaunchConfigurationTemplate(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateLaunchConfigurationTemplateOutput(v **CreateLaunchConfigurationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateLaunchConfigurationTemplateOutput if *v == nil { sv = &CreateLaunchConfigurationTemplateOutput{} } 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) } case "associatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = ptr.Bool(jtv) } case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "largeVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.LargeVolumeConf, value); err != nil { return err } case "launchConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.LaunchConfigurationTemplateID = ptr.String(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "smallVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.SmallVolumeConf, value); err != nil { return err } case "smallVolumeMaxSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SmallVolumeMaxSize = i64 } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateReplicationConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpCreateReplicationConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateReplicationConfigurationTemplate) 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_deserializeOpErrorCreateReplicationConfigurationTemplate(response, &metadata) } output := &CreateReplicationConfigurationTemplateOutput{} 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_deserializeOpDocumentCreateReplicationConfigurationTemplateOutput(&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_deserializeOpErrorCreateReplicationConfigurationTemplate(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateReplicationConfigurationTemplateOutput(v **CreateReplicationConfigurationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateReplicationConfigurationTemplateOutput if *v == nil { sv = &CreateReplicationConfigurationTemplateOutput{} } 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) } case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BandwidthThrottling to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "replicationConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationTemplateID to be of type string, got %T instead", value) } sv.ReplicationConfigurationTemplateID = ptr.String(jtv) } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } case "useFipsEndpoint": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseFipsEndpoint = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateWave struct { } func (*awsRestjson1_deserializeOpCreateWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateWave) 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_deserializeOpErrorCreateWave(response, &metadata) } output := &CreateWaveOutput{} 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_deserializeOpDocumentCreateWaveOutput(&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_deserializeOpErrorCreateWave(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("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateWaveOutput(v **CreateWaveOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateWaveOutput if *v == nil { sv = &CreateWaveOutput{} } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteApplication struct { } func (*awsRestjson1_deserializeOpDeleteApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteApplication) 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_deserializeOpErrorDeleteApplication(response, &metadata) } output := &DeleteApplicationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteApplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteJob struct { } func (*awsRestjson1_deserializeOpDeleteJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteJob) 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_deserializeOpErrorDeleteJob(response, &metadata) } output := &DeleteJobOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteJob(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteLaunchConfigurationTemplate) 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_deserializeOpErrorDeleteLaunchConfigurationTemplate(response, &metadata) } output := &DeleteLaunchConfigurationTemplateOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteLaunchConfigurationTemplate(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteReplicationConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpDeleteReplicationConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteReplicationConfigurationTemplate) 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_deserializeOpErrorDeleteReplicationConfigurationTemplate(response, &metadata) } output := &DeleteReplicationConfigurationTemplateOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteReplicationConfigurationTemplate(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteSourceServer struct { } func (*awsRestjson1_deserializeOpDeleteSourceServer) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteSourceServer) 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_deserializeOpErrorDeleteSourceServer(response, &metadata) } output := &DeleteSourceServerOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteSourceServer(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteVcenterClient struct { } func (*awsRestjson1_deserializeOpDeleteVcenterClient) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteVcenterClient) 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_deserializeOpErrorDeleteVcenterClient(response, &metadata) } output := &DeleteVcenterClientOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteVcenterClient(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteWave struct { } func (*awsRestjson1_deserializeOpDeleteWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteWave) 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_deserializeOpErrorDeleteWave(response, &metadata) } output := &DeleteWaveOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteWave(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDescribeJobLogItems struct { } func (*awsRestjson1_deserializeOpDescribeJobLogItems) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeJobLogItems) 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_deserializeOpErrorDescribeJobLogItems(response, &metadata) } output := &DescribeJobLogItemsOutput{} 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_deserializeOpDocumentDescribeJobLogItemsOutput(&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_deserializeOpErrorDescribeJobLogItems(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeJobLogItemsOutput(v **DescribeJobLogItemsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeJobLogItemsOutput if *v == nil { sv = &DescribeJobLogItemsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentJobLogs(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeJobs struct { } func (*awsRestjson1_deserializeOpDescribeJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeJobs) 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_deserializeOpErrorDescribeJobs(response, &metadata) } output := &DescribeJobsOutput{} 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_deserializeOpDocumentDescribeJobsOutput(&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_deserializeOpErrorDescribeJobs(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeJobsOutput(v **DescribeJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeJobsOutput if *v == nil { sv = &DescribeJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentJobsList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeLaunchConfigurationTemplates struct { } func (*awsRestjson1_deserializeOpDescribeLaunchConfigurationTemplates) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeLaunchConfigurationTemplates) 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_deserializeOpErrorDescribeLaunchConfigurationTemplates(response, &metadata) } output := &DescribeLaunchConfigurationTemplatesOutput{} 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_deserializeOpDocumentDescribeLaunchConfigurationTemplatesOutput(&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_deserializeOpErrorDescribeLaunchConfigurationTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeLaunchConfigurationTemplatesOutput(v **DescribeLaunchConfigurationTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeLaunchConfigurationTemplatesOutput if *v == nil { sv = &DescribeLaunchConfigurationTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentLaunchConfigurationTemplates(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeReplicationConfigurationTemplates struct { } func (*awsRestjson1_deserializeOpDescribeReplicationConfigurationTemplates) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeReplicationConfigurationTemplates) 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_deserializeOpErrorDescribeReplicationConfigurationTemplates(response, &metadata) } output := &DescribeReplicationConfigurationTemplatesOutput{} 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_deserializeOpDocumentDescribeReplicationConfigurationTemplatesOutput(&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_deserializeOpErrorDescribeReplicationConfigurationTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeReplicationConfigurationTemplatesOutput(v **DescribeReplicationConfigurationTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeReplicationConfigurationTemplatesOutput if *v == nil { sv = &DescribeReplicationConfigurationTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentReplicationConfigurationTemplates(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeSourceServers struct { } func (*awsRestjson1_deserializeOpDescribeSourceServers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeSourceServers) 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_deserializeOpErrorDescribeSourceServers(response, &metadata) } output := &DescribeSourceServersOutput{} 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_deserializeOpDocumentDescribeSourceServersOutput(&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_deserializeOpErrorDescribeSourceServers(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeSourceServersOutput(v **DescribeSourceServersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeSourceServersOutput if *v == nil { sv = &DescribeSourceServersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentSourceServersList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeVcenterClients struct { } func (*awsRestjson1_deserializeOpDescribeVcenterClients) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeVcenterClients) 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_deserializeOpErrorDescribeVcenterClients(response, &metadata) } output := &DescribeVcenterClientsOutput{} 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_deserializeOpDocumentDescribeVcenterClientsOutput(&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_deserializeOpErrorDescribeVcenterClients(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeVcenterClientsOutput(v **DescribeVcenterClientsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeVcenterClientsOutput if *v == nil { sv = &DescribeVcenterClientsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentVcenterClientList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisassociateApplications struct { } func (*awsRestjson1_deserializeOpDisassociateApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateApplications) 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_deserializeOpErrorDisassociateApplications(response, &metadata) } output := &DisassociateApplicationsOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateApplications(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisassociateSourceServers struct { } func (*awsRestjson1_deserializeOpDisassociateSourceServers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateSourceServers) 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_deserializeOpErrorDisassociateSourceServers(response, &metadata) } output := &DisassociateSourceServersOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateSourceServers(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisconnectFromService struct { } func (*awsRestjson1_deserializeOpDisconnectFromService) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisconnectFromService) 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_deserializeOpErrorDisconnectFromService(response, &metadata) } output := &DisconnectFromServiceOutput{} 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_deserializeOpDocumentDisconnectFromServiceOutput(&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_deserializeOpErrorDisconnectFromService(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDisconnectFromServiceOutput(v **DisconnectFromServiceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisconnectFromServiceOutput if *v == nil { sv = &DisconnectFromServiceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpFinalizeCutover struct { } func (*awsRestjson1_deserializeOpFinalizeCutover) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpFinalizeCutover) 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_deserializeOpErrorFinalizeCutover(response, &metadata) } output := &FinalizeCutoverOutput{} 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_deserializeOpDocumentFinalizeCutoverOutput(&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_deserializeOpErrorFinalizeCutover(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentFinalizeCutoverOutput(v **FinalizeCutoverOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *FinalizeCutoverOutput if *v == nil { sv = &FinalizeCutoverOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetLaunchConfiguration struct { } func (*awsRestjson1_deserializeOpGetLaunchConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetLaunchConfiguration) 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_deserializeOpErrorGetLaunchConfiguration(response, &metadata) } output := &GetLaunchConfigurationOutput{} 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_deserializeOpDocumentGetLaunchConfigurationOutput(&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_deserializeOpErrorGetLaunchConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetLaunchConfigurationOutput(v **GetLaunchConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetLaunchConfigurationOutput if *v == nil { sv = &GetLaunchConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetReplicationConfiguration struct { } func (*awsRestjson1_deserializeOpGetReplicationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetReplicationConfiguration) 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_deserializeOpErrorGetReplicationConfiguration(response, &metadata) } output := &GetReplicationConfigurationOutput{} 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_deserializeOpDocumentGetReplicationConfigurationOutput(&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_deserializeOpErrorGetReplicationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetReplicationConfigurationOutput(v **GetReplicationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetReplicationConfigurationOutput if *v == nil { sv = &GetReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BandwidthThrottling to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "replicatedDisks": if err := awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisks(&sv.ReplicatedDisks, value); err != nil { return err } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } case "useFipsEndpoint": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseFipsEndpoint = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpInitializeService struct { } func (*awsRestjson1_deserializeOpInitializeService) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpInitializeService) 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_deserializeOpErrorInitializeService(response, &metadata) } output := &InitializeServiceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorInitializeService(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpListApplications struct { } func (*awsRestjson1_deserializeOpListApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApplications) 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_deserializeOpErrorListApplications(response, &metadata) } output := &ListApplicationsOutput{} 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_deserializeOpDocumentListApplicationsOutput(&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_deserializeOpErrorListApplications(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListApplicationsOutput if *v == nil { sv = &ListApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentApplicationsList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListExportErrors struct { } func (*awsRestjson1_deserializeOpListExportErrors) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListExportErrors) 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_deserializeOpErrorListExportErrors(response, &metadata) } output := &ListExportErrorsOutput{} 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_deserializeOpDocumentListExportErrorsOutput(&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_deserializeOpErrorListExportErrors(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListExportErrorsOutput(v **ListExportErrorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListExportErrorsOutput if *v == nil { sv = &ListExportErrorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentExportErrors(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListExports struct { } func (*awsRestjson1_deserializeOpListExports) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListExports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListExports(response, &metadata) } output := &ListExportsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListExportsOutput(&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_deserializeOpErrorListExports(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") 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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListExportsOutput(v **ListExportsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListExportsOutput if *v == nil { sv = &ListExportsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentExportsList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImportErrors struct { } func (*awsRestjson1_deserializeOpListImportErrors) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImportErrors) 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_deserializeOpErrorListImportErrors(response, &metadata) } output := &ListImportErrorsOutput{} 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_deserializeOpDocumentListImportErrorsOutput(&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_deserializeOpErrorListImportErrors(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImportErrorsOutput(v **ListImportErrorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListImportErrorsOutput if *v == nil { sv = &ListImportErrorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentImportErrors(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImports struct { } func (*awsRestjson1_deserializeOpListImports) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListImports(response, &metadata) } output := &ListImportsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListImportsOutput(&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_deserializeOpErrorListImports(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") 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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImportsOutput(v **ListImportsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListImportsOutput if *v == nil { sv = &ListImportsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentImportList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListManagedAccounts struct { } func (*awsRestjson1_deserializeOpListManagedAccounts) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListManagedAccounts) 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_deserializeOpErrorListManagedAccounts(response, &metadata) } output := &ListManagedAccountsOutput{} 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_deserializeOpDocumentListManagedAccountsOutput(&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_deserializeOpErrorListManagedAccounts(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListManagedAccountsOutput(v **ListManagedAccountsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListManagedAccountsOutput if *v == nil { sv = &ListManagedAccountsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentManagedAccounts(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSourceServerActions struct { } func (*awsRestjson1_deserializeOpListSourceServerActions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSourceServerActions) 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_deserializeOpErrorListSourceServerActions(response, &metadata) } output := &ListSourceServerActionsOutput{} 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_deserializeOpDocumentListSourceServerActionsOutput(&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_deserializeOpErrorListSourceServerActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSourceServerActionsOutput(v **ListSourceServerActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSourceServerActionsOutput if *v == nil { sv = &ListSourceServerActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentSourceServerActionDocuments(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } 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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(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_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_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTemplateActions struct { } func (*awsRestjson1_deserializeOpListTemplateActions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTemplateActions) 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_deserializeOpErrorListTemplateActions(response, &metadata) } output := &ListTemplateActionsOutput{} 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_deserializeOpDocumentListTemplateActionsOutput(&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_deserializeOpErrorListTemplateActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTemplateActionsOutput(v **ListTemplateActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTemplateActionsOutput if *v == nil { sv = &ListTemplateActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentTemplateActionDocuments(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWaves struct { } func (*awsRestjson1_deserializeOpListWaves) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWaves) 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_deserializeOpErrorListWaves(response, &metadata) } output := &ListWavesOutput{} 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_deserializeOpDocumentListWavesOutput(&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_deserializeOpErrorListWaves(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWavesOutput(v **ListWavesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListWavesOutput if *v == nil { sv = &ListWavesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "items": if err := awsRestjson1_deserializeDocumentWavesList(&sv.Items, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpMarkAsArchived struct { } func (*awsRestjson1_deserializeOpMarkAsArchived) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpMarkAsArchived) 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_deserializeOpErrorMarkAsArchived(response, &metadata) } output := &MarkAsArchivedOutput{} 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_deserializeOpDocumentMarkAsArchivedOutput(&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_deserializeOpErrorMarkAsArchived(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentMarkAsArchivedOutput(v **MarkAsArchivedOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *MarkAsArchivedOutput if *v == nil { sv = &MarkAsArchivedOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPauseReplication struct { } func (*awsRestjson1_deserializeOpPauseReplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPauseReplication) 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_deserializeOpErrorPauseReplication(response, &metadata) } output := &PauseReplicationOutput{} 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_deserializeOpDocumentPauseReplicationOutput(&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_deserializeOpErrorPauseReplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPauseReplicationOutput(v **PauseReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PauseReplicationOutput if *v == nil { sv = &PauseReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutSourceServerAction struct { } func (*awsRestjson1_deserializeOpPutSourceServerAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutSourceServerAction) 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_deserializeOpErrorPutSourceServerAction(response, &metadata) } output := &PutSourceServerActionOutput{} 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_deserializeOpDocumentPutSourceServerActionOutput(&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_deserializeOpErrorPutSourceServerAction(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutSourceServerActionOutput(v **PutSourceServerActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutSourceServerActionOutput if *v == nil { sv = &PutSourceServerActionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionName to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutTemplateAction struct { } func (*awsRestjson1_deserializeOpPutTemplateAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutTemplateAction) 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_deserializeOpErrorPutTemplateAction(response, &metadata) } output := &PutTemplateActionOutput{} 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_deserializeOpDocumentPutTemplateActionOutput(&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_deserializeOpErrorPutTemplateAction(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutTemplateActionOutput(v **PutTemplateActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutTemplateActionOutput if *v == nil { sv = &PutTemplateActionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "operatingSystem": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperatingSystemString to be of type string, got %T instead", value) } sv.OperatingSystem = ptr.String(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRemoveSourceServerAction struct { } func (*awsRestjson1_deserializeOpRemoveSourceServerAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRemoveSourceServerAction) 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_deserializeOpErrorRemoveSourceServerAction(response, &metadata) } output := &RemoveSourceServerActionOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRemoveSourceServerAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpRemoveTemplateAction struct { } func (*awsRestjson1_deserializeOpRemoveTemplateAction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRemoveTemplateAction) 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_deserializeOpErrorRemoveTemplateAction(response, &metadata) } output := &RemoveTemplateActionOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRemoveTemplateAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpResumeReplication struct { } func (*awsRestjson1_deserializeOpResumeReplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpResumeReplication) 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_deserializeOpErrorResumeReplication(response, &metadata) } output := &ResumeReplicationOutput{} 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_deserializeOpDocumentResumeReplicationOutput(&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_deserializeOpErrorResumeReplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentResumeReplicationOutput(v **ResumeReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ResumeReplicationOutput if *v == nil { sv = &ResumeReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRetryDataReplication struct { } func (*awsRestjson1_deserializeOpRetryDataReplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRetryDataReplication) 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_deserializeOpErrorRetryDataReplication(response, &metadata) } output := &RetryDataReplicationOutput{} 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_deserializeOpDocumentRetryDataReplicationOutput(&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_deserializeOpErrorRetryDataReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentRetryDataReplicationOutput(v **RetryDataReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RetryDataReplicationOutput if *v == nil { sv = &RetryDataReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartCutover struct { } func (*awsRestjson1_deserializeOpStartCutover) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartCutover) 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_deserializeOpErrorStartCutover(response, &metadata) } output := &StartCutoverOutput{} 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_deserializeOpDocumentStartCutoverOutput(&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_deserializeOpErrorStartCutover(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartCutoverOutput(v **StartCutoverOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartCutoverOutput if *v == nil { sv = &StartCutoverOutput{} } else { sv = *v } for key, value := range shape { switch key { case "job": if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartExport struct { } func (*awsRestjson1_deserializeOpStartExport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartExport) 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_deserializeOpErrorStartExport(response, &metadata) } output := &StartExportOutput{} 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_deserializeOpDocumentStartExportOutput(&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_deserializeOpErrorStartExport(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("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartExportOutput(v **StartExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartExportOutput if *v == nil { sv = &StartExportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "exportTask": if err := awsRestjson1_deserializeDocumentExportTask(&sv.ExportTask, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartImport struct { } func (*awsRestjson1_deserializeOpStartImport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartImport) 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_deserializeOpErrorStartImport(response, &metadata) } output := &StartImportOutput{} 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_deserializeOpDocumentStartImportOutput(&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_deserializeOpErrorStartImport(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartImportOutput(v **StartImportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartImportOutput if *v == nil { sv = &StartImportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "importTask": if err := awsRestjson1_deserializeDocumentImportTask(&sv.ImportTask, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartReplication struct { } func (*awsRestjson1_deserializeOpStartReplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartReplication) 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_deserializeOpErrorStartReplication(response, &metadata) } output := &StartReplicationOutput{} 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_deserializeOpDocumentStartReplicationOutput(&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_deserializeOpErrorStartReplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartReplicationOutput(v **StartReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartReplicationOutput if *v == nil { sv = &StartReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartTest struct { } func (*awsRestjson1_deserializeOpStartTest) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartTest) 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_deserializeOpErrorStartTest(response, &metadata) } output := &StartTestOutput{} 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_deserializeOpDocumentStartTestOutput(&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_deserializeOpErrorStartTest(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartTestOutput(v **StartTestOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartTestOutput if *v == nil { sv = &StartTestOutput{} } else { sv = *v } for key, value := range shape { switch key { case "job": if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStopReplication struct { } func (*awsRestjson1_deserializeOpStopReplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopReplication) 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_deserializeOpErrorStopReplication(response, &metadata) } output := &StopReplicationOutput{} 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_deserializeOpDocumentStopReplicationOutput(&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_deserializeOpErrorStopReplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStopReplicationOutput(v **StopReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StopReplicationOutput if *v == nil { sv = &StopReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = 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 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func 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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(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 } } type awsRestjson1_deserializeOpTerminateTargetInstances struct { } func (*awsRestjson1_deserializeOpTerminateTargetInstances) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTerminateTargetInstances) 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_deserializeOpErrorTerminateTargetInstances(response, &metadata) } output := &TerminateTargetInstancesOutput{} 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_deserializeOpDocumentTerminateTargetInstancesOutput(&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_deserializeOpErrorTerminateTargetInstances(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("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentTerminateTargetInstancesOutput(v **TerminateTargetInstancesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TerminateTargetInstancesOutput if *v == nil { sv = &TerminateTargetInstancesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "job": if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUnarchiveApplication struct { } func (*awsRestjson1_deserializeOpUnarchiveApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUnarchiveApplication) 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_deserializeOpErrorUnarchiveApplication(response, &metadata) } output := &UnarchiveApplicationOutput{} 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_deserializeOpDocumentUnarchiveApplicationOutput(&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_deserializeOpErrorUnarchiveApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUnarchiveApplicationOutput(v **UnarchiveApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UnarchiveApplicationOutput if *v == nil { sv = &UnarchiveApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUnarchiveWave struct { } func (*awsRestjson1_deserializeOpUnarchiveWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUnarchiveWave) 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_deserializeOpErrorUnarchiveWave(response, &metadata) } output := &UnarchiveWaveOutput{} 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_deserializeOpDocumentUnarchiveWaveOutput(&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_deserializeOpErrorUnarchiveWave(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUnarchiveWaveOutput(v **UnarchiveWaveOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UnarchiveWaveOutput if *v == nil { sv = &UnarchiveWaveOutput{} } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } 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 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func 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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(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 } } type awsRestjson1_deserializeOpUpdateApplication struct { } func (*awsRestjson1_deserializeOpUpdateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateApplication) 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_deserializeOpErrorUpdateApplication(response, &metadata) } output := &UpdateApplicationOutput{} 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_deserializeOpDocumentUpdateApplicationOutput(&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_deserializeOpErrorUpdateApplication(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(v **UpdateApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateApplicationOutput if *v == nil { sv = &UpdateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateLaunchConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateLaunchConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateLaunchConfiguration) 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_deserializeOpErrorUpdateLaunchConfiguration(response, &metadata) } output := &UpdateLaunchConfigurationOutput{} 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_deserializeOpDocumentUpdateLaunchConfigurationOutput(&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_deserializeOpErrorUpdateLaunchConfiguration(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateLaunchConfigurationOutput(v **UpdateLaunchConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateLaunchConfigurationOutput if *v == nil { sv = &UpdateLaunchConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateLaunchConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpUpdateLaunchConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateLaunchConfigurationTemplate) 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_deserializeOpErrorUpdateLaunchConfigurationTemplate(response, &metadata) } output := &UpdateLaunchConfigurationTemplateOutput{} 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_deserializeOpDocumentUpdateLaunchConfigurationTemplateOutput(&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_deserializeOpErrorUpdateLaunchConfigurationTemplate(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateLaunchConfigurationTemplateOutput(v **UpdateLaunchConfigurationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateLaunchConfigurationTemplateOutput if *v == nil { sv = &UpdateLaunchConfigurationTemplateOutput{} } 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) } case "associatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = ptr.Bool(jtv) } case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "largeVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.LargeVolumeConf, value); err != nil { return err } case "launchConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.LaunchConfigurationTemplateID = ptr.String(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "smallVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.SmallVolumeConf, value); err != nil { return err } case "smallVolumeMaxSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SmallVolumeMaxSize = i64 } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateReplicationConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateReplicationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateReplicationConfiguration) 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_deserializeOpErrorUpdateReplicationConfiguration(response, &metadata) } output := &UpdateReplicationConfigurationOutput{} 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_deserializeOpDocumentUpdateReplicationConfigurationOutput(&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_deserializeOpErrorUpdateReplicationConfiguration(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationOutput(v **UpdateReplicationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateReplicationConfigurationOutput if *v == nil { sv = &UpdateReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BandwidthThrottling to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallBoundedString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "replicatedDisks": if err := awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisks(&sv.ReplicatedDisks, value); err != nil { return err } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } case "useFipsEndpoint": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseFipsEndpoint = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateReplicationConfigurationTemplate struct { } func (*awsRestjson1_deserializeOpUpdateReplicationConfigurationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateReplicationConfigurationTemplate) 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_deserializeOpErrorUpdateReplicationConfigurationTemplate(response, &metadata) } output := &UpdateReplicationConfigurationTemplateOutput{} 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_deserializeOpDocumentUpdateReplicationConfigurationTemplateOutput(&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_deserializeOpErrorUpdateReplicationConfigurationTemplate(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationTemplateOutput(v **UpdateReplicationConfigurationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateReplicationConfigurationTemplateOutput if *v == nil { sv = &UpdateReplicationConfigurationTemplateOutput{} } 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) } case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BandwidthThrottling to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "replicationConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationTemplateID to be of type string, got %T instead", value) } sv.ReplicationConfigurationTemplateID = ptr.String(jtv) } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } case "useFipsEndpoint": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseFipsEndpoint = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateSourceServerReplicationType struct { } func (*awsRestjson1_deserializeOpUpdateSourceServerReplicationType) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateSourceServerReplicationType) 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_deserializeOpErrorUpdateSourceServerReplicationType(response, &metadata) } output := &UpdateSourceServerReplicationTypeOutput{} 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_deserializeOpDocumentUpdateSourceServerReplicationTypeOutput(&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_deserializeOpErrorUpdateSourceServerReplicationType(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateSourceServerReplicationTypeOutput(v **UpdateSourceServerReplicationTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateSourceServerReplicationTypeOutput if *v == nil { sv = &UpdateSourceServerReplicationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateWave struct { } func (*awsRestjson1_deserializeOpUpdateWave) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateWave) 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_deserializeOpErrorUpdateWave(response, &metadata) } output := &UpdateWaveOutput{} 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_deserializeOpDocumentUpdateWaveOutput(&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_deserializeOpErrorUpdateWave(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("UninitializedAccountException", errorCode): return awsRestjson1_deserializeErrorUninitializedAccountException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateWaveOutput(v **UpdateWaveOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateWaveOutput if *v == nil { sv = &UpdateWaveOutput{} } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, 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, 64) if err != nil { return err } v.RetryAfterSeconds = 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]) v.RetryAfterSeconds = ptr.String(headerValues[0]) } return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} 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_deserializeDocumentAccessDeniedException(&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_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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} 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_deserializeDocumentInternalServerException(&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_deserializeOpHttpBindingsInternalServerException(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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} 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_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func 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_deserializeErrorUninitializedAccountException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UninitializedAccountException{} 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_deserializeDocumentUninitializedAccountException(&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_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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplication(v **types.Application, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Application if *v == nil { sv = &types.Application{} } else { sv = *v } for key, value := range shape { switch key { case "applicationAggregatedStatus": if err := awsRestjson1_deserializeDocumentApplicationAggregatedStatus(&sv.ApplicationAggregatedStatus, value); err != nil { return err } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationAggregatedStatus(v **types.ApplicationAggregatedStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ApplicationAggregatedStatus if *v == nil { sv = &types.ApplicationAggregatedStatus{} } else { sv = *v } for key, value := range shape { switch key { case "healthStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationHealthStatus to be of type string, got %T instead", value) } sv.HealthStatus = types.ApplicationHealthStatus(jtv) } case "lastUpdateDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastUpdateDateTime = ptr.String(jtv) } case "progressStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationProgressStatus to be of type string, got %T instead", value) } sv.ProgressStatus = types.ApplicationProgressStatus(jtv) } case "totalSourceServers": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalSourceServers = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationsList(v *[]types.Application, 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.Application if *v == nil { cv = []types.Application{} } else { cv = *v } for _, value := range shape { var col types.Application destAddr := &col if err := awsRestjson1_deserializeDocumentApplication(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv 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 "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "errors": if err := awsRestjson1_deserializeDocumentConflictExceptionErrors(&sv.Errors, value); err != nil { return err } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString 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 LargeBoundedString 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 LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictExceptionErrors(v *[]types.ErrorDetails, 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.ErrorDetails if *v == nil { cv = []types.ErrorDetails{} } else { cv = *v } for _, value := range shape { var col types.ErrorDetails destAddr := &col if err := awsRestjson1_deserializeDocumentErrorDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCPU(v **types.CPU, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CPU if *v == nil { sv = &types.CPU{} } else { sv = *v } for key, value := range shape { switch key { case "cores": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Cores = i64 } case "modelName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ModelName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCpus(v *[]types.CPU, 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.CPU if *v == nil { cv = []types.CPU{} } else { cv = *v } for _, value := range shape { var col types.CPU destAddr := &col if err := awsRestjson1_deserializeDocumentCPU(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataReplicationError(v **types.DataReplicationError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataReplicationError if *v == nil { sv = &types.DataReplicationError{} } else { sv = *v } for key, value := range shape { switch key { case "error": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationErrorString to be of type string, got %T instead", value) } sv.Error = types.DataReplicationErrorString(jtv) } case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInfo(v **types.DataReplicationInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataReplicationInfo if *v == nil { sv = &types.DataReplicationInfo{} } else { sv = *v } for key, value := range shape { switch key { case "dataReplicationError": if err := awsRestjson1_deserializeDocumentDataReplicationError(&sv.DataReplicationError, value); err != nil { return err } case "dataReplicationInitiation": if err := awsRestjson1_deserializeDocumentDataReplicationInitiation(&sv.DataReplicationInitiation, value); err != nil { return err } case "dataReplicationState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationState to be of type string, got %T instead", value) } sv.DataReplicationState = types.DataReplicationState(jtv) } case "etaDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EtaDateTime = ptr.String(jtv) } case "lagDuration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DurationString to be of type string, got %T instead", value) } sv.LagDuration = ptr.String(jtv) } case "lastSnapshotDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastSnapshotDateTime = ptr.String(jtv) } case "replicatedDisks": if err := awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisks(&sv.ReplicatedDisks, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisk(v **types.DataReplicationInfoReplicatedDisk, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataReplicationInfoReplicatedDisk if *v == nil { sv = &types.DataReplicationInfoReplicatedDisk{} } else { sv = *v } for key, value := range shape { switch key { case "backloggedStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BackloggedStorageBytes = i64 } case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "replicatedStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ReplicatedStorageBytes = i64 } case "rescannedStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RescannedStorageBytes = i64 } case "totalStorageBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStorageBytes = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisks(v *[]types.DataReplicationInfoReplicatedDisk, 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.DataReplicationInfoReplicatedDisk if *v == nil { cv = []types.DataReplicationInfoReplicatedDisk{} } else { cv = *v } for _, value := range shape { var col types.DataReplicationInfoReplicatedDisk destAddr := &col if err := awsRestjson1_deserializeDocumentDataReplicationInfoReplicatedDisk(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataReplicationInitiation(v **types.DataReplicationInitiation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataReplicationInitiation if *v == nil { sv = &types.DataReplicationInitiation{} } else { sv = *v } for key, value := range shape { switch key { case "nextAttemptDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.NextAttemptDateTime = ptr.String(jtv) } case "startDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.StartDateTime = ptr.String(jtv) } case "steps": if err := awsRestjson1_deserializeDocumentDataReplicationInitiationSteps(&sv.Steps, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInitiationStep(v **types.DataReplicationInitiationStep, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataReplicationInitiationStep if *v == nil { sv = &types.DataReplicationInitiationStep{} } 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 DataReplicationInitiationStepName to be of type string, got %T instead", value) } sv.Name = types.DataReplicationInitiationStepName(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataReplicationInitiationStepStatus to be of type string, got %T instead", value) } sv.Status = types.DataReplicationInitiationStepStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataReplicationInitiationSteps(v *[]types.DataReplicationInitiationStep, 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.DataReplicationInitiationStep if *v == nil { cv = []types.DataReplicationInitiationStep{} } else { cv = *v } for _, value := range shape { var col types.DataReplicationInitiationStep destAddr := &col if err := awsRestjson1_deserializeDocumentDataReplicationInitiationStep(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDisk(v **types.Disk, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Disk if *v == nil { sv = &types.Disk{} } else { sv = *v } for key, value := range shape { switch key { case "bytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Bytes = i64 } case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDisks(v *[]types.Disk, 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.Disk if *v == nil { cv = []types.Disk{} } else { cv = *v } for _, value := range shape { var col types.Disk destAddr := &col if err := awsRestjson1_deserializeDocumentDisk(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentErrorDetails(v **types.ErrorDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ErrorDetails if *v == nil { sv = &types.ErrorDetails{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString 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 LargeBoundedString 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 LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportErrorData(v **types.ExportErrorData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExportErrorData if *v == nil { sv = &types.ExportErrorData{} } else { sv = *v } for key, value := range shape { switch key { case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportErrors(v *[]types.ExportTaskError, 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.ExportTaskError if *v == nil { cv = []types.ExportTaskError{} } else { cv = *v } for _, value := range shape { var col types.ExportTaskError destAddr := &col if err := awsRestjson1_deserializeDocumentExportTaskError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentExportsList(v *[]types.ExportTask, 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.ExportTask if *v == nil { cv = []types.ExportTask{} } else { cv = *v } for _, value := range shape { var col types.ExportTask destAddr := &col if err := awsRestjson1_deserializeDocumentExportTask(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentExportTask(v **types.ExportTask, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExportTask if *v == nil { sv = &types.ExportTask{} } else { sv = *v } for key, value := range shape { switch key { case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "endDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EndDateTime = ptr.String(jtv) } case "exportID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExportID to be of type string, got %T instead", value) } sv.ExportID = ptr.String(jtv) } case "progressPercentage": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ProgressPercentage = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.ProgressPercentage = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3BucketOwner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountID to be of type string, got %T instead", value) } sv.S3BucketOwner = ptr.String(jtv) } case "s3Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.S3Key = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExportStatus to be of type string, got %T instead", value) } sv.Status = types.ExportStatus(jtv) } case "summary": if err := awsRestjson1_deserializeDocumentExportTaskSummary(&sv.Summary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportTaskError(v **types.ExportTaskError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExportTaskError if *v == nil { sv = &types.ExportTaskError{} } else { sv = *v } for key, value := range shape { switch key { case "errorData": if err := awsRestjson1_deserializeDocumentExportErrorData(&sv.ErrorData, value); err != nil { return err } case "errorDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ErrorDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportTaskSummary(v **types.ExportTaskSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExportTaskSummary if *v == nil { sv = &types.ExportTaskSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationsCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationsCount = i64 } case "serversCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ServersCount = i64 } case "wavesCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.WavesCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIdentificationHints(v **types.IdentificationHints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IdentificationHints if *v == nil { sv = &types.IdentificationHints{} } else { sv = *v } for key, value := range shape { switch key { case "awsInstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.AwsInstanceID = ptr.String(jtv) } case "fqdn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Fqdn = ptr.String(jtv) } case "hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "vmPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.VmPath = ptr.String(jtv) } case "vmWareUuid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.VmWareUuid = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportErrorData(v **types.ImportErrorData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ImportErrorData if *v == nil { sv = &types.ImportErrorData{} } else { sv = *v } for key, value := range shape { switch key { case "accountID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountID to be of type string, got %T instead", value) } sv.AccountID = ptr.String(jtv) } case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } case "rowNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowNumber = i64 } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportErrors(v *[]types.ImportTaskError, 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.ImportTaskError if *v == nil { cv = []types.ImportTaskError{} } else { cv = *v } for _, value := range shape { var col types.ImportTaskError destAddr := &col if err := awsRestjson1_deserializeDocumentImportTaskError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImportList(v *[]types.ImportTask, 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.ImportTask if *v == nil { cv = []types.ImportTask{} } else { cv = *v } for _, value := range shape { var col types.ImportTask destAddr := &col if err := awsRestjson1_deserializeDocumentImportTask(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImportTask(v **types.ImportTask, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ImportTask if *v == nil { sv = &types.ImportTask{} } else { sv = *v } for key, value := range shape { switch key { case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "endDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EndDateTime = ptr.String(jtv) } case "importID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImportID to be of type string, got %T instead", value) } sv.ImportID = ptr.String(jtv) } case "progressPercentage": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ProgressPercentage = ptr.Float32(float32(f64)) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.ProgressPercentage = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } case "s3BucketSource": if err := awsRestjson1_deserializeDocumentS3BucketSource(&sv.S3BucketSource, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value) } sv.Status = types.ImportStatus(jtv) } case "summary": if err := awsRestjson1_deserializeDocumentImportTaskSummary(&sv.Summary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskError(v **types.ImportTaskError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ImportTaskError if *v == nil { sv = &types.ImportTaskError{} } else { sv = *v } for key, value := range shape { switch key { case "errorData": if err := awsRestjson1_deserializeDocumentImportErrorData(&sv.ErrorData, value); err != nil { return err } case "errorDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ErrorDateTime = ptr.String(jtv) } case "errorType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImportErrorType to be of type string, got %T instead", value) } sv.ErrorType = types.ImportErrorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummary(v **types.ImportTaskSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ImportTaskSummary if *v == nil { sv = &types.ImportTaskSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applications": if err := awsRestjson1_deserializeDocumentImportTaskSummaryApplications(&sv.Applications, value); err != nil { return err } case "servers": if err := awsRestjson1_deserializeDocumentImportTaskSummaryServers(&sv.Servers, value); err != nil { return err } case "waves": if err := awsRestjson1_deserializeDocumentImportTaskSummaryWaves(&sv.Waves, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummaryApplications(v **types.ImportTaskSummaryApplications, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ImportTaskSummaryApplications if *v == nil { sv = &types.ImportTaskSummaryApplications{} } else { sv = *v } for key, value := range shape { switch key { case "createdCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedCount = i64 } case "modifiedCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ModifiedCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummaryServers(v **types.ImportTaskSummaryServers, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ImportTaskSummaryServers if *v == nil { sv = &types.ImportTaskSummaryServers{} } else { sv = *v } for key, value := range shape { switch key { case "createdCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedCount = i64 } case "modifiedCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ModifiedCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportTaskSummaryWaves(v **types.ImportTaskSummaryWaves, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ImportTaskSummaryWaves if *v == nil { sv = &types.ImportTaskSummaryWaves{} } else { sv = *v } for key, value := range shape { switch key { case "createdCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CreatedCount = i64 } case "modifiedCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ModifiedCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InternalServerException if *v == nil { sv = &types.InternalServerException{} } 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 LargeBoundedString 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 PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIPsList(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 BoundedString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentJob(v **types.Job, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Job if *v == nil { sv = &types.Job{} } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "endDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.EndDateTime = ptr.String(jtv) } case "initiatedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InitiatedBy to be of type string, got %T instead", value) } sv.InitiatedBy = types.InitiatedBy(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } case "participatingServers": if err := awsRestjson1_deserializeDocumentParticipatingServers(&sv.ParticipatingServers, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) } sv.Status = types.JobStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobType to be of type string, got %T instead", value) } sv.Type = types.JobType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobLog(v **types.JobLog, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.JobLog if *v == nil { sv = &types.JobLog{} } else { sv = *v } for key, value := range shape { switch key { case "event": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobLogEvent to be of type string, got %T instead", value) } sv.Event = types.JobLogEvent(jtv) } case "eventData": if err := awsRestjson1_deserializeDocumentJobLogEventData(&sv.EventData, value); err != nil { return err } case "logDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LogDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobLogEventData(v **types.JobLogEventData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.JobLogEventData if *v == nil { sv = &types.JobLogEventData{} } else { sv = *v } for key, value := range shape { switch key { case "conversionServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.ConversionServerID = ptr.String(jtv) } case "rawError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RawError = ptr.String(jtv) } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "targetInstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.TargetInstanceID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobLogs(v *[]types.JobLog, 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.JobLog if *v == nil { cv = []types.JobLog{} } else { cv = *v } for _, value := range shape { var col types.JobLog destAddr := &col if err := awsRestjson1_deserializeDocumentJobLog(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentJobPostLaunchActionsLaunchStatus(v **types.JobPostLaunchActionsLaunchStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.JobPostLaunchActionsLaunchStatus if *v == nil { sv = &types.JobPostLaunchActionsLaunchStatus{} } else { sv = *v } for key, value := range shape { switch key { case "executionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ExecutionID = ptr.String(jtv) } case "executionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PostLaunchActionExecutionStatus to be of type string, got %T instead", value) } sv.ExecutionStatus = types.PostLaunchActionExecutionStatus(jtv) } case "failureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "ssmDocument": if err := awsRestjson1_deserializeDocumentSsmDocument(&sv.SsmDocument, value); err != nil { return err } case "ssmDocumentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmDocumentType to be of type string, got %T instead", value) } sv.SsmDocumentType = types.SsmDocumentType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJobsList(v *[]types.Job, 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.Job if *v == nil { cv = []types.Job{} } else { cv = *v } for _, value := range shape { var col types.Job destAddr := &col if err := awsRestjson1_deserializeDocumentJob(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLaunchConfigurationTemplate(v **types.LaunchConfigurationTemplate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LaunchConfigurationTemplate if *v == nil { sv = &types.LaunchConfigurationTemplate{} } 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) } case "associatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = ptr.Bool(jtv) } case "bootMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BootMode to be of type string, got %T instead", value) } sv.BootMode = types.BootMode(jtv) } case "copyPrivateIp": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyPrivateIp = ptr.Bool(jtv) } case "copyTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTags = ptr.Bool(jtv) } case "ec2LaunchTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.Ec2LaunchTemplateID = ptr.String(jtv) } case "enableMapAutoTagging": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableMapAutoTagging = ptr.Bool(jtv) } case "largeVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.LargeVolumeConf, value); err != nil { return err } case "launchConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchConfigurationTemplateID to be of type string, got %T instead", value) } sv.LaunchConfigurationTemplateID = ptr.String(jtv) } case "launchDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchDisposition to be of type string, got %T instead", value) } sv.LaunchDisposition = types.LaunchDisposition(jtv) } case "licensing": if err := awsRestjson1_deserializeDocumentLicensing(&sv.Licensing, value); err != nil { return err } case "mapAutoTaggingMpeID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.MapAutoTaggingMpeID = ptr.String(jtv) } case "postLaunchActions": if err := awsRestjson1_deserializeDocumentPostLaunchActions(&sv.PostLaunchActions, value); err != nil { return err } case "smallVolumeConf": if err := awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(&sv.SmallVolumeConf, value); err != nil { return err } case "smallVolumeMaxSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SmallVolumeMaxSize = i64 } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "targetInstanceTypeRightSizingMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetInstanceTypeRightSizingMethod to be of type string, got %T instead", value) } sv.TargetInstanceTypeRightSizingMethod = types.TargetInstanceTypeRightSizingMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchConfigurationTemplates(v *[]types.LaunchConfigurationTemplate, 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.LaunchConfigurationTemplate if *v == nil { cv = []types.LaunchConfigurationTemplate{} } else { cv = *v } for _, value := range shape { var col types.LaunchConfigurationTemplate destAddr := &col if err := awsRestjson1_deserializeDocumentLaunchConfigurationTemplate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLaunchedInstance(v **types.LaunchedInstance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LaunchedInstance if *v == nil { sv = &types.LaunchedInstance{} } else { sv = *v } for key, value := range shape { switch key { case "ec2InstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.Ec2InstanceID = ptr.String(jtv) } case "firstBoot": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FirstBoot to be of type string, got %T instead", value) } sv.FirstBoot = types.FirstBoot(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchTemplateDiskConf(v **types.LaunchTemplateDiskConf, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LaunchTemplateDiskConf if *v == nil { sv = &types.LaunchTemplateDiskConf{} } else { sv = *v } for key, value := range shape { switch key { case "iops": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Iops to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Iops = i64 } case "throughput": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Throughput to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Throughput = i64 } case "volumeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VolumeType to be of type string, got %T instead", value) } sv.VolumeType = types.VolumeType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLicensing(v **types.Licensing, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Licensing if *v == nil { sv = &types.Licensing{} } else { sv = *v } for key, value := range shape { switch key { case "osByol": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.OsByol = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycle(v **types.LifeCycle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycle if *v == nil { sv = &types.LifeCycle{} } else { sv = *v } for key, value := range shape { switch key { case "addedToServiceDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.AddedToServiceDateTime = ptr.String(jtv) } case "elapsedReplicationDuration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DurationString to be of type string, got %T instead", value) } sv.ElapsedReplicationDuration = ptr.String(jtv) } case "firstByteDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.FirstByteDateTime = ptr.String(jtv) } case "lastCutover": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutover(&sv.LastCutover, value); err != nil { return err } case "lastSeenByServiceDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastSeenByServiceDateTime = ptr.String(jtv) } case "lastTest": if err := awsRestjson1_deserializeDocumentLifeCycleLastTest(&sv.LastTest, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LifeCycleState to be of type string, got %T instead", value) } sv.State = types.LifeCycleState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutover(v **types.LifeCycleLastCutover, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastCutover if *v == nil { sv = &types.LifeCycleLastCutover{} } else { sv = *v } for key, value := range shape { switch key { case "finalized": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutoverFinalized(&sv.Finalized, value); err != nil { return err } case "initiated": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutoverInitiated(&sv.Initiated, value); err != nil { return err } case "reverted": if err := awsRestjson1_deserializeDocumentLifeCycleLastCutoverReverted(&sv.Reverted, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutoverFinalized(v **types.LifeCycleLastCutoverFinalized, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastCutoverFinalized if *v == nil { sv = &types.LifeCycleLastCutoverFinalized{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutoverInitiated(v **types.LifeCycleLastCutoverInitiated, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastCutoverInitiated if *v == nil { sv = &types.LifeCycleLastCutoverInitiated{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastCutoverReverted(v **types.LifeCycleLastCutoverReverted, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastCutoverReverted if *v == nil { sv = &types.LifeCycleLastCutoverReverted{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTest(v **types.LifeCycleLastTest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastTest if *v == nil { sv = &types.LifeCycleLastTest{} } else { sv = *v } for key, value := range shape { switch key { case "finalized": if err := awsRestjson1_deserializeDocumentLifeCycleLastTestFinalized(&sv.Finalized, value); err != nil { return err } case "initiated": if err := awsRestjson1_deserializeDocumentLifeCycleLastTestInitiated(&sv.Initiated, value); err != nil { return err } case "reverted": if err := awsRestjson1_deserializeDocumentLifeCycleLastTestReverted(&sv.Reverted, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTestFinalized(v **types.LifeCycleLastTestFinalized, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastTestFinalized if *v == nil { sv = &types.LifeCycleLastTestFinalized{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTestInitiated(v **types.LifeCycleLastTestInitiated, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastTestInitiated if *v == nil { sv = &types.LifeCycleLastTestInitiated{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } case "jobID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JobID to be of type string, got %T instead", value) } sv.JobID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLifeCycleLastTestReverted(v **types.LifeCycleLastTestReverted, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LifeCycleLastTestReverted if *v == nil { sv = &types.LifeCycleLastTestReverted{} } else { sv = *v } for key, value := range shape { switch key { case "apiCallDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ApiCallDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentManagedAccount(v **types.ManagedAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ManagedAccount if *v == nil { sv = &types.ManagedAccount{} } else { sv = *v } for key, value := range shape { switch key { case "accountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountID to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentManagedAccounts(v *[]types.ManagedAccount, 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.ManagedAccount if *v == nil { cv = []types.ManagedAccount{} } else { cv = *v } for _, value := range shape { var col types.ManagedAccount destAddr := &col if err := awsRestjson1_deserializeDocumentManagedAccount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNetworkInterface(v **types.NetworkInterface, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NetworkInterface if *v == nil { sv = &types.NetworkInterface{} } else { sv = *v } for key, value := range shape { switch key { case "ips": if err := awsRestjson1_deserializeDocumentIPsList(&sv.Ips, value); err != nil { return err } case "isPrimary": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsPrimary = ptr.Bool(jtv) } case "macAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.MacAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkInterfaces(v *[]types.NetworkInterface, 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.NetworkInterface if *v == nil { cv = []types.NetworkInterface{} } else { cv = *v } for _, value := range shape { var col types.NetworkInterface destAddr := &col if err := awsRestjson1_deserializeDocumentNetworkInterface(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOS(v **types.OS, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OS if *v == nil { sv = &types.OS{} } else { sv = *v } for key, value := range shape { switch key { case "fullString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FullString = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParticipatingServer(v **types.ParticipatingServer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParticipatingServer if *v == nil { sv = &types.ParticipatingServer{} } else { sv = *v } for key, value := range shape { switch key { case "launchedEc2InstanceID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceID to be of type string, got %T instead", value) } sv.LaunchedEc2InstanceID = ptr.String(jtv) } case "launchStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchStatus to be of type string, got %T instead", value) } sv.LaunchStatus = types.LaunchStatus(jtv) } case "postLaunchActionsStatus": if err := awsRestjson1_deserializeDocumentPostLaunchActionsStatus(&sv.PostLaunchActionsStatus, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParticipatingServers(v *[]types.ParticipatingServer, 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.ParticipatingServer if *v == nil { cv = []types.ParticipatingServer{} } else { cv = *v } for _, value := range shape { var col types.ParticipatingServer destAddr := &col if err := awsRestjson1_deserializeDocumentParticipatingServer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPostLaunchActions(v **types.PostLaunchActions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PostLaunchActions if *v == nil { sv = &types.PostLaunchActions{} } else { sv = *v } for key, value := range shape { switch key { case "cloudWatchLogGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CloudWatchLogGroupName to be of type string, got %T instead", value) } sv.CloudWatchLogGroupName = ptr.String(jtv) } case "deployment": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PostLaunchActionsDeploymentType to be of type string, got %T instead", value) } sv.Deployment = types.PostLaunchActionsDeploymentType(jtv) } case "s3LogBucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3LogBucketName to be of type string, got %T instead", value) } sv.S3LogBucket = ptr.String(jtv) } case "s3OutputKeyPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.S3OutputKeyPrefix = ptr.String(jtv) } case "ssmDocuments": if err := awsRestjson1_deserializeDocumentSsmDocuments(&sv.SsmDocuments, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPostLaunchActionsLaunchStatusList(v *[]types.JobPostLaunchActionsLaunchStatus, 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.JobPostLaunchActionsLaunchStatus if *v == nil { cv = []types.JobPostLaunchActionsLaunchStatus{} } else { cv = *v } for _, value := range shape { var col types.JobPostLaunchActionsLaunchStatus destAddr := &col if err := awsRestjson1_deserializeDocumentJobPostLaunchActionsLaunchStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPostLaunchActionsStatus(v **types.PostLaunchActionsStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PostLaunchActionsStatus if *v == nil { sv = &types.PostLaunchActionsStatus{} } else { sv = *v } for key, value := range shape { switch key { case "postLaunchActionsLaunchStatusList": if err := awsRestjson1_deserializeDocumentPostLaunchActionsLaunchStatusList(&sv.PostLaunchActionsLaunchStatusList, value); err != nil { return err } case "ssmAgentDiscoveryDatetime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.SsmAgentDiscoveryDatetime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisk(v **types.ReplicationConfigurationReplicatedDisk, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationConfigurationReplicatedDisk if *v == nil { sv = &types.ReplicationConfigurationReplicatedDisk{} } 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 BoundedString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "iops": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Iops = i64 } case "isBootDisk": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsBootDisk = ptr.Bool(jtv) } case "stagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationReplicatedDiskStagingDiskType to be of type string, got %T instead", value) } sv.StagingDiskType = types.ReplicationConfigurationReplicatedDiskStagingDiskType(jtv) } case "throughput": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Throughput = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisks(v *[]types.ReplicationConfigurationReplicatedDisk, 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.ReplicationConfigurationReplicatedDisk if *v == nil { cv = []types.ReplicationConfigurationReplicatedDisk{} } else { cv = *v } for _, value := range shape { var col types.ReplicationConfigurationReplicatedDisk destAddr := &col if err := awsRestjson1_deserializeDocumentReplicationConfigurationReplicatedDisk(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationTemplate(v **types.ReplicationConfigurationTemplate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationConfigurationTemplate if *v == nil { sv = &types.ReplicationConfigurationTemplate{} } 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) } case "associateDefaultSecurityGroup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BandwidthThrottling to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BandwidthThrottling = i64 } case "createPublicIP": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CreatePublicIP = ptr.Bool(jtv) } case "dataPlaneRouting": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDataPlaneRouting to be of type string, got %T instead", value) } sv.DataPlaneRouting = types.ReplicationConfigurationDataPlaneRouting(jtv) } case "defaultLargeStagingDiskType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationDefaultLargeStagingDiskType to be of type string, got %T instead", value) } sv.DefaultLargeStagingDiskType = types.ReplicationConfigurationDefaultLargeStagingDiskType(jtv) } case "ebsEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationEbsEncryption to be of type string, got %T instead", value) } sv.EbsEncryption = types.ReplicationConfigurationEbsEncryption(jtv) } case "ebsEncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } sv.EbsEncryptionKeyArn = ptr.String(jtv) } case "replicationConfigurationTemplateID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationConfigurationTemplateID to be of type string, got %T instead", value) } sv.ReplicationConfigurationTemplateID = ptr.String(jtv) } case "replicationServerInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.ReplicationServerInstanceType = ptr.String(jtv) } case "replicationServersSecurityGroupsIDs": if err := awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(&sv.ReplicationServersSecurityGroupsIDs, value); err != nil { return err } case "stagingAreaSubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetID to be of type string, got %T instead", value) } sv.StagingAreaSubnetId = ptr.String(jtv) } case "stagingAreaTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.StagingAreaTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "useDedicatedReplicationServer": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseDedicatedReplicationServer = ptr.Bool(jtv) } case "useFipsEndpoint": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseFipsEndpoint = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReplicationConfigurationTemplates(v *[]types.ReplicationConfigurationTemplate, 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.ReplicationConfigurationTemplate if *v == nil { cv = []types.ReplicationConfigurationTemplate{} } else { cv = *v } for _, value := range shape { var col types.ReplicationConfigurationTemplate destAddr := &col if err := awsRestjson1_deserializeDocumentReplicationConfigurationTemplate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentReplicationServersSecurityGroupsIDs(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_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString 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 LargeBoundedString 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 LargeBoundedString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3BucketSource(v **types.S3BucketSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3BucketSource if *v == nil { sv = &types.S3BucketSource{} } else { sv = *v } for key, value := range shape { switch key { case "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3BucketOwner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountID to be of type string, got %T instead", value) } sv.S3BucketOwner = ptr.String(jtv) } case "s3Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.S3Key = ptr.String(jtv) } 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 "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString 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 LargeBoundedString to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "quotaValue": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.QuotaValue = int32(i64) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString 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 LargeBoundedString 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 LargeBoundedString to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceProperties(v **types.SourceProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SourceProperties if *v == nil { sv = &types.SourceProperties{} } else { sv = *v } for key, value := range shape { switch key { case "cpus": if err := awsRestjson1_deserializeDocumentCpus(&sv.Cpus, value); err != nil { return err } case "disks": if err := awsRestjson1_deserializeDocumentDisks(&sv.Disks, value); err != nil { return err } case "identificationHints": if err := awsRestjson1_deserializeDocumentIdentificationHints(&sv.IdentificationHints, value); err != nil { return err } case "lastUpdatedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastUpdatedDateTime = ptr.String(jtv) } case "networkInterfaces": if err := awsRestjson1_deserializeDocumentNetworkInterfaces(&sv.NetworkInterfaces, value); err != nil { return err } case "os": if err := awsRestjson1_deserializeDocumentOS(&sv.Os, value); err != nil { return err } case "ramBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RamBytes = i64 } case "recommendedInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) } sv.RecommendedInstanceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceServer(v **types.SourceServer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SourceServer if *v == nil { sv = &types.SourceServer{} } else { sv = *v } for key, value := range shape { switch key { case "applicationID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationID to be of type string, got %T instead", value) } sv.ApplicationID = ptr.String(jtv) } 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) } case "dataReplicationInfo": if err := awsRestjson1_deserializeDocumentDataReplicationInfo(&sv.DataReplicationInfo, value); err != nil { return err } case "fqdnForActionFramework": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.FqdnForActionFramework = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "launchedInstance": if err := awsRestjson1_deserializeDocumentLaunchedInstance(&sv.LaunchedInstance, value); err != nil { return err } case "lifeCycle": if err := awsRestjson1_deserializeDocumentLifeCycle(&sv.LifeCycle, value); err != nil { return err } case "replicationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationType to be of type string, got %T instead", value) } sv.ReplicationType = types.ReplicationType(jtv) } case "sourceProperties": if err := awsRestjson1_deserializeDocumentSourceProperties(&sv.SourceProperties, value); err != nil { return err } case "sourceServerID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceServerID to be of type string, got %T instead", value) } sv.SourceServerID = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "userProvidedID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.UserProvidedID = ptr.String(jtv) } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceServerActionDocument(v **types.SourceServerActionDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SourceServerActionDocument if *v == nil { sv = &types.SourceServerActionDocument{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionName to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceServerActionDocuments(v *[]types.SourceServerActionDocument, 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.SourceServerActionDocument if *v == nil { cv = []types.SourceServerActionDocument{} } else { cv = *v } for _, value := range shape { var col types.SourceServerActionDocument destAddr := &col if err := awsRestjson1_deserializeDocumentSourceServerActionDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSourceServersList(v *[]types.SourceServer, 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.SourceServer if *v == nil { cv = []types.SourceServer{} } else { cv = *v } for _, value := range shape { var col types.SourceServer destAddr := &col if err := awsRestjson1_deserializeDocumentSourceServer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSsmDocument(v **types.SsmDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SsmDocument if *v == nil { sv = &types.SsmDocument{} } else { sv = *v } for key, value := range shape { switch key { case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "ssmDocumentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmDocumentName to be of type string, got %T instead", value) } sv.SsmDocumentName = ptr.String(jtv) } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(v *map[string]types.SsmExternalParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]types.SsmExternalParameter if *v == nil { mv = map[string]types.SsmExternalParameter{} } else { mv = *v } for key, value := range shape { var parsedVal types.SsmExternalParameter mapVar := parsedVal if err := awsRestjson1_deserializeDocumentSsmExternalParameter(&mapVar, value); err != nil { return err } parsedVal = mapVar mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentSsmDocumentParameters(v *map[string][]types.SsmParameterStoreParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string][]types.SsmParameterStoreParameter if *v == nil { mv = map[string][]types.SsmParameterStoreParameter{} } else { mv = *v } for key, value := range shape { var parsedVal []types.SsmParameterStoreParameter mapVar := parsedVal if err := awsRestjson1_deserializeDocumentSsmParameterStoreParameters(&mapVar, value); err != nil { return err } parsedVal = mapVar mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentSsmDocuments(v *[]types.SsmDocument, 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.SsmDocument if *v == nil { cv = []types.SsmDocument{} } else { cv = *v } for _, value := range shape { var col types.SsmDocument destAddr := &col if err := awsRestjson1_deserializeDocumentSsmDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSsmExternalParameter(v *types.SsmExternalParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %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.SsmExternalParameter loop: for key, value := range shape { if value == nil { continue } switch key { case "dynamicPath": var mv string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JmesPathString to be of type string, got %T instead", value) } mv = jtv } uv = &types.SsmExternalParameterMemberDynamicPath{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentSsmParameterStoreParameter(v **types.SsmParameterStoreParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SsmParameterStoreParameter if *v == nil { sv = &types.SsmParameterStoreParameter{} } else { sv = *v } for key, value := range shape { switch key { case "parameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmParameterStoreParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } case "parameterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SsmParameterStoreParameterType to be of type string, got %T instead", value) } sv.ParameterType = types.SsmParameterStoreParameterType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSsmParameterStoreParameters(v *[]types.SsmParameterStoreParameter, 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.SsmParameterStoreParameter if *v == nil { cv = []types.SsmParameterStoreParameter{} } else { cv = *v } for _, value := range shape { var col types.SsmParameterStoreParameter destAddr := &col if err := awsRestjson1_deserializeDocumentSsmParameterStoreParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTagsMap(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_deserializeDocumentTemplateActionDocument(v **types.TemplateActionDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemplateActionDocument if *v == nil { sv = &types.TemplateActionDocument{} } else { sv = *v } for key, value := range shape { switch key { case "actionID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionID to be of type string, got %T instead", value) } sv.ActionID = ptr.String(jtv) } case "actionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = ptr.Bool(jtv) } case "category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionCategory to be of type string, got %T instead", value) } sv.Category = types.ActionCategory(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "documentIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DocumentIdentifier = ptr.String(jtv) } case "documentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) } sv.DocumentVersion = ptr.String(jtv) } case "externalParameters": if err := awsRestjson1_deserializeDocumentSsmDocumentExternalParameters(&sv.ExternalParameters, value); err != nil { return err } case "mustSucceedForCutover": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MustSucceedForCutover = ptr.Bool(jtv) } case "operatingSystem": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OperatingSystemString to be of type string, got %T instead", value) } sv.OperatingSystem = ptr.String(jtv) } case "order": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OrderType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Order = int32(i64) } case "parameters": if err := awsRestjson1_deserializeDocumentSsmDocumentParameters(&sv.Parameters, value); err != nil { return err } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StrictlyPositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateActionDocuments(v *[]types.TemplateActionDocument, 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.TemplateActionDocument if *v == nil { cv = []types.TemplateActionDocument{} } else { cv = *v } for _, value := range shape { var col types.TemplateActionDocument destAddr := &col if err := awsRestjson1_deserializeDocumentTemplateActionDocument(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv 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 LargeBoundedString 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 LargeBoundedString to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.RetryAfterSeconds = ptr.String(jtv) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUninitializedAccountException(v **types.UninitializedAccountException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UninitializedAccountException if *v == nil { sv = &types.UninitializedAccountException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Message = 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 "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LargeBoundedString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } 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 LargeBoundedString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.ValidationExceptionReason(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 LargeBoundedString 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 LargeBoundedString 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 } func awsRestjson1_deserializeDocumentVcenterClient(v **types.VcenterClient, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VcenterClient if *v == nil { sv = &types.VcenterClient{} } 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) } case "datacenterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.DatacenterName = ptr.String(jtv) } case "hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "lastSeenDatetime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastSeenDatetime = ptr.String(jtv) } case "sourceServerTags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.SourceServerTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "vcenterClientID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VcenterClientID to be of type string, got %T instead", value) } sv.VcenterClientID = ptr.String(jtv) } case "vcenterUUID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoundedString to be of type string, got %T instead", value) } sv.VcenterUUID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVcenterClientList(v *[]types.VcenterClient, 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.VcenterClient if *v == nil { cv = []types.VcenterClient{} } else { cv = *v } for _, value := range shape { var col types.VcenterClient destAddr := &col if err := awsRestjson1_deserializeDocumentVcenterClient(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWave(v **types.Wave, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Wave if *v == nil { sv = &types.Wave{} } 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) } case "creationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "isArchived": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsArchived = ptr.Bool(jtv) } case "lastModifiedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastModifiedDateTime = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { return err } case "waveAggregatedStatus": if err := awsRestjson1_deserializeDocumentWaveAggregatedStatus(&sv.WaveAggregatedStatus, value); err != nil { return err } case "waveID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveID to be of type string, got %T instead", value) } sv.WaveID = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWaveAggregatedStatus(v **types.WaveAggregatedStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WaveAggregatedStatus if *v == nil { sv = &types.WaveAggregatedStatus{} } else { sv = *v } for key, value := range shape { switch key { case "healthStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveHealthStatus to be of type string, got %T instead", value) } sv.HealthStatus = types.WaveHealthStatus(jtv) } case "lastUpdateDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.LastUpdateDateTime = ptr.String(jtv) } case "progressStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WaveProgressStatus to be of type string, got %T instead", value) } sv.ProgressStatus = types.WaveProgressStatus(jtv) } case "replicationStartedDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ISO8601DatetimeString to be of type string, got %T instead", value) } sv.ReplicationStartedDateTime = ptr.String(jtv) } case "totalApplications": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalApplications = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWavesList(v *[]types.Wave, 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.Wave if *v == nil { cv = []types.Wave{} } else { cv = *v } for _, value := range shape { var col types.Wave destAddr := &col if err := awsRestjson1_deserializeDocumentWave(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil }