// Code generated by smithy-go-codegen DO NOT EDIT. package inspector2 import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/inspector2/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "math" "strconv" "strings" ) type awsRestjson1_deserializeOpAssociateMember struct { } func (*awsRestjson1_deserializeOpAssociateMember) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAssociateMember) 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_deserializeOpErrorAssociateMember(response, &metadata) } output := &AssociateMemberOutput{} 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_deserializeOpDocumentAssociateMemberOutput(&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_deserializeOpErrorAssociateMember(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("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_deserializeOpDocumentAssociateMemberOutput(v **AssociateMemberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *AssociateMemberOutput if *v == nil { sv = &AssociateMemberOutput{} } 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 } type awsRestjson1_deserializeOpBatchGetAccountStatus struct { } func (*awsRestjson1_deserializeOpBatchGetAccountStatus) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchGetAccountStatus) 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_deserializeOpErrorBatchGetAccountStatus(response, &metadata) } output := &BatchGetAccountStatusOutput{} 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_deserializeOpDocumentBatchGetAccountStatusOutput(&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_deserializeOpErrorBatchGetAccountStatus(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_deserializeOpDocumentBatchGetAccountStatusOutput(v **BatchGetAccountStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchGetAccountStatusOutput if *v == nil { sv = &BatchGetAccountStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accounts": if err := awsRestjson1_deserializeDocumentAccountStateList(&sv.Accounts, value); err != nil { return err } case "failedAccounts": if err := awsRestjson1_deserializeDocumentFailedAccountList(&sv.FailedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchGetCodeSnippet struct { } func (*awsRestjson1_deserializeOpBatchGetCodeSnippet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchGetCodeSnippet) 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_deserializeOpErrorBatchGetCodeSnippet(response, &metadata) } output := &BatchGetCodeSnippetOutput{} 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_deserializeOpDocumentBatchGetCodeSnippetOutput(&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_deserializeOpErrorBatchGetCodeSnippet(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("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_deserializeOpDocumentBatchGetCodeSnippetOutput(v **BatchGetCodeSnippetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchGetCodeSnippetOutput if *v == nil { sv = &BatchGetCodeSnippetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "codeSnippetResults": if err := awsRestjson1_deserializeDocumentCodeSnippetResultList(&sv.CodeSnippetResults, value); err != nil { return err } case "errors": if err := awsRestjson1_deserializeDocumentCodeSnippetErrorList(&sv.Errors, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchGetFreeTrialInfo struct { } func (*awsRestjson1_deserializeOpBatchGetFreeTrialInfo) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchGetFreeTrialInfo) 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_deserializeOpErrorBatchGetFreeTrialInfo(response, &metadata) } output := &BatchGetFreeTrialInfoOutput{} 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_deserializeOpDocumentBatchGetFreeTrialInfoOutput(&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_deserializeOpErrorBatchGetFreeTrialInfo(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("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_deserializeOpDocumentBatchGetFreeTrialInfoOutput(v **BatchGetFreeTrialInfoOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchGetFreeTrialInfoOutput if *v == nil { sv = &BatchGetFreeTrialInfoOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accounts": if err := awsRestjson1_deserializeDocumentFreeTrialAccountInfoList(&sv.Accounts, value); err != nil { return err } case "failedAccounts": if err := awsRestjson1_deserializeDocumentFreeTrialInfoErrorList(&sv.FailedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchGetMemberEc2DeepInspectionStatus struct { } func (*awsRestjson1_deserializeOpBatchGetMemberEc2DeepInspectionStatus) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchGetMemberEc2DeepInspectionStatus) 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_deserializeOpErrorBatchGetMemberEc2DeepInspectionStatus(response, &metadata) } output := &BatchGetMemberEc2DeepInspectionStatusOutput{} 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_deserializeOpDocumentBatchGetMemberEc2DeepInspectionStatusOutput(&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_deserializeOpErrorBatchGetMemberEc2DeepInspectionStatus(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("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_deserializeOpDocumentBatchGetMemberEc2DeepInspectionStatusOutput(v **BatchGetMemberEc2DeepInspectionStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchGetMemberEc2DeepInspectionStatusOutput if *v == nil { sv = &BatchGetMemberEc2DeepInspectionStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accountIds": if err := awsRestjson1_deserializeDocumentMemberAccountEc2DeepInspectionStatusStateList(&sv.AccountIds, value); err != nil { return err } case "failedAccountIds": if err := awsRestjson1_deserializeDocumentFailedMemberAccountEc2DeepInspectionStatusStateList(&sv.FailedAccountIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchUpdateMemberEc2DeepInspectionStatus struct { } func (*awsRestjson1_deserializeOpBatchUpdateMemberEc2DeepInspectionStatus) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchUpdateMemberEc2DeepInspectionStatus) 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_deserializeOpErrorBatchUpdateMemberEc2DeepInspectionStatus(response, &metadata) } output := &BatchUpdateMemberEc2DeepInspectionStatusOutput{} 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_deserializeOpDocumentBatchUpdateMemberEc2DeepInspectionStatusOutput(&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_deserializeOpErrorBatchUpdateMemberEc2DeepInspectionStatus(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("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_deserializeOpDocumentBatchUpdateMemberEc2DeepInspectionStatusOutput(v **BatchUpdateMemberEc2DeepInspectionStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchUpdateMemberEc2DeepInspectionStatusOutput if *v == nil { sv = &BatchUpdateMemberEc2DeepInspectionStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accountIds": if err := awsRestjson1_deserializeDocumentMemberAccountEc2DeepInspectionStatusStateList(&sv.AccountIds, value); err != nil { return err } case "failedAccountIds": if err := awsRestjson1_deserializeDocumentFailedMemberAccountEc2DeepInspectionStatusStateList(&sv.FailedAccountIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCancelFindingsReport struct { } func (*awsRestjson1_deserializeOpCancelFindingsReport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelFindingsReport) 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_deserializeOpErrorCancelFindingsReport(response, &metadata) } output := &CancelFindingsReportOutput{} 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_deserializeOpDocumentCancelFindingsReportOutput(&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_deserializeOpErrorCancelFindingsReport(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_deserializeOpDocumentCancelFindingsReportOutput(v **CancelFindingsReportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CancelFindingsReportOutput if *v == nil { sv = &CancelFindingsReportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "reportId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) } sv.ReportId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCancelSbomExport struct { } func (*awsRestjson1_deserializeOpCancelSbomExport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelSbomExport) 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_deserializeOpErrorCancelSbomExport(response, &metadata) } output := &CancelSbomExportOutput{} 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_deserializeOpDocumentCancelSbomExportOutput(&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_deserializeOpErrorCancelSbomExport(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_deserializeOpDocumentCancelSbomExportOutput(v **CancelSbomExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CancelSbomExportOutput if *v == nil { sv = &CancelSbomExportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "reportId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) } sv.ReportId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateFilter struct { } func (*awsRestjson1_deserializeOpCreateFilter) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateFilter) 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_deserializeOpErrorCreateFilter(response, &metadata) } output := &CreateFilterOutput{} 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_deserializeOpDocumentCreateFilterOutput(&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_deserializeOpErrorCreateFilter(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateFilterOutput(v **CreateFilterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateFilterOutput if *v == nil { sv = &CreateFilterOutput{} } 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 FilterArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateFindingsReport struct { } func (*awsRestjson1_deserializeOpCreateFindingsReport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateFindingsReport) 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_deserializeOpErrorCreateFindingsReport(response, &metadata) } output := &CreateFindingsReportOutput{} 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_deserializeOpDocumentCreateFindingsReportOutput(&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_deserializeOpErrorCreateFindingsReport(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_deserializeOpDocumentCreateFindingsReportOutput(v **CreateFindingsReportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateFindingsReportOutput if *v == nil { sv = &CreateFindingsReportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "reportId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) } sv.ReportId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateSbomExport struct { } func (*awsRestjson1_deserializeOpCreateSbomExport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateSbomExport) 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_deserializeOpErrorCreateSbomExport(response, &metadata) } output := &CreateSbomExportOutput{} 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_deserializeOpDocumentCreateSbomExportOutput(&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_deserializeOpErrorCreateSbomExport(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_deserializeOpDocumentCreateSbomExportOutput(v **CreateSbomExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateSbomExportOutput if *v == nil { sv = &CreateSbomExportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "reportId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) } sv.ReportId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteFilter struct { } func (*awsRestjson1_deserializeOpDeleteFilter) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteFilter) 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_deserializeOpErrorDeleteFilter(response, &metadata) } output := &DeleteFilterOutput{} 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_deserializeOpDocumentDeleteFilterOutput(&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_deserializeOpErrorDeleteFilter(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_deserializeOpDocumentDeleteFilterOutput(v **DeleteFilterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteFilterOutput if *v == nil { sv = &DeleteFilterOutput{} } 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 FilterArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeOrganizationConfiguration struct { } func (*awsRestjson1_deserializeOpDescribeOrganizationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) 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_deserializeOpErrorDescribeOrganizationConfiguration(response, &metadata) } output := &DescribeOrganizationConfigurationOutput{} 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_deserializeOpDocumentDescribeOrganizationConfigurationOutput(&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_deserializeOpErrorDescribeOrganizationConfiguration(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("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_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v **DescribeOrganizationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeOrganizationConfigurationOutput if *v == nil { sv = &DescribeOrganizationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "autoEnable": if err := awsRestjson1_deserializeDocumentAutoEnable(&sv.AutoEnable, value); err != nil { return err } case "maxAccountLimitReached": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MaxAccountLimitReached = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisable struct { } func (*awsRestjson1_deserializeOpDisable) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisable) 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_deserializeOpErrorDisable(response, &metadata) } output := &DisableOutput{} 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_deserializeOpDocumentDisableOutput(&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_deserializeOpErrorDisable(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_deserializeOpDocumentDisableOutput(v **DisableOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisableOutput if *v == nil { sv = &DisableOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accounts": if err := awsRestjson1_deserializeDocumentAccountList(&sv.Accounts, value); err != nil { return err } case "failedAccounts": if err := awsRestjson1_deserializeDocumentFailedAccountList(&sv.FailedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisableDelegatedAdminAccount struct { } func (*awsRestjson1_deserializeOpDisableDelegatedAdminAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisableDelegatedAdminAccount) 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_deserializeOpErrorDisableDelegatedAdminAccount(response, &metadata) } output := &DisableDelegatedAdminAccountOutput{} 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_deserializeOpDocumentDisableDelegatedAdminAccountOutput(&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_deserializeOpErrorDisableDelegatedAdminAccount(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("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_deserializeOpDocumentDisableDelegatedAdminAccountOutput(v **DisableDelegatedAdminAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisableDelegatedAdminAccountOutput if *v == nil { sv = &DisableDelegatedAdminAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "delegatedAdminAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.DelegatedAdminAccountId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDisassociateMember struct { } func (*awsRestjson1_deserializeOpDisassociateMember) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateMember) 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_deserializeOpErrorDisassociateMember(response, &metadata) } output := &DisassociateMemberOutput{} 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_deserializeOpDocumentDisassociateMemberOutput(&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_deserializeOpErrorDisassociateMember(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("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_deserializeOpDocumentDisassociateMemberOutput(v **DisassociateMemberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisassociateMemberOutput if *v == nil { sv = &DisassociateMemberOutput{} } 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 } type awsRestjson1_deserializeOpEnable struct { } func (*awsRestjson1_deserializeOpEnable) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnable) 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_deserializeOpErrorEnable(response, &metadata) } output := &EnableOutput{} 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_deserializeOpDocumentEnableOutput(&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_deserializeOpErrorEnable(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_deserializeOpDocumentEnableOutput(v **EnableOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableOutput if *v == nil { sv = &EnableOutput{} } else { sv = *v } for key, value := range shape { switch key { case "accounts": if err := awsRestjson1_deserializeDocumentAccountList(&sv.Accounts, value); err != nil { return err } case "failedAccounts": if err := awsRestjson1_deserializeDocumentFailedAccountList(&sv.FailedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpEnableDelegatedAdminAccount struct { } func (*awsRestjson1_deserializeOpEnableDelegatedAdminAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnableDelegatedAdminAccount) 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_deserializeOpErrorEnableDelegatedAdminAccount(response, &metadata) } output := &EnableDelegatedAdminAccountOutput{} 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_deserializeOpDocumentEnableDelegatedAdminAccountOutput(&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_deserializeOpErrorEnableDelegatedAdminAccount(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("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_deserializeOpDocumentEnableDelegatedAdminAccountOutput(v **EnableDelegatedAdminAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableDelegatedAdminAccountOutput if *v == nil { sv = &EnableDelegatedAdminAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "delegatedAdminAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.DelegatedAdminAccountId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetConfiguration struct { } func (*awsRestjson1_deserializeOpGetConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetConfiguration) 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_deserializeOpErrorGetConfiguration(response, &metadata) } output := &GetConfigurationOutput{} 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_deserializeOpDocumentGetConfigurationOutput(&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_deserializeOpErrorGetConfiguration(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("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) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetConfigurationOutput(v **GetConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetConfigurationOutput if *v == nil { sv = &GetConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ecrConfiguration": if err := awsRestjson1_deserializeDocumentEcrConfigurationState(&sv.EcrConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetDelegatedAdminAccount struct { } func (*awsRestjson1_deserializeOpGetDelegatedAdminAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetDelegatedAdminAccount) 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_deserializeOpErrorGetDelegatedAdminAccount(response, &metadata) } output := &GetDelegatedAdminAccountOutput{} 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_deserializeOpDocumentGetDelegatedAdminAccountOutput(&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_deserializeOpErrorGetDelegatedAdminAccount(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_deserializeOpDocumentGetDelegatedAdminAccountOutput(v **GetDelegatedAdminAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDelegatedAdminAccountOutput if *v == nil { sv = &GetDelegatedAdminAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "delegatedAdmin": if err := awsRestjson1_deserializeDocumentDelegatedAdmin(&sv.DelegatedAdmin, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration struct { } func (*awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetEc2DeepInspectionConfiguration) 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_deserializeOpErrorGetEc2DeepInspectionConfiguration(response, &metadata) } output := &GetEc2DeepInspectionConfigurationOutput{} 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_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(&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_deserializeOpErrorGetEc2DeepInspectionConfiguration(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) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetEc2DeepInspectionConfigurationOutput(v **GetEc2DeepInspectionConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetEc2DeepInspectionConfigurationOutput if *v == nil { sv = &GetEc2DeepInspectionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "orgPackagePaths": if err := awsRestjson1_deserializeDocumentPathList(&sv.OrgPackagePaths, value); err != nil { return err } case "packagePaths": if err := awsRestjson1_deserializeDocumentPathList(&sv.PackagePaths, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Ec2DeepInspectionStatus to be of type string, got %T instead", value) } sv.Status = types.Ec2DeepInspectionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetEncryptionKey struct { } func (*awsRestjson1_deserializeOpGetEncryptionKey) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetEncryptionKey) 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_deserializeOpErrorGetEncryptionKey(response, &metadata) } output := &GetEncryptionKeyOutput{} 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_deserializeOpDocumentGetEncryptionKeyOutput(&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_deserializeOpErrorGetEncryptionKey(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_deserializeOpDocumentGetEncryptionKeyOutput(v **GetEncryptionKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetEncryptionKeyOutput if *v == nil { sv = &GetEncryptionKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetFindingsReportStatus struct { } func (*awsRestjson1_deserializeOpGetFindingsReportStatus) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetFindingsReportStatus) 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_deserializeOpErrorGetFindingsReportStatus(response, &metadata) } output := &GetFindingsReportStatusOutput{} 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_deserializeOpDocumentGetFindingsReportStatusOutput(&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_deserializeOpErrorGetFindingsReportStatus(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_deserializeOpDocumentGetFindingsReportStatusOutput(v **GetFindingsReportStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetFindingsReportStatusOutput if *v == nil { sv = &GetFindingsReportStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { case "destination": if err := awsRestjson1_deserializeDocumentDestination(&sv.Destination, value); err != nil { return err } case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportingErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.ReportingErrorCode(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "filterCriteria": if err := awsRestjson1_deserializeDocumentFilterCriteria(&sv.FilterCriteria, value); err != nil { return err } case "reportId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) } sv.ReportId = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExternalReportStatus to be of type string, got %T instead", value) } sv.Status = types.ExternalReportStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetMember struct { } func (*awsRestjson1_deserializeOpGetMember) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetMember) 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_deserializeOpErrorGetMember(response, &metadata) } output := &GetMemberOutput{} 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_deserializeOpDocumentGetMemberOutput(&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_deserializeOpErrorGetMember(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_deserializeOpDocumentGetMemberOutput(v **GetMemberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMemberOutput if *v == nil { sv = &GetMemberOutput{} } else { sv = *v } for key, value := range shape { switch key { case "member": if err := awsRestjson1_deserializeDocumentMember(&sv.Member, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetSbomExport struct { } func (*awsRestjson1_deserializeOpGetSbomExport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetSbomExport) 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_deserializeOpErrorGetSbomExport(response, &metadata) } output := &GetSbomExportOutput{} 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_deserializeOpDocumentGetSbomExportOutput(&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_deserializeOpErrorGetSbomExport(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_deserializeOpDocumentGetSbomExportOutput(v **GetSbomExportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetSbomExportOutput if *v == nil { sv = &GetSbomExportOutput{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportingErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.ReportingErrorCode(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "filterCriteria": if err := awsRestjson1_deserializeDocumentResourceFilterCriteria(&sv.FilterCriteria, value); err != nil { return err } case "format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SbomReportFormat to be of type string, got %T instead", value) } sv.Format = types.SbomReportFormat(jtv) } case "reportId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) } sv.ReportId = ptr.String(jtv) } case "s3Destination": if err := awsRestjson1_deserializeDocumentDestination(&sv.S3Destination, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExternalReportStatus to be of type string, got %T instead", value) } sv.Status = types.ExternalReportStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAccountPermissions struct { } func (*awsRestjson1_deserializeOpListAccountPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAccountPermissions) 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_deserializeOpErrorListAccountPermissions(response, &metadata) } output := &ListAccountPermissionsOutput{} 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_deserializeOpDocumentListAccountPermissionsOutput(&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_deserializeOpErrorListAccountPermissions(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("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_deserializeOpDocumentListAccountPermissionsOutput(v **ListAccountPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAccountPermissionsOutput if *v == nil { sv = &ListAccountPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "permissions": if err := awsRestjson1_deserializeDocumentPermissions(&sv.Permissions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListCoverage struct { } func (*awsRestjson1_deserializeOpListCoverage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListCoverage) 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_deserializeOpErrorListCoverage(response, &metadata) } output := &ListCoverageOutput{} 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_deserializeOpDocumentListCoverageOutput(&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_deserializeOpErrorListCoverage(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentListCoverageOutput(v **ListCoverageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListCoverageOutput if *v == nil { sv = &ListCoverageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "coveredResources": if err := awsRestjson1_deserializeDocumentCoveredResources(&sv.CoveredResources, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListCoverageStatistics struct { } func (*awsRestjson1_deserializeOpListCoverageStatistics) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListCoverageStatistics) 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_deserializeOpErrorListCoverageStatistics(response, &metadata) } output := &ListCoverageStatisticsOutput{} 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_deserializeOpDocumentListCoverageStatisticsOutput(&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_deserializeOpErrorListCoverageStatistics(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentListCoverageStatisticsOutput(v **ListCoverageStatisticsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListCoverageStatisticsOutput if *v == nil { sv = &ListCoverageStatisticsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "countsByGroup": if err := awsRestjson1_deserializeDocumentCountsList(&sv.CountsByGroup, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "totalCounts": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalCounts = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDelegatedAdminAccounts struct { } func (*awsRestjson1_deserializeOpListDelegatedAdminAccounts) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDelegatedAdminAccounts) 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_deserializeOpErrorListDelegatedAdminAccounts(response, &metadata) } output := &ListDelegatedAdminAccountsOutput{} 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_deserializeOpDocumentListDelegatedAdminAccountsOutput(&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_deserializeOpErrorListDelegatedAdminAccounts(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("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_deserializeOpDocumentListDelegatedAdminAccountsOutput(v **ListDelegatedAdminAccountsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDelegatedAdminAccountsOutput if *v == nil { sv = &ListDelegatedAdminAccountsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "delegatedAdminAccounts": if err := awsRestjson1_deserializeDocumentDelegatedAdminAccountList(&sv.DelegatedAdminAccounts, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListFilters struct { } func (*awsRestjson1_deserializeOpListFilters) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListFilters) 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_deserializeOpErrorListFilters(response, &metadata) } output := &ListFiltersOutput{} 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_deserializeOpDocumentListFiltersOutput(&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_deserializeOpErrorListFilters(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("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_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListFiltersOutput if *v == nil { sv = &ListFiltersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "filters": if err := awsRestjson1_deserializeDocumentFilterList(&sv.Filters, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListFindingAggregations struct { } func (*awsRestjson1_deserializeOpListFindingAggregations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListFindingAggregations) 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_deserializeOpErrorListFindingAggregations(response, &metadata) } output := &ListFindingAggregationsOutput{} 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_deserializeOpDocumentListFindingAggregationsOutput(&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_deserializeOpErrorListFindingAggregations(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentListFindingAggregationsOutput(v **ListFindingAggregationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListFindingAggregationsOutput if *v == nil { sv = &ListFindingAggregationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "aggregationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AggregationType to be of type string, got %T instead", value) } sv.AggregationType = types.AggregationType(jtv) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "responses": if err := awsRestjson1_deserializeDocumentAggregationResponseList(&sv.Responses, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListFindings struct { } func (*awsRestjson1_deserializeOpListFindings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListFindings) 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_deserializeOpErrorListFindings(response, &metadata) } output := &ListFindingsOutput{} 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_deserializeOpDocumentListFindingsOutput(&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_deserializeOpErrorListFindings(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListFindingsOutput if *v == nil { sv = &ListFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "findings": if err := awsRestjson1_deserializeDocumentFindingList(&sv.Findings, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListMembers struct { } func (*awsRestjson1_deserializeOpListMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListMembers) 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_deserializeOpErrorListMembers(response, &metadata) } output := &ListMembersOutput{} 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_deserializeOpDocumentListMembersOutput(&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_deserializeOpErrorListMembers(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("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_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListMembersOutput if *v == nil { sv = &ListMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "members": if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } 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("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_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListUsageTotals struct { } func (*awsRestjson1_deserializeOpListUsageTotals) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListUsageTotals) 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_deserializeOpErrorListUsageTotals(response, &metadata) } output := &ListUsageTotalsOutput{} 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_deserializeOpDocumentListUsageTotalsOutput(&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_deserializeOpErrorListUsageTotals(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("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_deserializeOpDocumentListUsageTotalsOutput(v **ListUsageTotalsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListUsageTotalsOutput if *v == nil { sv = &ListUsageTotalsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ListUsageTotalsNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "totals": if err := awsRestjson1_deserializeDocumentUsageTotalList(&sv.Totals, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpResetEncryptionKey struct { } func (*awsRestjson1_deserializeOpResetEncryptionKey) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpResetEncryptionKey) 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_deserializeOpErrorResetEncryptionKey(response, &metadata) } output := &ResetEncryptionKeyOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorResetEncryptionKey(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_deserializeOpSearchVulnerabilities struct { } func (*awsRestjson1_deserializeOpSearchVulnerabilities) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSearchVulnerabilities) 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_deserializeOpErrorSearchVulnerabilities(response, &metadata) } output := &SearchVulnerabilitiesOutput{} 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_deserializeOpDocumentSearchVulnerabilitiesOutput(&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_deserializeOpErrorSearchVulnerabilities(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("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_deserializeOpDocumentSearchVulnerabilitiesOutput(v **SearchVulnerabilitiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SearchVulnerabilitiesOutput if *v == nil { sv = &SearchVulnerabilitiesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "vulnerabilities": if err := awsRestjson1_deserializeDocumentVulnerabilities(&sv.Vulnerabilities, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(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_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("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_deserializeOpUpdateConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateConfiguration) 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_deserializeOpErrorUpdateConfiguration(response, &metadata) } output := &UpdateConfigurationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateConfiguration(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("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_deserializeOpUpdateEc2DeepInspectionConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateEc2DeepInspectionConfiguration) 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_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(response, &metadata) } output := &UpdateEc2DeepInspectionConfigurationOutput{} 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_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutput(&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_deserializeOpErrorUpdateEc2DeepInspectionConfiguration(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("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_deserializeOpDocumentUpdateEc2DeepInspectionConfigurationOutput(v **UpdateEc2DeepInspectionConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateEc2DeepInspectionConfigurationOutput if *v == nil { sv = &UpdateEc2DeepInspectionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "orgPackagePaths": if err := awsRestjson1_deserializeDocumentPathList(&sv.OrgPackagePaths, value); err != nil { return err } case "packagePaths": if err := awsRestjson1_deserializeDocumentPathList(&sv.PackagePaths, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Ec2DeepInspectionStatus to be of type string, got %T instead", value) } sv.Status = types.Ec2DeepInspectionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateEncryptionKey struct { } func (*awsRestjson1_deserializeOpUpdateEncryptionKey) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateEncryptionKey) 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_deserializeOpErrorUpdateEncryptionKey(response, &metadata) } output := &UpdateEncryptionKeyOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateEncryptionKey(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_deserializeOpUpdateFilter struct { } func (*awsRestjson1_deserializeOpUpdateFilter) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateFilter) 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_deserializeOpErrorUpdateFilter(response, &metadata) } output := &UpdateFilterOutput{} 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_deserializeOpDocumentUpdateFilterOutput(&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_deserializeOpErrorUpdateFilter(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_deserializeOpDocumentUpdateFilterOutput(v **UpdateFilterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateFilterOutput if *v == nil { sv = &UpdateFilterOutput{} } 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 FilterArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) 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_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) } output := &UpdateOrganizationConfigurationOutput{} 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_deserializeOpDocumentUpdateOrganizationConfigurationOutput(&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_deserializeOpErrorUpdateOrganizationConfiguration(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("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_deserializeOpDocumentUpdateOrganizationConfigurationOutput(v **UpdateOrganizationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateOrganizationConfigurationOutput if *v == nil { sv = &UpdateOrganizationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "autoEnable": if err := awsRestjson1_deserializeDocumentAutoEnable(&sv.AutoEnable, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateOrgEc2DeepInspectionConfiguration) 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_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(response, &metadata) } output := &UpdateOrgEc2DeepInspectionConfigurationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateOrgEc2DeepInspectionConfiguration(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("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_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, 32) if err != nil { return err } v.RetryAfterSeconds = ptr.Int32(int32(vv)) } return nil } func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) vv, err := strconv.ParseInt(headerValues[0], 0, 32) if err != nil { return err } v.RetryAfterSeconds = ptr.Int32(int32(vv)) } return nil } func awsRestjson1_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_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} 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_deserializeDocumentBadRequestException(&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_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 "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccount(v **types.Account, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Account if *v == nil { sv = &types.Account{} } 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 "resourceStatus": if err := awsRestjson1_deserializeDocumentResourceStatus(&sv.ResourceStatus, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccountAggregationResponse(v **types.AccountAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccountAggregationResponse if *v == nil { sv = &types.AccountAggregationResponse{} } 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 "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccountList(v *[]types.Account, 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.Account if *v == nil { cv = []types.Account{} } else { cv = *v } for _, value := range shape { var col types.Account destAddr := &col if err := awsRestjson1_deserializeDocumentAccount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAccountState(v **types.AccountState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccountState if *v == nil { sv = &types.AccountState{} } 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 "resourceState": if err := awsRestjson1_deserializeDocumentResourceState(&sv.ResourceState, value); err != nil { return err } case "state": if err := awsRestjson1_deserializeDocumentState(&sv.State, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccountStateList(v *[]types.AccountState, 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.AccountState if *v == nil { cv = []types.AccountState{} } else { cv = *v } for _, value := range shape { var col types.AccountState destAddr := &col if err := awsRestjson1_deserializeDocumentAccountState(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAggregationResponse(v *types.AggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %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.AggregationResponse loop: for key, value := range shape { if value == nil { continue } switch key { case "accountAggregation": var mv types.AccountAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentAccountAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberAccountAggregation{Value: mv} break loop case "amiAggregation": var mv types.AmiAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentAmiAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberAmiAggregation{Value: mv} break loop case "awsEcrContainerAggregation": var mv types.AwsEcrContainerAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberAwsEcrContainerAggregation{Value: mv} break loop case "ec2InstanceAggregation": var mv types.Ec2InstanceAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentEc2InstanceAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberEc2InstanceAggregation{Value: mv} break loop case "findingTypeAggregation": var mv types.FindingTypeAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentFindingTypeAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberFindingTypeAggregation{Value: mv} break loop case "imageLayerAggregation": var mv types.ImageLayerAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentImageLayerAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberImageLayerAggregation{Value: mv} break loop case "lambdaFunctionAggregation": var mv types.LambdaFunctionAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentLambdaFunctionAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberLambdaFunctionAggregation{Value: mv} break loop case "lambdaLayerAggregation": var mv types.LambdaLayerAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentLambdaLayerAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberLambdaLayerAggregation{Value: mv} break loop case "packageAggregation": var mv types.PackageAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentPackageAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberPackageAggregation{Value: mv} break loop case "repositoryAggregation": var mv types.RepositoryAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentRepositoryAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberRepositoryAggregation{Value: mv} break loop case "titleAggregation": var mv types.TitleAggregationResponse destAddr := &mv if err := awsRestjson1_deserializeDocumentTitleAggregationResponse(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.AggregationResponseMemberTitleAggregation{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentAggregationResponseList(v *[]types.AggregationResponse, 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.AggregationResponse if *v == nil { cv = []types.AggregationResponse{} } else { cv = *v } for _, value := range shape { var col types.AggregationResponse if err := awsRestjson1_deserializeDocumentAggregationResponse(&col, value); err != nil { return err } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAmiAggregationResponse(v **types.AmiAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmiAggregationResponse if *v == nil { sv = &types.AmiAggregationResponse{} } 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 "affectedInstances": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.AffectedInstances = ptr.Int64(i64) } case "ami": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmiId to be of type string, got %T instead", value) } sv.Ami = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentArchitectureList(v *[]types.Architecture, 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.Architecture if *v == nil { cv = []types.Architecture{} } else { cv = *v } for _, value := range shape { var col types.Architecture if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Architecture to be of type string, got %T instead", value) } col = types.Architecture(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAtigData(v **types.AtigData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AtigData if *v == nil { sv = &types.AtigData{} } else { sv = *v } for key, value := range shape { switch key { case "firstSeen": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FirstSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected FirstSeen to be a JSON Number, got %T instead", value) } } case "lastSeen": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastSeen to be a JSON Number, got %T instead", value) } } case "targets": if err := awsRestjson1_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err } case "ttps": if err := awsRestjson1_deserializeDocumentTtps(&sv.Ttps, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoEnable(v **types.AutoEnable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AutoEnable if *v == nil { sv = &types.AutoEnable{} } else { sv = *v } for key, value := range shape { switch key { case "ec2": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Ec2 = ptr.Bool(jtv) } case "ecr": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Ecr = ptr.Bool(jtv) } case "lambda": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Lambda = ptr.Bool(jtv) } case "lambdaCode": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.LambdaCode = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2InstanceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2InstanceDetails if *v == nil { sv = &types.AwsEc2InstanceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "iamInstanceProfileArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IamInstanceProfileArn = ptr.String(jtv) } case "imageId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ImageId = ptr.String(jtv) } case "ipV4Addresses": if err := awsRestjson1_deserializeDocumentIpV4AddressList(&sv.IpV4Addresses, value); err != nil { return err } case "ipV6Addresses": if err := awsRestjson1_deserializeDocumentIpV6AddressList(&sv.IpV6Addresses, value); err != nil { return err } case "keyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyName = ptr.String(jtv) } case "launchedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LaunchedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "platform": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Platform to be of type string, got %T instead", value) } sv.Platform = ptr.String(jtv) } case "subnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubnetId = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcrContainerAggregationResponse(v **types.AwsEcrContainerAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcrContainerAggregationResponse if *v == nil { sv = &types.AwsEcrContainerAggregationResponse{} } 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 "architecture": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Architecture = ptr.String(jtv) } case "imageSha": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ImageSha = ptr.String(jtv) } case "imageTags": if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageTags, value); err != nil { return err } case "repository": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Repository = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcrContainerImageDetails(v **types.AwsEcrContainerImageDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcrContainerImageDetails if *v == nil { sv = &types.AwsEcrContainerImageDetails{} } else { sv = *v } for key, value := range shape { switch key { case "architecture": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Architecture = ptr.String(jtv) } case "author": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Author = ptr.String(jtv) } case "imageHash": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageHash to be of type string, got %T instead", value) } sv.ImageHash = ptr.String(jtv) } case "imageTags": if err := awsRestjson1_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil { return err } case "platform": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Platform to be of type string, got %T instead", value) } sv.Platform = ptr.String(jtv) } case "pushedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.PushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "registry": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Registry = ptr.String(jtv) } case "repositoryName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RepositoryName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(v **types.AwsLambdaFunctionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionDetails if *v == nil { sv = &types.AwsLambdaFunctionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "architectures": if err := awsRestjson1_deserializeDocumentArchitectureList(&sv.Architectures, value); err != nil { return err } case "codeSha256": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CodeSha256 = ptr.String(jtv) } case "executionRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExecutionRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } case "functionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunctionName to be of type string, got %T instead", value) } sv.FunctionName = ptr.String(jtv) } case "lastModifiedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "layers": if err := awsRestjson1_deserializeDocumentLayerList(&sv.Layers, value); err != nil { return err } case "packageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageType to be of type string, got %T instead", value) } sv.PackageType = types.PackageType(jtv) } case "runtime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Runtime to be of type string, got %T instead", value) } sv.Runtime = types.Runtime(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Version to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } case "vpcConfig": if err := awsRestjson1_deserializeDocumentLambdaVpcConfig(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BadRequestException if *v == nil { sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCisaData(v **types.CisaData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CisaData if *v == nil { sv = &types.CisaData{} } else { sv = *v } for key, value := range shape { switch key { case "action": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CisaAction to be of type string, got %T instead", value) } sv.Action = ptr.String(jtv) } case "dateAdded": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DateAdded = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CisaDateAdded to be a JSON Number, got %T instead", value) } } case "dateDue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DateDue = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CisaDateDue to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCodeFilePath(v **types.CodeFilePath, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CodeFilePath if *v == nil { sv = &types.CodeFilePath{} } else { sv = *v } for key, value := range shape { switch key { case "endLine": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.EndLine = ptr.Int32(int32(i64)) } case "fileName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FileName = ptr.String(jtv) } case "filePath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FilePath = ptr.String(jtv) } case "startLine": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartLine = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCodeLine(v **types.CodeLine, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CodeLine if *v == nil { sv = &types.CodeLine{} } else { sv = *v } for key, value := range shape { switch key { case "content": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Content = ptr.String(jtv) } case "lineNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LineNumber = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCodeLineList(v *[]types.CodeLine, 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.CodeLine if *v == nil { cv = []types.CodeLine{} } else { cv = *v } for _, value := range shape { var col types.CodeLine destAddr := &col if err := awsRestjson1_deserializeDocumentCodeLine(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCodeSnippetError(v **types.CodeSnippetError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CodeSnippetError if *v == nil { sv = &types.CodeSnippetError{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CodeSnippetErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.CodeSnippetErrorCode(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "findingArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingArn to be of type string, got %T instead", value) } sv.FindingArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCodeSnippetErrorList(v *[]types.CodeSnippetError, 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.CodeSnippetError if *v == nil { cv = []types.CodeSnippetError{} } else { cv = *v } for _, value := range shape { var col types.CodeSnippetError destAddr := &col if err := awsRestjson1_deserializeDocumentCodeSnippetError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCodeSnippetResult(v **types.CodeSnippetResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CodeSnippetResult if *v == nil { sv = &types.CodeSnippetResult{} } else { sv = *v } for key, value := range shape { switch key { case "codeSnippet": if err := awsRestjson1_deserializeDocumentCodeLineList(&sv.CodeSnippet, value); err != nil { return err } case "endLine": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.EndLine = ptr.Int32(int32(i64)) } case "findingArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingArn to be of type string, got %T instead", value) } sv.FindingArn = ptr.String(jtv) } case "startLine": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartLine = ptr.Int32(int32(i64)) } case "suggestedFixes": if err := awsRestjson1_deserializeDocumentSuggestedFixes(&sv.SuggestedFixes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCodeSnippetResultList(v *[]types.CodeSnippetResult, 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.CodeSnippetResult if *v == nil { cv = []types.CodeSnippetResult{} } else { cv = *v } for _, value := range shape { var col types.CodeSnippetResult destAddr := &col if err := awsRestjson1_deserializeDocumentCodeSnippetResult(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCodeVulnerabilityDetails(v **types.CodeVulnerabilityDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CodeVulnerabilityDetails if *v == nil { sv = &types.CodeVulnerabilityDetails{} } else { sv = *v } for key, value := range shape { switch key { case "cwes": if err := awsRestjson1_deserializeDocumentCweList(&sv.Cwes, value); err != nil { return err } case "detectorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DetectorId = ptr.String(jtv) } case "detectorName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DetectorName = ptr.String(jtv) } case "detectorTags": if err := awsRestjson1_deserializeDocumentDetectorTagList(&sv.DetectorTags, value); err != nil { return err } case "filePath": if err := awsRestjson1_deserializeDocumentCodeFilePath(&sv.FilePath, value); err != nil { return err } case "referenceUrls": if err := awsRestjson1_deserializeDocumentReferenceUrls(&sv.ReferenceUrls, value); err != nil { return err } case "ruleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleId = ptr.String(jtv) } case "sourceLambdaLayerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LambdaLayerArn to be of type string, got %T instead", value) } sv.SourceLambdaLayerArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCounts(v **types.Counts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Counts if *v == nil { sv = &types.Counts{} } else { sv = *v } for key, value := range shape { switch key { case "count": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AggCounts to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = i64 } case "groupKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GroupKey to be of type string, got %T instead", value) } sv.GroupKey = types.GroupKey(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCountsList(v *[]types.Counts, 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.Counts if *v == nil { cv = []types.Counts{} } else { cv = *v } for _, value := range shape { var col types.Counts destAddr := &col if err := awsRestjson1_deserializeDocumentCounts(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCoveredResource(v **types.CoveredResource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CoveredResource if *v == nil { sv = &types.CoveredResource{} } 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 "lastScannedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastScannedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceMetadata": if err := awsRestjson1_deserializeDocumentResourceScanMetadata(&sv.ResourceMetadata, value); err != nil { return err } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CoverageResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.CoverageResourceType(jtv) } case "scanStatus": if err := awsRestjson1_deserializeDocumentScanStatus(&sv.ScanStatus, value); err != nil { return err } case "scanType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScanType to be of type string, got %T instead", value) } sv.ScanType = types.ScanType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCoveredResources(v *[]types.CoveredResource, 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.CoveredResource if *v == nil { cv = []types.CoveredResource{} } else { cv = *v } for _, value := range shape { var col types.CoveredResource destAddr := &col if err := awsRestjson1_deserializeDocumentCoveredResource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCvss2(v **types.Cvss2, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Cvss2 if *v == nil { sv = &types.Cvss2{} } else { sv = *v } for key, value := range shape { switch key { case "baseScore": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.BaseScore = 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.BaseScore = f64 default: return fmt.Errorf("expected Cvss2BaseScore to be a JSON Number, got %T instead", value) } } case "scoringVector": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Cvss2ScoringVector to be of type string, got %T instead", value) } sv.ScoringVector = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCvss3(v **types.Cvss3, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Cvss3 if *v == nil { sv = &types.Cvss3{} } else { sv = *v } for key, value := range shape { switch key { case "baseScore": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.BaseScore = 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.BaseScore = f64 default: return fmt.Errorf("expected Cvss3BaseScore to be a JSON Number, got %T instead", value) } } case "scoringVector": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Cvss3ScoringVector to be of type string, got %T instead", value) } sv.ScoringVector = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCvssScore(v **types.CvssScore, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CvssScore if *v == nil { sv = &types.CvssScore{} } else { sv = *v } for key, value := range shape { switch key { case "baseScore": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.BaseScore = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.BaseScore = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "scoringVector": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ScoringVector = ptr.String(jtv) } case "source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Source = ptr.String(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCvssScoreAdjustment(v **types.CvssScoreAdjustment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CvssScoreAdjustment if *v == nil { sv = &types.CvssScoreAdjustment{} } else { sv = *v } for key, value := range shape { switch key { case "metric": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Metric = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCvssScoreAdjustmentList(v *[]types.CvssScoreAdjustment, 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.CvssScoreAdjustment if *v == nil { cv = []types.CvssScoreAdjustment{} } else { cv = *v } for _, value := range shape { var col types.CvssScoreAdjustment destAddr := &col if err := awsRestjson1_deserializeDocumentCvssScoreAdjustment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCvssScoreDetails(v **types.CvssScoreDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CvssScoreDetails if *v == nil { sv = &types.CvssScoreDetails{} } else { sv = *v } for key, value := range shape { switch key { case "adjustments": if err := awsRestjson1_deserializeDocumentCvssScoreAdjustmentList(&sv.Adjustments, value); err != nil { return err } case "cvssSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CvssSource = ptr.String(jtv) } case "score": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Score = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Score = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "scoreSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ScoreSource = ptr.String(jtv) } case "scoringVector": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ScoringVector = ptr.String(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCvssScoreList(v *[]types.CvssScore, 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.CvssScore if *v == nil { cv = []types.CvssScore{} } else { cv = *v } for _, value := range shape { var col types.CvssScore destAddr := &col if err := awsRestjson1_deserializeDocumentCvssScore(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCweList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCwes(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 Cwe to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDateFilter(v **types.DateFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DateFilter if *v == nil { sv = &types.DateFilter{} } else { sv = *v } for key, value := range shape { switch key { case "endInclusive": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.EndInclusive = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "startInclusive": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartInclusive = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateFilterList(v *[]types.DateFilter, 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.DateFilter if *v == nil { cv = []types.DateFilter{} } else { cv = *v } for _, value := range shape { var col types.DateFilter destAddr := &col if err := awsRestjson1_deserializeDocumentDateFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDelegatedAdmin(v **types.DelegatedAdmin, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DelegatedAdmin if *v == nil { sv = &types.DelegatedAdmin{} } 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 "relationshipStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelationshipStatus to be of type string, got %T instead", value) } sv.RelationshipStatus = types.RelationshipStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDelegatedAdminAccount(v **types.DelegatedAdminAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DelegatedAdminAccount if *v == nil { sv = &types.DelegatedAdminAccount{} } 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 "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DelegatedAdminStatus to be of type string, got %T instead", value) } sv.Status = types.DelegatedAdminStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDelegatedAdminAccountList(v *[]types.DelegatedAdminAccount, 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.DelegatedAdminAccount if *v == nil { cv = []types.DelegatedAdminAccount{} } else { cv = *v } for _, value := range shape { var col types.DelegatedAdminAccount destAddr := &col if err := awsRestjson1_deserializeDocumentDelegatedAdminAccount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDestination(v **types.Destination, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Destination if *v == nil { sv = &types.Destination{} } else { sv = *v } for key, value := range shape { switch key { case "bucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.BucketName = ptr.String(jtv) } case "keyPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KeyPrefix = ptr.String(jtv) } case "kmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KmsKeyArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDetectionPlatforms(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDetectorTagList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEc2InstanceAggregationResponse(v **types.Ec2InstanceAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Ec2InstanceAggregationResponse if *v == nil { sv = &types.Ec2InstanceAggregationResponse{} } 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 String to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "ami": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmiId to be of type string, got %T instead", value) } sv.Ami = ptr.String(jtv) } case "instanceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceId = ptr.String(jtv) } case "instanceTags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.InstanceTags, value); err != nil { return err } case "networkFindings": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NetworkFindings = ptr.Int64(i64) } case "operatingSystem": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.OperatingSystem = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEc2Metadata(v **types.Ec2Metadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Ec2Metadata if *v == nil { sv = &types.Ec2Metadata{} } else { sv = *v } for key, value := range shape { switch key { case "amiId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmiId to be of type string, got %T instead", value) } sv.AmiId = ptr.String(jtv) } case "platform": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Ec2Platform to be of type string, got %T instead", value) } sv.Platform = types.Ec2Platform(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcrConfigurationState(v **types.EcrConfigurationState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EcrConfigurationState if *v == nil { sv = &types.EcrConfigurationState{} } else { sv = *v } for key, value := range shape { switch key { case "rescanDurationState": if err := awsRestjson1_deserializeDocumentEcrRescanDurationState(&sv.RescanDurationState, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcrContainerImageMetadata(v **types.EcrContainerImageMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EcrContainerImageMetadata if *v == nil { sv = &types.EcrContainerImageMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "tags": if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcrRepositoryMetadata(v **types.EcrRepositoryMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EcrRepositoryMetadata if *v == nil { sv = &types.EcrRepositoryMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "scanFrequency": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EcrScanFrequency to be of type string, got %T instead", value) } sv.ScanFrequency = types.EcrScanFrequency(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcrRescanDurationState(v **types.EcrRescanDurationState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EcrRescanDurationState if *v == nil { sv = &types.EcrRescanDurationState{} } else { sv = *v } for key, value := range shape { switch key { case "rescanDuration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EcrRescanDuration to be of type string, got %T instead", value) } sv.RescanDuration = types.EcrRescanDuration(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EcrRescanDurationStatus to be of type string, got %T instead", value) } sv.Status = types.EcrRescanDurationStatus(jtv) } case "updatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEpss(v **types.Epss, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Epss if *v == nil { sv = &types.Epss{} } else { sv = *v } for key, value := range shape { switch key { case "score": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Score = 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.Score = f64 default: return fmt.Errorf("expected EpssScore to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEpssDetails(v **types.EpssDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EpssDetails if *v == nil { sv = &types.EpssDetails{} } else { sv = *v } for key, value := range shape { switch key { case "score": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Score = 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.Score = f64 default: return fmt.Errorf("expected EpssScoreValue to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExploitabilityDetails(v **types.ExploitabilityDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExploitabilityDetails if *v == nil { sv = &types.ExploitabilityDetails{} } else { sv = *v } for key, value := range shape { switch key { case "lastKnownExploitAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastKnownExploitAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExploitObserved(v **types.ExploitObserved, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ExploitObserved if *v == nil { sv = &types.ExploitObserved{} } else { sv = *v } for key, value := range shape { switch key { case "firstSeen": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FirstSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected FirstSeen to be a JSON Number, got %T instead", value) } } case "lastSeen": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastSeen = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected LastSeen to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFailedAccount(v **types.FailedAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FailedAccount if *v == nil { sv = &types.FailedAccount{} } 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 "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.ErrorCode(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "resourceStatus": if err := awsRestjson1_deserializeDocumentResourceStatus(&sv.ResourceStatus, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFailedAccountList(v *[]types.FailedAccount, 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.FailedAccount if *v == nil { cv = []types.FailedAccount{} } else { cv = *v } for _, value := range shape { var col types.FailedAccount destAddr := &col if err := awsRestjson1_deserializeDocumentFailedAccount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFailedMemberAccountEc2DeepInspectionStatusState(v **types.FailedMemberAccountEc2DeepInspectionStatusState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FailedMemberAccountEc2DeepInspectionStatusState if *v == nil { sv = &types.FailedMemberAccountEc2DeepInspectionStatusState{} } 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 "ec2ScanStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Ec2ScanStatus = types.Status(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFailedMemberAccountEc2DeepInspectionStatusStateList(v *[]types.FailedMemberAccountEc2DeepInspectionStatusState, 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.FailedMemberAccountEc2DeepInspectionStatusState if *v == nil { cv = []types.FailedMemberAccountEc2DeepInspectionStatusState{} } else { cv = *v } for _, value := range shape { var col types.FailedMemberAccountEc2DeepInspectionStatusState destAddr := &col if err := awsRestjson1_deserializeDocumentFailedMemberAccountEc2DeepInspectionStatusState(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilter(v **types.Filter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Filter if *v == nil { sv = &types.Filter{} } else { sv = *v } for key, value := range shape { switch key { case "action": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterAction to be of type string, got %T instead", value) } sv.Action = types.FilterAction(jtv) } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "criteria": if err := awsRestjson1_deserializeDocumentFilterCriteria(&sv.Criteria, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ownerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OwnerId to be of type string, got %T instead", value) } sv.OwnerId = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterReason to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "updatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterCriteria(v **types.FilterCriteria, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FilterCriteria if *v == nil { sv = &types.FilterCriteria{} } else { sv = *v } for key, value := range shape { switch key { case "awsAccountId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.AwsAccountId, value); err != nil { return err } case "codeVulnerabilityDetectorName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.CodeVulnerabilityDetectorName, value); err != nil { return err } case "codeVulnerabilityDetectorTags": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.CodeVulnerabilityDetectorTags, value); err != nil { return err } case "codeVulnerabilityFilePath": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.CodeVulnerabilityFilePath, value); err != nil { return err } case "componentId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComponentId, value); err != nil { return err } case "componentType": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComponentType, value); err != nil { return err } case "ec2InstanceImageId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Ec2InstanceImageId, value); err != nil { return err } case "ec2InstanceSubnetId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Ec2InstanceSubnetId, value); err != nil { return err } case "ec2InstanceVpcId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Ec2InstanceVpcId, value); err != nil { return err } case "ecrImageArchitecture": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.EcrImageArchitecture, value); err != nil { return err } case "ecrImageHash": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.EcrImageHash, value); err != nil { return err } case "ecrImagePushedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.EcrImagePushedAt, value); err != nil { return err } case "ecrImageRegistry": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.EcrImageRegistry, value); err != nil { return err } case "ecrImageRepositoryName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.EcrImageRepositoryName, value); err != nil { return err } case "ecrImageTags": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.EcrImageTags, value); err != nil { return err } case "epssScore": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.EpssScore, value); err != nil { return err } case "exploitAvailable": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ExploitAvailable, value); err != nil { return err } case "findingArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingArn, value); err != nil { return err } case "findingStatus": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingStatus, value); err != nil { return err } case "findingType": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingType, value); err != nil { return err } case "firstObservedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.FirstObservedAt, value); err != nil { return err } case "fixAvailable": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FixAvailable, value); err != nil { return err } case "inspectorScore": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.InspectorScore, value); err != nil { return err } case "lambdaFunctionExecutionRoleArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.LambdaFunctionExecutionRoleArn, value); err != nil { return err } case "lambdaFunctionLastModifiedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.LambdaFunctionLastModifiedAt, value); err != nil { return err } case "lambdaFunctionLayers": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.LambdaFunctionLayers, value); err != nil { return err } case "lambdaFunctionName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.LambdaFunctionName, value); err != nil { return err } case "lambdaFunctionRuntime": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.LambdaFunctionRuntime, value); err != nil { return err } case "lastObservedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.LastObservedAt, value); err != nil { return err } case "networkProtocol": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkProtocol, value); err != nil { return err } case "portRange": if err := awsRestjson1_deserializeDocumentPortRangeFilterList(&sv.PortRange, value); err != nil { return err } case "relatedVulnerabilities": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedVulnerabilities, value); err != nil { return err } case "resourceId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceId, value); err != nil { return err } case "resourceTags": if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ResourceTags, value); err != nil { return err } case "resourceType": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceType, value); err != nil { return err } case "severity": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Severity, value); err != nil { return err } case "title": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Title, value); err != nil { return err } case "updatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.UpdatedAt, value); err != nil { return err } case "vendorSeverity": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VendorSeverity, value); err != nil { return err } case "vulnerabilityId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VulnerabilityId, value); err != nil { return err } case "vulnerabilitySource": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VulnerabilitySource, value); err != nil { return err } case "vulnerablePackages": if err := awsRestjson1_deserializeDocumentPackageFilterList(&sv.VulnerablePackages, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterList(v *[]types.Filter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Filter if *v == nil { cv = []types.Filter{} } else { cv = *v } for _, value := range shape { var col types.Filter destAddr := &col if err := awsRestjson1_deserializeDocumentFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFinding(v **types.Finding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Finding if *v == nil { sv = &types.Finding{} } else { sv = *v } for key, value := range shape { switch key { case "awsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "codeVulnerabilityDetails": if err := awsRestjson1_deserializeDocumentCodeVulnerabilityDetails(&sv.CodeVulnerabilityDetails, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "epss": if err := awsRestjson1_deserializeDocumentEpssDetails(&sv.Epss, value); err != nil { return err } case "exploitabilityDetails": if err := awsRestjson1_deserializeDocumentExploitabilityDetails(&sv.ExploitabilityDetails, value); err != nil { return err } case "exploitAvailable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExploitAvailable to be of type string, got %T instead", value) } sv.ExploitAvailable = types.ExploitAvailable(jtv) } case "findingArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingArn to be of type string, got %T instead", value) } sv.FindingArn = ptr.String(jtv) } case "firstObservedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FirstObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "fixAvailable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FixAvailable to be of type string, got %T instead", value) } sv.FixAvailable = types.FixAvailable(jtv) } case "inspectorScore": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.InspectorScore = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.InspectorScore = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "inspectorScoreDetails": if err := awsRestjson1_deserializeDocumentInspectorScoreDetails(&sv.InspectorScoreDetails, value); err != nil { return err } case "lastObservedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "networkReachabilityDetails": if err := awsRestjson1_deserializeDocumentNetworkReachabilityDetails(&sv.NetworkReachabilityDetails, value); err != nil { return err } case "packageVulnerabilityDetails": if err := awsRestjson1_deserializeDocumentPackageVulnerabilityDetails(&sv.PackageVulnerabilityDetails, value); err != nil { return err } case "remediation": if err := awsRestjson1_deserializeDocumentRemediation(&sv.Remediation, value); err != nil { return err } case "resources": if err := awsRestjson1_deserializeDocumentResourceList(&sv.Resources, value); err != nil { return err } case "severity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Severity to be of type string, got %T instead", value) } sv.Severity = types.Severity(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingStatus to be of type string, got %T instead", value) } sv.Status = types.FindingStatus(jtv) } case "title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingType to be of type string, got %T instead", value) } sv.Type = types.FindingType(jtv) } case "updatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFindingList(v *[]types.Finding, 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.Finding if *v == nil { cv = []types.Finding{} } else { cv = *v } for _, value := range shape { var col types.Finding destAddr := &col if err := awsRestjson1_deserializeDocumentFinding(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFindingTypeAggregationResponse(v **types.FindingTypeAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FindingTypeAggregationResponse if *v == nil { sv = &types.FindingTypeAggregationResponse{} } 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 "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeTrialAccountInfo(v **types.FreeTrialAccountInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FreeTrialAccountInfo if *v == nil { sv = &types.FreeTrialAccountInfo{} } 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 MeteringAccountId to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "freeTrialInfo": if err := awsRestjson1_deserializeDocumentFreeTrialInfoList(&sv.FreeTrialInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeTrialAccountInfoList(v *[]types.FreeTrialAccountInfo, 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.FreeTrialAccountInfo if *v == nil { cv = []types.FreeTrialAccountInfo{} } else { cv = *v } for _, value := range shape { var col types.FreeTrialAccountInfo destAddr := &col if err := awsRestjson1_deserializeDocumentFreeTrialAccountInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFreeTrialInfo(v **types.FreeTrialInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FreeTrialInfo if *v == nil { sv = &types.FreeTrialInfo{} } else { sv = *v } for key, value := range shape { switch key { case "end": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.End = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "start": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Start = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FreeTrialStatus to be of type string, got %T instead", value) } sv.Status = types.FreeTrialStatus(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FreeTrialType to be of type string, got %T instead", value) } sv.Type = types.FreeTrialType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeTrialInfoError(v **types.FreeTrialInfoError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FreeTrialInfoError if *v == nil { sv = &types.FreeTrialInfoError{} } 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 MeteringAccountId to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FreeTrialInfoErrorCode to be of type string, got %T instead", value) } sv.Code = types.FreeTrialInfoErrorCode(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeTrialInfoErrorList(v *[]types.FreeTrialInfoError, 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.FreeTrialInfoError if *v == nil { cv = []types.FreeTrialInfoError{} } else { cv = *v } for _, value := range shape { var col types.FreeTrialInfoError destAddr := &col if err := awsRestjson1_deserializeDocumentFreeTrialInfoError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFreeTrialInfoList(v *[]types.FreeTrialInfo, 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.FreeTrialInfo if *v == nil { cv = []types.FreeTrialInfo{} } else { cv = *v } for _, value := range shape { var col types.FreeTrialInfo destAddr := &col if err := awsRestjson1_deserializeDocumentFreeTrialInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImageLayerAggregationResponse(v **types.ImageLayerAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ImageLayerAggregationResponse if *v == nil { sv = &types.ImageLayerAggregationResponse{} } 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 "layerHash": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LayerHash = ptr.String(jtv) } case "repository": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Repository = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageTagList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInspectorScoreDetails(v **types.InspectorScoreDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InspectorScoreDetails if *v == nil { sv = &types.InspectorScoreDetails{} } else { sv = *v } for key, value := range shape { switch key { case "adjustedCvss": if err := awsRestjson1_deserializeDocumentCvssScoreDetails(&sv.AdjustedCvss, value); err != nil { return err } 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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIpV4AddressList(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 IpV4Address to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIpV6AddressList(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 IpV6Address to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLambdaFunctionAggregationResponse(v **types.LambdaFunctionAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionAggregationResponse if *v == nil { sv = &types.LambdaFunctionAggregationResponse{} } 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 "functionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FunctionName = ptr.String(jtv) } case "lambdaTags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.LambdaTags, value); err != nil { return err } case "lastModifiedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "runtime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Runtime = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLambdaFunctionMetadata(v **types.LambdaFunctionMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionMetadata if *v == nil { sv = &types.LambdaFunctionMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "functionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FunctionName = ptr.String(jtv) } case "functionTags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.FunctionTags, value); err != nil { return err } case "layers": if err := awsRestjson1_deserializeDocumentLambdaLayerList(&sv.Layers, value); err != nil { return err } case "runtime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Runtime to be of type string, got %T instead", value) } sv.Runtime = types.Runtime(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLambdaLayerAggregationResponse(v **types.LambdaLayerAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaLayerAggregationResponse if *v == nil { sv = &types.LambdaLayerAggregationResponse{} } 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 "functionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FunctionName = ptr.String(jtv) } case "layerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LayerArn = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLambdaLayerList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLambdaVpcConfig(v **types.LambdaVpcConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaVpcConfig if *v == nil { sv = &types.LambdaVpcConfig{} } else { sv = *v } for key, value := range shape { switch key { case "securityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil { return err } case "subnetIds": if err := awsRestjson1_deserializeDocumentSubnetIdList(&sv.SubnetIds, value); err != nil { return err } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLayerList(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 LambdaLayerArn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMapFilter(v **types.MapFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MapFilter if *v == nil { sv = &types.MapFilter{} } else { sv = *v } for key, value := range shape { switch key { case "comparison": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MapComparison to be of type string, got %T instead", value) } sv.Comparison = types.MapComparison(jtv) } case "key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MapKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MapValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMapFilterList(v *[]types.MapFilter, 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.MapFilter if *v == nil { cv = []types.MapFilter{} } else { cv = *v } for _, value := range shape { var col types.MapFilter destAddr := &col if err := awsRestjson1_deserializeDocumentMapFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMember(v **types.Member, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Member if *v == nil { sv = &types.Member{} } 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 "delegatedAdminAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.DelegatedAdminAccountId = ptr.String(jtv) } case "relationshipStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelationshipStatus to be of type string, got %T instead", value) } sv.RelationshipStatus = types.RelationshipStatus(jtv) } case "updatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberAccountEc2DeepInspectionStatusState(v **types.MemberAccountEc2DeepInspectionStatusState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MemberAccountEc2DeepInspectionStatusState if *v == nil { sv = &types.MemberAccountEc2DeepInspectionStatusState{} } 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 "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Ec2DeepInspectionStatus to be of type string, got %T instead", value) } sv.Status = types.Ec2DeepInspectionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMemberAccountEc2DeepInspectionStatusStateList(v *[]types.MemberAccountEc2DeepInspectionStatusState, 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.MemberAccountEc2DeepInspectionStatusState if *v == nil { cv = []types.MemberAccountEc2DeepInspectionStatusState{} } else { cv = *v } for _, value := range shape { var col types.MemberAccountEc2DeepInspectionStatusState destAddr := &col if err := awsRestjson1_deserializeDocumentMemberAccountEc2DeepInspectionStatusState(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMemberList(v *[]types.Member, 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.Member if *v == nil { cv = []types.Member{} } else { cv = *v } for _, value := range shape { var col types.Member destAddr := &col if err := awsRestjson1_deserializeDocumentMember(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNetworkPath(v **types.NetworkPath, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkPath if *v == nil { sv = &types.NetworkPath{} } else { sv = *v } for key, value := range shape { switch key { case "steps": if err := awsRestjson1_deserializeDocumentStepList(&sv.Steps, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkReachabilityDetails(v **types.NetworkReachabilityDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkReachabilityDetails if *v == nil { sv = &types.NetworkReachabilityDetails{} } else { sv = *v } for key, value := range shape { switch key { case "networkPath": if err := awsRestjson1_deserializeDocumentNetworkPath(&sv.NetworkPath, value); err != nil { return err } case "openPortRange": if err := awsRestjson1_deserializeDocumentPortRange(&sv.OpenPortRange, value); err != nil { return err } case "protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkProtocol to be of type string, got %T instead", value) } sv.Protocol = types.NetworkProtocol(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNonEmptyStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNumberFilter(v **types.NumberFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NumberFilter if *v == nil { sv = &types.NumberFilter{} } else { sv = *v } for key, value := range shape { switch key { case "lowerInclusive": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LowerInclusive = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.LowerInclusive = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "upperInclusive": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpperInclusive = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.UpperInclusive = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumberFilterList(v *[]types.NumberFilter, 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.NumberFilter if *v == nil { cv = []types.NumberFilter{} } else { cv = *v } for _, value := range shape { var col types.NumberFilter destAddr := &col if err := awsRestjson1_deserializeDocumentNumberFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPackageAggregationResponse(v **types.PackageAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PackageAggregationResponse if *v == nil { sv = &types.PackageAggregationResponse{} } 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 "packageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PackageName = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPackageFilter(v **types.PackageFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PackageFilter if *v == nil { sv = &types.PackageFilter{} } else { sv = *v } for key, value := range shape { switch key { case "architecture": if err := awsRestjson1_deserializeDocumentStringFilter(&sv.Architecture, value); err != nil { return err } case "epoch": if err := awsRestjson1_deserializeDocumentNumberFilter(&sv.Epoch, value); err != nil { return err } case "name": if err := awsRestjson1_deserializeDocumentStringFilter(&sv.Name, value); err != nil { return err } case "release": if err := awsRestjson1_deserializeDocumentStringFilter(&sv.Release, value); err != nil { return err } case "sourceLambdaLayerArn": if err := awsRestjson1_deserializeDocumentStringFilter(&sv.SourceLambdaLayerArn, value); err != nil { return err } case "sourceLayerHash": if err := awsRestjson1_deserializeDocumentStringFilter(&sv.SourceLayerHash, value); err != nil { return err } case "version": if err := awsRestjson1_deserializeDocumentStringFilter(&sv.Version, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPackageFilterList(v *[]types.PackageFilter, 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.PackageFilter if *v == nil { cv = []types.PackageFilter{} } else { cv = *v } for _, value := range shape { var col types.PackageFilter destAddr := &col if err := awsRestjson1_deserializeDocumentPackageFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPackageVulnerabilityDetails(v **types.PackageVulnerabilityDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PackageVulnerabilityDetails if *v == nil { sv = &types.PackageVulnerabilityDetails{} } else { sv = *v } for key, value := range shape { switch key { case "cvss": if err := awsRestjson1_deserializeDocumentCvssScoreList(&sv.Cvss, value); err != nil { return err } case "referenceUrls": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ReferenceUrls, value); err != nil { return err } case "relatedVulnerabilities": if err := awsRestjson1_deserializeDocumentVulnerabilityIdList(&sv.RelatedVulnerabilities, value); err != nil { return err } case "source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Source = ptr.String(jtv) } case "sourceUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceUrl = ptr.String(jtv) } case "vendorCreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.VendorCreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "vendorSeverity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VendorSeverity = ptr.String(jtv) } case "vendorUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.VendorUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "vulnerabilityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VulnerabilityId to be of type string, got %T instead", value) } sv.VulnerabilityId = ptr.String(jtv) } case "vulnerablePackages": if err := awsRestjson1_deserializeDocumentVulnerablePackageList(&sv.VulnerablePackages, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPathList(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 Path to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPermission(v **types.Permission, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Permission if *v == nil { sv = &types.Permission{} } else { sv = *v } for key, value := range shape { switch key { case "operation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Operation to be of type string, got %T instead", value) } sv.Operation = types.Operation(jtv) } case "service": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Service to be of type string, got %T instead", value) } sv.Service = types.Service(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPermissions(v *[]types.Permission, 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.Permission if *v == nil { cv = []types.Permission{} } else { cv = *v } for _, value := range shape { var col types.Permission destAddr := &col if err := awsRestjson1_deserializeDocumentPermission(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPortRange(v **types.PortRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PortRange if *v == nil { sv = &types.PortRange{} } else { sv = *v } for key, value := range shape { switch key { case "begin": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Begin = ptr.Int32(int32(i64)) } case "end": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.End = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortRangeFilter(v **types.PortRangeFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PortRangeFilter if *v == nil { sv = &types.PortRangeFilter{} } else { sv = *v } for key, value := range shape { switch key { case "beginInclusive": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BeginInclusive = ptr.Int32(int32(i64)) } case "endInclusive": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.EndInclusive = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortRangeFilterList(v *[]types.PortRangeFilter, 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.PortRangeFilter if *v == nil { cv = []types.PortRangeFilter{} } else { cv = *v } for _, value := range shape { var col types.PortRangeFilter destAddr := &col if err := awsRestjson1_deserializeDocumentPortRangeFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Recommendation if *v == nil { sv = &types.Recommendation{} } else { sv = *v } for key, value := range shape { switch key { case "text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceUrls(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRelatedVulnerabilities(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 RelatedVulnerability to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRemediation(v **types.Remediation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Remediation if *v == nil { sv = &types.Remediation{} } else { sv = *v } for key, value := range shape { switch key { case "recommendation": if err := awsRestjson1_deserializeDocumentRecommendation(&sv.Recommendation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRepositoryAggregationResponse(v **types.RepositoryAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RepositoryAggregationResponse if *v == nil { sv = &types.RepositoryAggregationResponse{} } 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 "affectedImages": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.AffectedImages = ptr.Int64(i64) } case "repository": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Repository = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Resource if *v == nil { sv = &types.Resource{} } else { sv = *v } for key, value := range shape { switch key { case "details": if err := awsRestjson1_deserializeDocumentResourceDetails(&sv.Details, value); err != nil { return err } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "partition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Partition = ptr.String(jtv) } case "region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) } sv.Type = types.ResourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceDetails if *v == nil { sv = &types.ResourceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "awsEc2Instance": if err := awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(&sv.AwsEc2Instance, value); err != nil { return err } case "awsEcrContainerImage": if err := awsRestjson1_deserializeDocumentAwsEcrContainerImageDetails(&sv.AwsEcrContainerImage, value); err != nil { return err } case "awsLambdaFunction": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(&sv.AwsLambdaFunction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceFilterCriteria(v **types.ResourceFilterCriteria, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceFilterCriteria if *v == nil { sv = &types.ResourceFilterCriteria{} } else { sv = *v } for key, value := range shape { switch key { case "accountId": if err := awsRestjson1_deserializeDocumentResourceStringFilterList(&sv.AccountId, value); err != nil { return err } case "ec2InstanceTags": if err := awsRestjson1_deserializeDocumentResourceMapFilterList(&sv.Ec2InstanceTags, value); err != nil { return err } case "ecrImageTags": if err := awsRestjson1_deserializeDocumentResourceStringFilterList(&sv.EcrImageTags, value); err != nil { return err } case "ecrRepositoryName": if err := awsRestjson1_deserializeDocumentResourceStringFilterList(&sv.EcrRepositoryName, value); err != nil { return err } case "lambdaFunctionName": if err := awsRestjson1_deserializeDocumentResourceStringFilterList(&sv.LambdaFunctionName, value); err != nil { return err } case "lambdaFunctionTags": if err := awsRestjson1_deserializeDocumentResourceMapFilterList(&sv.LambdaFunctionTags, value); err != nil { return err } case "resourceId": if err := awsRestjson1_deserializeDocumentResourceStringFilterList(&sv.ResourceId, value); err != nil { return err } case "resourceType": if err := awsRestjson1_deserializeDocumentResourceStringFilterList(&sv.ResourceType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceList(v *[]types.Resource, 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.Resource if *v == nil { cv = []types.Resource{} } else { cv = *v } for _, value := range shape { var col types.Resource destAddr := &col if err := awsRestjson1_deserializeDocumentResource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceMapFilter(v **types.ResourceMapFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceMapFilter if *v == nil { sv = &types.ResourceMapFilter{} } else { sv = *v } for key, value := range shape { switch key { case "comparison": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceMapComparison to be of type string, got %T instead", value) } sv.Comparison = types.ResourceMapComparison(jtv) } case "key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceMapFilterList(v *[]types.ResourceMapFilter, 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.ResourceMapFilter if *v == nil { cv = []types.ResourceMapFilter{} } else { cv = *v } for _, value := range shape { var col types.ResourceMapFilter destAddr := &col if err := awsRestjson1_deserializeDocumentResourceMapFilter(&destAddr, value); err != nil { return err } col = *destAddr 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 "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceScanMetadata(v **types.ResourceScanMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceScanMetadata if *v == nil { sv = &types.ResourceScanMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "ec2": if err := awsRestjson1_deserializeDocumentEc2Metadata(&sv.Ec2, value); err != nil { return err } case "ecrImage": if err := awsRestjson1_deserializeDocumentEcrContainerImageMetadata(&sv.EcrImage, value); err != nil { return err } case "ecrRepository": if err := awsRestjson1_deserializeDocumentEcrRepositoryMetadata(&sv.EcrRepository, value); err != nil { return err } case "lambdaFunction": if err := awsRestjson1_deserializeDocumentLambdaFunctionMetadata(&sv.LambdaFunction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceState(v **types.ResourceState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceState if *v == nil { sv = &types.ResourceState{} } else { sv = *v } for key, value := range shape { switch key { case "ec2": if err := awsRestjson1_deserializeDocumentState(&sv.Ec2, value); err != nil { return err } case "ecr": if err := awsRestjson1_deserializeDocumentState(&sv.Ecr, value); err != nil { return err } case "lambda": if err := awsRestjson1_deserializeDocumentState(&sv.Lambda, value); err != nil { return err } case "lambdaCode": if err := awsRestjson1_deserializeDocumentState(&sv.LambdaCode, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceStatus(v **types.ResourceStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceStatus if *v == nil { sv = &types.ResourceStatus{} } else { sv = *v } for key, value := range shape { switch key { case "ec2": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Ec2 = types.Status(jtv) } case "ecr": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Ecr = types.Status(jtv) } case "lambda": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Lambda = types.Status(jtv) } case "lambdaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.LambdaCode = types.Status(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceStringFilter(v **types.ResourceStringFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceStringFilter if *v == nil { sv = &types.ResourceStringFilter{} } else { sv = *v } for key, value := range shape { switch key { case "comparison": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStringComparison to be of type string, got %T instead", value) } sv.Comparison = types.ResourceStringComparison(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStringInput to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceStringFilterList(v *[]types.ResourceStringFilter, 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.ResourceStringFilter if *v == nil { cv = []types.ResourceStringFilter{} } else { cv = *v } for _, value := range shape { var col types.ResourceStringFilter destAddr := &col if err := awsRestjson1_deserializeDocumentResourceStringFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentScanStatus(v **types.ScanStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ScanStatus if *v == nil { sv = &types.ScanStatus{} } else { sv = *v } for key, value := range shape { switch key { case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScanStatusReason to be of type string, got %T instead", value) } sv.Reason = types.ScanStatusReason(jtv) } case "statusCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScanStatusCode to be of type string, got %T instead", value) } sv.StatusCode = types.ScanStatusCode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityGroupIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityGroupId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSeverityCounts(v **types.SeverityCounts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SeverityCounts if *v == nil { sv = &types.SeverityCounts{} } else { sv = *v } for key, value := range shape { switch key { case "all": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.All = ptr.Int64(i64) } case "critical": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Critical = ptr.Int64(i64) } case "high": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.High = ptr.Int64(i64) } case "medium": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Medium = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentState(v **types.State, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.State if *v == nil { sv = &types.State{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.ErrorCode(jtv) } case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStep(v **types.Step, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Step if *v == nil { sv = &types.Step{} } else { sv = *v } for key, value := range shape { switch key { case "componentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Component to be of type string, got %T instead", value) } sv.ComponentId = ptr.String(jtv) } case "componentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) } sv.ComponentType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStepList(v *[]types.Step, 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.Step if *v == nil { cv = []types.Step{} } else { cv = *v } for _, value := range shape { var col types.Step destAddr := &col if err := awsRestjson1_deserializeDocumentStep(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringFilter(v **types.StringFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StringFilter if *v == nil { sv = &types.StringFilter{} } else { sv = *v } for key, value := range shape { switch key { case "comparison": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StringComparison to be of type string, got %T instead", value) } sv.Comparison = types.StringComparison(jtv) } case "value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StringInput to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringFilterList(v *[]types.StringFilter, 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.StringFilter if *v == nil { cv = []types.StringFilter{} } else { cv = *v } for _, value := range shape { var col types.StringFilter destAddr := &col if err := awsRestjson1_deserializeDocumentStringFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubnetIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSuggestedFix(v **types.SuggestedFix, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SuggestedFix if *v == nil { sv = &types.SuggestedFix{} } 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 String to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSuggestedFixes(v *[]types.SuggestedFix, 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.SuggestedFix if *v == nil { cv = []types.SuggestedFix{} } else { cv = *v } for _, value := range shape { var col types.SuggestedFix destAddr := &col if err := awsRestjson1_deserializeDocumentSuggestedFix(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTagList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MapValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentTargets(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 Target to be of type string, got %T instead", value) } col = jtv } 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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryAfterSeconds = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTitleAggregationResponse(v **types.TitleAggregationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TitleAggregationResponse if *v == nil { sv = &types.TitleAggregationResponse{} } 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 "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } case "title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "vulnerabilityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VulnerabilityId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTtps(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 Ttp to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUsage(v **types.Usage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Usage if *v == nil { sv = &types.Usage{} } else { sv = *v } for key, value := range shape { switch key { case "currency": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Currency to be of type string, got %T instead", value) } sv.Currency = types.Currency(jtv) } case "estimatedMonthlyCost": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.EstimatedMonthlyCost = 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.EstimatedMonthlyCost = f64 default: return fmt.Errorf("expected MonthlyCostEstimate to be a JSON Number, got %T instead", value) } } case "total": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Total = 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.Total = f64 default: return fmt.Errorf("expected UsageValue to be a JSON Number, got %T instead", value) } } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UsageType to be of type string, got %T instead", value) } sv.Type = types.UsageType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUsageList(v *[]types.Usage, 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.Usage if *v == nil { cv = []types.Usage{} } else { cv = *v } for _, value := range shape { var col types.Usage destAddr := &col if err := awsRestjson1_deserializeDocumentUsage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUsageTotal(v **types.UsageTotal, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UsageTotal if *v == nil { sv = &types.UsageTotal{} } 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 MeteringAccountId to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "usage": if err := awsRestjson1_deserializeDocumentUsageList(&sv.Usage, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUsageTotalList(v *[]types.UsageTotal, 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.UsageTotal if *v == nil { cv = []types.UsageTotal{} } else { cv = *v } for _, value := range shape { var col types.UsageTotal destAddr := &col if err := awsRestjson1_deserializeDocumentUsageTotal(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv 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 "fields": if err := awsRestjson1_deserializeDocumentValidationExceptionFields(&sv.Fields, value); err != nil { return err } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } 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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationExceptionFields(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_deserializeDocumentVulnerabilities(v *[]types.Vulnerability, 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.Vulnerability if *v == nil { cv = []types.Vulnerability{} } else { cv = *v } for _, value := range shape { var col types.Vulnerability destAddr := &col if err := awsRestjson1_deserializeDocumentVulnerability(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVulnerability(v **types.Vulnerability, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Vulnerability if *v == nil { sv = &types.Vulnerability{} } else { sv = *v } for key, value := range shape { switch key { case "atigData": if err := awsRestjson1_deserializeDocumentAtigData(&sv.AtigData, value); err != nil { return err } case "cisaData": if err := awsRestjson1_deserializeDocumentCisaData(&sv.CisaData, value); err != nil { return err } case "cvss2": if err := awsRestjson1_deserializeDocumentCvss2(&sv.Cvss2, value); err != nil { return err } case "cvss3": if err := awsRestjson1_deserializeDocumentCvss3(&sv.Cvss3, value); err != nil { return err } case "cwes": if err := awsRestjson1_deserializeDocumentCwes(&sv.Cwes, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VulnerabilityDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "detectionPlatforms": if err := awsRestjson1_deserializeDocumentDetectionPlatforms(&sv.DetectionPlatforms, value); err != nil { return err } case "epss": if err := awsRestjson1_deserializeDocumentEpss(&sv.Epss, value); err != nil { return err } case "exploitObserved": if err := awsRestjson1_deserializeDocumentExploitObserved(&sv.ExploitObserved, value); err != nil { return err } case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "referenceUrls": if err := awsRestjson1_deserializeDocumentVulnerabilityReferenceUrls(&sv.ReferenceUrls, value); err != nil { return err } case "relatedVulnerabilities": if err := awsRestjson1_deserializeDocumentRelatedVulnerabilities(&sv.RelatedVulnerabilities, value); err != nil { return err } case "source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VulnerabilitySource to be of type string, got %T instead", value) } sv.Source = types.VulnerabilitySource(jtv) } case "sourceUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VulnerabilitySourceUrl to be of type string, got %T instead", value) } sv.SourceUrl = ptr.String(jtv) } case "vendorCreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.VendorCreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected VendorCreatedAt to be a JSON Number, got %T instead", value) } } case "vendorSeverity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VendorSeverity to be of type string, got %T instead", value) } sv.VendorSeverity = ptr.String(jtv) } case "vendorUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.VendorUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected VendorUpdatedAt to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVulnerabilityIdList(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 VulnerabilityId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVulnerabilityReferenceUrls(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 VulnerabilityReferenceUrl to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVulnerablePackage(v **types.VulnerablePackage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VulnerablePackage if *v == nil { sv = &types.VulnerablePackage{} } else { sv = *v } for key, value := range shape { switch key { case "arch": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageArchitecture to be of type string, got %T instead", value) } sv.Arch = ptr.String(jtv) } case "epoch": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PackageEpoch to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Epoch = int32(i64) } case "filePath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilePath to be of type string, got %T instead", value) } sv.FilePath = ptr.String(jtv) } case "fixedInVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) } sv.FixedInVersion = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "packageManager": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageManager to be of type string, got %T instead", value) } sv.PackageManager = types.PackageManager(jtv) } case "release": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageRelease to be of type string, got %T instead", value) } sv.Release = ptr.String(jtv) } case "remediation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VulnerablePackageRemediation to be of type string, got %T instead", value) } sv.Remediation = ptr.String(jtv) } case "sourceLambdaLayerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LambdaLayerArn to be of type string, got %T instead", value) } sv.SourceLambdaLayerArn = ptr.String(jtv) } case "sourceLayerHash": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SourceLayerHash to be of type string, got %T instead", value) } sv.SourceLayerHash = ptr.String(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVulnerablePackageList(v *[]types.VulnerablePackage, 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.VulnerablePackage if *v == nil { cv = []types.VulnerablePackage{} } else { cv = *v } for _, value := range shape { var col types.VulnerablePackage destAddr := &col if err := awsRestjson1_deserializeDocumentVulnerablePackage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil }