// Code generated by smithy-go-codegen DO NOT EDIT. package securityhub import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "math" "strings" ) type awsRestjson1_deserializeOpAcceptAdministratorInvitation struct { } func (*awsRestjson1_deserializeOpAcceptAdministratorInvitation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAcceptAdministratorInvitation) 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_deserializeOpErrorAcceptAdministratorInvitation(response, &metadata) } output := &AcceptAdministratorInvitationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorAcceptAdministratorInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpAcceptInvitation struct { } func (*awsRestjson1_deserializeOpAcceptInvitation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpAcceptInvitation) 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_deserializeOpErrorAcceptInvitation(response, &metadata) } output := &AcceptInvitationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorAcceptInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpBatchDeleteAutomationRules struct { } func (*awsRestjson1_deserializeOpBatchDeleteAutomationRules) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchDeleteAutomationRules) 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_deserializeOpErrorBatchDeleteAutomationRules(response, &metadata) } output := &BatchDeleteAutomationRulesOutput{} 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_deserializeOpDocumentBatchDeleteAutomationRulesOutput(&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_deserializeOpErrorBatchDeleteAutomationRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchDeleteAutomationRulesOutput(v **BatchDeleteAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchDeleteAutomationRulesOutput if *v == nil { sv = &BatchDeleteAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ProcessedAutomationRules": if err := awsRestjson1_deserializeDocumentAutomationRulesArnsList(&sv.ProcessedAutomationRules, value); err != nil { return err } case "UnprocessedAutomationRules": if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(&sv.UnprocessedAutomationRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchDisableStandards struct { } func (*awsRestjson1_deserializeOpBatchDisableStandards) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchDisableStandards) 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_deserializeOpErrorBatchDisableStandards(response, &metadata) } output := &BatchDisableStandardsOutput{} 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_deserializeOpDocumentBatchDisableStandardsOutput(&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_deserializeOpErrorBatchDisableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(v **BatchDisableStandardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchDisableStandardsOutput if *v == nil { sv = &BatchDisableStandardsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "StandardsSubscriptions": if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchEnableStandards struct { } func (*awsRestjson1_deserializeOpBatchEnableStandards) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchEnableStandards) 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_deserializeOpErrorBatchEnableStandards(response, &metadata) } output := &BatchEnableStandardsOutput{} 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_deserializeOpDocumentBatchEnableStandardsOutput(&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_deserializeOpErrorBatchEnableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(v **BatchEnableStandardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchEnableStandardsOutput if *v == nil { sv = &BatchEnableStandardsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "StandardsSubscriptions": if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchGetAutomationRules struct { } func (*awsRestjson1_deserializeOpBatchGetAutomationRules) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchGetAutomationRules) 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_deserializeOpErrorBatchGetAutomationRules(response, &metadata) } output := &BatchGetAutomationRulesOutput{} 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_deserializeOpDocumentBatchGetAutomationRulesOutput(&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_deserializeOpErrorBatchGetAutomationRules(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchGetAutomationRulesOutput(v **BatchGetAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchGetAutomationRulesOutput if *v == nil { sv = &BatchGetAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Rules": if err := awsRestjson1_deserializeDocumentAutomationRulesConfigList(&sv.Rules, value); err != nil { return err } case "UnprocessedAutomationRules": if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(&sv.UnprocessedAutomationRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchGetSecurityControls struct { } func (*awsRestjson1_deserializeOpBatchGetSecurityControls) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchGetSecurityControls) 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_deserializeOpErrorBatchGetSecurityControls(response, &metadata) } output := &BatchGetSecurityControlsOutput{} 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_deserializeOpDocumentBatchGetSecurityControlsOutput(&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_deserializeOpErrorBatchGetSecurityControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchGetSecurityControlsOutput(v **BatchGetSecurityControlsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchGetSecurityControlsOutput if *v == nil { sv = &BatchGetSecurityControlsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityControls": if err := awsRestjson1_deserializeDocumentSecurityControls(&sv.SecurityControls, value); err != nil { return err } case "UnprocessedIds": if err := awsRestjson1_deserializeDocumentUnprocessedSecurityControls(&sv.UnprocessedIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchGetStandardsControlAssociations struct { } func (*awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchGetStandardsControlAssociations) 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_deserializeOpErrorBatchGetStandardsControlAssociations(response, &metadata) } output := &BatchGetStandardsControlAssociationsOutput{} 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_deserializeOpDocumentBatchGetStandardsControlAssociationsOutput(&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_deserializeOpErrorBatchGetStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchGetStandardsControlAssociationsOutput(v **BatchGetStandardsControlAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchGetStandardsControlAssociationsOutput if *v == nil { sv = &BatchGetStandardsControlAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "StandardsControlAssociationDetails": if err := awsRestjson1_deserializeDocumentStandardsControlAssociationDetails(&sv.StandardsControlAssociationDetails, value); err != nil { return err } case "UnprocessedAssociations": if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociations(&sv.UnprocessedAssociations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchImportFindings struct { } func (*awsRestjson1_deserializeOpBatchImportFindings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchImportFindings) 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_deserializeOpErrorBatchImportFindings(response, &metadata) } output := &BatchImportFindingsOutput{} 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_deserializeOpDocumentBatchImportFindingsOutput(&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_deserializeOpErrorBatchImportFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(v **BatchImportFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchImportFindingsOutput if *v == nil { sv = &BatchImportFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FailedCount": 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.FailedCount = int32(i64) } case "FailedFindings": if err := awsRestjson1_deserializeDocumentImportFindingsErrorList(&sv.FailedFindings, value); err != nil { return err } case "SuccessCount": 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.SuccessCount = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchUpdateAutomationRules struct { } func (*awsRestjson1_deserializeOpBatchUpdateAutomationRules) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchUpdateAutomationRules) 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_deserializeOpErrorBatchUpdateAutomationRules(response, &metadata) } output := &BatchUpdateAutomationRulesOutput{} 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_deserializeOpDocumentBatchUpdateAutomationRulesOutput(&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_deserializeOpErrorBatchUpdateAutomationRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchUpdateAutomationRulesOutput(v **BatchUpdateAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchUpdateAutomationRulesOutput if *v == nil { sv = &BatchUpdateAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ProcessedAutomationRules": if err := awsRestjson1_deserializeDocumentAutomationRulesArnsList(&sv.ProcessedAutomationRules, value); err != nil { return err } case "UnprocessedAutomationRules": if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(&sv.UnprocessedAutomationRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchUpdateFindings struct { } func (*awsRestjson1_deserializeOpBatchUpdateFindings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchUpdateFindings) 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_deserializeOpErrorBatchUpdateFindings(response, &metadata) } output := &BatchUpdateFindingsOutput{} 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_deserializeOpDocumentBatchUpdateFindingsOutput(&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_deserializeOpErrorBatchUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(v **BatchUpdateFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchUpdateFindingsOutput if *v == nil { sv = &BatchUpdateFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ProcessedFindings": if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifierList(&sv.ProcessedFindings, value); err != nil { return err } case "UnprocessedFindings": if err := awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFindingsList(&sv.UnprocessedFindings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations struct { } func (*awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchUpdateStandardsControlAssociations) 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_deserializeOpErrorBatchUpdateStandardsControlAssociations(response, &metadata) } output := &BatchUpdateStandardsControlAssociationsOutput{} 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_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOutput(&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_deserializeOpErrorBatchUpdateStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchUpdateStandardsControlAssociationsOutput(v **BatchUpdateStandardsControlAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *BatchUpdateStandardsControlAssociationsOutput if *v == nil { sv = &BatchUpdateStandardsControlAssociationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "UnprocessedAssociationUpdates": if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociationUpdates(&sv.UnprocessedAssociationUpdates, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateActionTarget struct { } func (*awsRestjson1_deserializeOpCreateActionTarget) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateActionTarget) 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_deserializeOpErrorCreateActionTarget(response, &metadata) } output := &CreateActionTargetOutput{} 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_deserializeOpDocumentCreateActionTargetOutput(&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_deserializeOpErrorCreateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceConflictException", errorCode): return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(v **CreateActionTargetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateActionTargetOutput if *v == nil { sv = &CreateActionTargetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ActionTargetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActionTargetArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateAutomationRule struct { } func (*awsRestjson1_deserializeOpCreateAutomationRule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateAutomationRule) 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_deserializeOpErrorCreateAutomationRule(response, &metadata) } output := &CreateAutomationRuleOutput{} 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_deserializeOpDocumentCreateAutomationRuleOutput(&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_deserializeOpErrorCreateAutomationRule(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateAutomationRuleOutput(v **CreateAutomationRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAutomationRuleOutput if *v == nil { sv = &CreateAutomationRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RuleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateFindingAggregator struct { } func (*awsRestjson1_deserializeOpCreateFindingAggregator) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateFindingAggregator) 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_deserializeOpErrorCreateFindingAggregator(response, &metadata) } output := &CreateFindingAggregatorOutput{} 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_deserializeOpDocumentCreateFindingAggregatorOutput(&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_deserializeOpErrorCreateFindingAggregator(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateFindingAggregatorOutput(v **CreateFindingAggregatorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateFindingAggregatorOutput if *v == nil { sv = &CreateFindingAggregatorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FindingAggregationRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingAggregationRegion = ptr.String(jtv) } case "FindingAggregatorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingAggregatorArn = ptr.String(jtv) } case "RegionLinkingMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegionLinkingMode = ptr.String(jtv) } case "Regions": if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateInsight struct { } func (*awsRestjson1_deserializeOpCreateInsight) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateInsight) 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_deserializeOpErrorCreateInsight(response, &metadata) } output := &CreateInsightOutput{} 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_deserializeOpDocumentCreateInsightOutput(&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_deserializeOpErrorCreateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceConflictException", errorCode): return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateInsightOutput(v **CreateInsightOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateInsightOutput if *v == nil { sv = &CreateInsightOutput{} } else { sv = *v } for key, value := range shape { switch key { case "InsightArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InsightArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateMembers struct { } func (*awsRestjson1_deserializeOpCreateMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateMembers) 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_deserializeOpErrorCreateMembers(response, &metadata) } output := &CreateMembersOutput{} 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_deserializeOpDocumentCreateMembersOutput(&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_deserializeOpErrorCreateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceConflictException", errorCode): return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateMembersOutput(v **CreateMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMembersOutput if *v == nil { sv = &CreateMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "UnprocessedAccounts": if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeclineInvitations struct { } func (*awsRestjson1_deserializeOpDeclineInvitations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeclineInvitations) 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_deserializeOpErrorDeclineInvitations(response, &metadata) } output := &DeclineInvitationsOutput{} 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_deserializeOpDocumentDeclineInvitationsOutput(&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_deserializeOpErrorDeclineInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(v **DeclineInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeclineInvitationsOutput if *v == nil { sv = &DeclineInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "UnprocessedAccounts": if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteActionTarget struct { } func (*awsRestjson1_deserializeOpDeleteActionTarget) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteActionTarget) 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_deserializeOpErrorDeleteActionTarget(response, &metadata) } output := &DeleteActionTargetOutput{} 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_deserializeOpDocumentDeleteActionTargetOutput(&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_deserializeOpErrorDeleteActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(v **DeleteActionTargetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteActionTargetOutput if *v == nil { sv = &DeleteActionTargetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ActionTargetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActionTargetArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteFindingAggregator struct { } func (*awsRestjson1_deserializeOpDeleteFindingAggregator) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteFindingAggregator) 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_deserializeOpErrorDeleteFindingAggregator(response, &metadata) } output := &DeleteFindingAggregatorOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteFindingAggregator(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteInsight struct { } func (*awsRestjson1_deserializeOpDeleteInsight) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteInsight) 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_deserializeOpErrorDeleteInsight(response, &metadata) } output := &DeleteInsightOutput{} 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_deserializeOpDocumentDeleteInsightOutput(&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_deserializeOpErrorDeleteInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteInsightOutput(v **DeleteInsightOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteInsightOutput if *v == nil { sv = &DeleteInsightOutput{} } else { sv = *v } for key, value := range shape { switch key { case "InsightArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InsightArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteInvitations struct { } func (*awsRestjson1_deserializeOpDeleteInvitations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteInvitations) 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_deserializeOpErrorDeleteInvitations(response, &metadata) } output := &DeleteInvitationsOutput{} 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_deserializeOpDocumentDeleteInvitationsOutput(&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_deserializeOpErrorDeleteInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(v **DeleteInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteInvitationsOutput if *v == nil { sv = &DeleteInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "UnprocessedAccounts": if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteMembers struct { } func (*awsRestjson1_deserializeOpDeleteMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteMembers) 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_deserializeOpErrorDeleteMembers(response, &metadata) } output := &DeleteMembersOutput{} 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_deserializeOpDocumentDeleteMembersOutput(&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_deserializeOpErrorDeleteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteMembersOutput(v **DeleteMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteMembersOutput if *v == nil { sv = &DeleteMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "UnprocessedAccounts": if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeActionTargets struct { } func (*awsRestjson1_deserializeOpDescribeActionTargets) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeActionTargets) 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_deserializeOpErrorDescribeActionTargets(response, &metadata) } output := &DescribeActionTargetsOutput{} 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_deserializeOpDocumentDescribeActionTargetsOutput(&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_deserializeOpErrorDescribeActionTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(v **DescribeActionTargetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeActionTargetsOutput if *v == nil { sv = &DescribeActionTargetsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ActionTargets": if err := awsRestjson1_deserializeDocumentActionTargetList(&sv.ActionTargets, 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_deserializeOpDescribeHub struct { } func (*awsRestjson1_deserializeOpDescribeHub) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeHub) 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_deserializeOpErrorDescribeHub(response, &metadata) } output := &DescribeHubOutput{} 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_deserializeOpDocumentDescribeHubOutput(&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_deserializeOpErrorDescribeHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeHubOutput(v **DescribeHubOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeHubOutput if *v == nil { sv = &DescribeHubOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AutoEnableControls": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoEnableControls = jtv } case "ControlFindingGenerator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ControlFindingGenerator to be of type string, got %T instead", value) } sv.ControlFindingGenerator = types.ControlFindingGenerator(jtv) } case "HubArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HubArn = ptr.String(jtv) } case "SubscribedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubscribedAt = 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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(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 value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoEnable = jtv } case "AutoEnableStandards": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AutoEnableStandards to be of type string, got %T instead", value) } sv.AutoEnableStandards = types.AutoEnableStandards(jtv) } case "MemberAccountLimitReached": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MemberAccountLimitReached = jtv } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeProducts struct { } func (*awsRestjson1_deserializeOpDescribeProducts) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeProducts) 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_deserializeOpErrorDescribeProducts(response, &metadata) } output := &DescribeProductsOutput{} 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_deserializeOpDocumentDescribeProductsOutput(&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_deserializeOpErrorDescribeProducts(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeProductsOutput(v **DescribeProductsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeProductsOutput if *v == nil { sv = &DescribeProductsOutput{} } 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 "Products": if err := awsRestjson1_deserializeDocumentProductsList(&sv.Products, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeStandards struct { } func (*awsRestjson1_deserializeOpDescribeStandards) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeStandards) 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_deserializeOpErrorDescribeStandards(response, &metadata) } output := &DescribeStandardsOutput{} 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_deserializeOpDocumentDescribeStandardsOutput(&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_deserializeOpErrorDescribeStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(v **DescribeStandardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeStandardsOutput if *v == nil { sv = &DescribeStandardsOutput{} } 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 "Standards": if err := awsRestjson1_deserializeDocumentStandards(&sv.Standards, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeStandardsControls struct { } func (*awsRestjson1_deserializeOpDescribeStandardsControls) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeStandardsControls) 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_deserializeOpErrorDescribeStandardsControls(response, &metadata) } output := &DescribeStandardsControlsOutput{} 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_deserializeOpDocumentDescribeStandardsControlsOutput(&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_deserializeOpErrorDescribeStandardsControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(v **DescribeStandardsControlsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeStandardsControlsOutput if *v == nil { sv = &DescribeStandardsControlsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Controls": if err := awsRestjson1_deserializeDocumentStandardsControls(&sv.Controls, 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_deserializeOpDisableImportFindingsForProduct struct { } func (*awsRestjson1_deserializeOpDisableImportFindingsForProduct) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisableImportFindingsForProduct) 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_deserializeOpErrorDisableImportFindingsForProduct(response, &metadata) } output := &DisableImportFindingsForProductOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisableOrganizationAdminAccount struct { } func (*awsRestjson1_deserializeOpDisableOrganizationAdminAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisableOrganizationAdminAccount) 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_deserializeOpErrorDisableOrganizationAdminAccount(response, &metadata) } output := &DisableOrganizationAdminAccountOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisableSecurityHub struct { } func (*awsRestjson1_deserializeOpDisableSecurityHub) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisableSecurityHub) 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_deserializeOpErrorDisableSecurityHub(response, &metadata) } output := &DisableSecurityHubOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisableSecurityHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisassociateFromAdministratorAccount struct { } func (*awsRestjson1_deserializeOpDisassociateFromAdministratorAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateFromAdministratorAccount) 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_deserializeOpErrorDisassociateFromAdministratorAccount(response, &metadata) } output := &DisassociateFromAdministratorAccountOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateFromAdministratorAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisassociateFromMasterAccount struct { } func (*awsRestjson1_deserializeOpDisassociateFromMasterAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateFromMasterAccount) 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_deserializeOpErrorDisassociateFromMasterAccount(response, &metadata) } output := &DisassociateFromMasterAccountOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDisassociateMembers struct { } func (*awsRestjson1_deserializeOpDisassociateMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDisassociateMembers) 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_deserializeOpErrorDisassociateMembers(response, &metadata) } output := &DisassociateMembersOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDisassociateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpEnableImportFindingsForProduct struct { } func (*awsRestjson1_deserializeOpEnableImportFindingsForProduct) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnableImportFindingsForProduct) 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_deserializeOpErrorEnableImportFindingsForProduct(response, &metadata) } output := &EnableImportFindingsForProductOutput{} 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_deserializeOpDocumentEnableImportFindingsForProductOutput(&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_deserializeOpErrorEnableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceConflictException", errorCode): return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentEnableImportFindingsForProductOutput(v **EnableImportFindingsForProductOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *EnableImportFindingsForProductOutput if *v == nil { sv = &EnableImportFindingsForProductOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ProductSubscriptionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductSubscriptionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpEnableOrganizationAdminAccount struct { } func (*awsRestjson1_deserializeOpEnableOrganizationAdminAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnableOrganizationAdminAccount) 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_deserializeOpErrorEnableOrganizationAdminAccount(response, &metadata) } output := &EnableOrganizationAdminAccountOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpEnableSecurityHub struct { } func (*awsRestjson1_deserializeOpEnableSecurityHub) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpEnableSecurityHub) 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_deserializeOpErrorEnableSecurityHub(response, &metadata) } output := &EnableSecurityHubOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorEnableSecurityHub(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceConflictException", errorCode): return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpGetAdministratorAccount struct { } func (*awsRestjson1_deserializeOpGetAdministratorAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetAdministratorAccount) 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_deserializeOpErrorGetAdministratorAccount(response, &metadata) } output := &GetAdministratorAccountOutput{} 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_deserializeOpDocumentGetAdministratorAccountOutput(&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_deserializeOpErrorGetAdministratorAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetAdministratorAccountOutput(v **GetAdministratorAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetAdministratorAccountOutput if *v == nil { sv = &GetAdministratorAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Administrator": if err := awsRestjson1_deserializeDocumentInvitation(&sv.Administrator, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetEnabledStandards struct { } func (*awsRestjson1_deserializeOpGetEnabledStandards) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetEnabledStandards) 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_deserializeOpErrorGetEnabledStandards(response, &metadata) } output := &GetEnabledStandardsOutput{} 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_deserializeOpDocumentGetEnabledStandardsOutput(&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_deserializeOpErrorGetEnabledStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(v **GetEnabledStandardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetEnabledStandardsOutput if *v == nil { sv = &GetEnabledStandardsOutput{} } 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 "StandardsSubscriptions": if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetFindingAggregator struct { } func (*awsRestjson1_deserializeOpGetFindingAggregator) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetFindingAggregator) 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_deserializeOpErrorGetFindingAggregator(response, &metadata) } output := &GetFindingAggregatorOutput{} 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_deserializeOpDocumentGetFindingAggregatorOutput(&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_deserializeOpErrorGetFindingAggregator(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetFindingAggregatorOutput(v **GetFindingAggregatorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetFindingAggregatorOutput if *v == nil { sv = &GetFindingAggregatorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FindingAggregationRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingAggregationRegion = ptr.String(jtv) } case "FindingAggregatorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingAggregatorArn = ptr.String(jtv) } case "RegionLinkingMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegionLinkingMode = ptr.String(jtv) } case "Regions": if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetFindingHistory struct { } func (*awsRestjson1_deserializeOpGetFindingHistory) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetFindingHistory) 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_deserializeOpErrorGetFindingHistory(response, &metadata) } output := &GetFindingHistoryOutput{} 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_deserializeOpDocumentGetFindingHistoryOutput(&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_deserializeOpErrorGetFindingHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetFindingHistoryOutput(v **GetFindingHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetFindingHistoryOutput if *v == nil { sv = &GetFindingHistoryOutput{} } 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 "Records": if err := awsRestjson1_deserializeDocumentFindingHistoryRecordList(&sv.Records, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetFindings struct { } func (*awsRestjson1_deserializeOpGetFindings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetFindings) 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_deserializeOpErrorGetFindings(response, &metadata) } output := &GetFindingsOutput{} 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_deserializeOpDocumentGetFindingsOutput(&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_deserializeOpErrorGetFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetFindingsOutput if *v == nil { sv = &GetFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Findings": if err := awsRestjson1_deserializeDocumentAwsSecurityFindingList(&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_deserializeOpGetInsightResults struct { } func (*awsRestjson1_deserializeOpGetInsightResults) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetInsightResults) 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_deserializeOpErrorGetInsightResults(response, &metadata) } output := &GetInsightResultsOutput{} 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_deserializeOpDocumentGetInsightResultsOutput(&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_deserializeOpErrorGetInsightResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(v **GetInsightResultsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetInsightResultsOutput if *v == nil { sv = &GetInsightResultsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "InsightResults": if err := awsRestjson1_deserializeDocumentInsightResults(&sv.InsightResults, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetInsights struct { } func (*awsRestjson1_deserializeOpGetInsights) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetInsights) 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_deserializeOpErrorGetInsights(response, &metadata) } output := &GetInsightsOutput{} 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_deserializeOpDocumentGetInsightsOutput(&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_deserializeOpErrorGetInsights(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetInsightsOutput(v **GetInsightsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetInsightsOutput if *v == nil { sv = &GetInsightsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Insights": if err := awsRestjson1_deserializeDocumentInsightList(&sv.Insights, 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_deserializeOpGetInvitationsCount struct { } func (*awsRestjson1_deserializeOpGetInvitationsCount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetInvitationsCount) 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_deserializeOpErrorGetInvitationsCount(response, &metadata) } output := &GetInvitationsCountOutput{} 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_deserializeOpDocumentGetInvitationsCountOutput(&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_deserializeOpErrorGetInvitationsCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(v **GetInvitationsCountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetInvitationsCountOutput if *v == nil { sv = &GetInvitationsCountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "InvitationsCount": 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.InvitationsCount = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetMasterAccount struct { } func (*awsRestjson1_deserializeOpGetMasterAccount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetMasterAccount) 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_deserializeOpErrorGetMasterAccount(response, &metadata) } output := &GetMasterAccountOutput{} 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_deserializeOpDocumentGetMasterAccountOutput(&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_deserializeOpErrorGetMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(v **GetMasterAccountOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMasterAccountOutput if *v == nil { sv = &GetMasterAccountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Master": if err := awsRestjson1_deserializeDocumentInvitation(&sv.Master, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetMembers struct { } func (*awsRestjson1_deserializeOpGetMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetMembers) 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_deserializeOpErrorGetMembers(response, &metadata) } output := &GetMembersOutput{} 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_deserializeOpDocumentGetMembersOutput(&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_deserializeOpErrorGetMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMembersOutput if *v == nil { sv = &GetMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Members": if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { return err } case "UnprocessedAccounts": if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpInviteMembers struct { } func (*awsRestjson1_deserializeOpInviteMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpInviteMembers) 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_deserializeOpErrorInviteMembers(response, &metadata) } output := &InviteMembersOutput{} 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_deserializeOpDocumentInviteMembersOutput(&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_deserializeOpErrorInviteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentInviteMembersOutput(v **InviteMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *InviteMembersOutput if *v == nil { sv = &InviteMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "UnprocessedAccounts": if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAutomationRules struct { } func (*awsRestjson1_deserializeOpListAutomationRules) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAutomationRules) 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_deserializeOpErrorListAutomationRules(response, &metadata) } output := &ListAutomationRulesOutput{} 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_deserializeOpDocumentListAutomationRulesOutput(&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_deserializeOpErrorListAutomationRules(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListAutomationRulesOutput(v **ListAutomationRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAutomationRulesOutput if *v == nil { sv = &ListAutomationRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AutomationRulesMetadata": if err := awsRestjson1_deserializeDocumentAutomationRulesMetadataList(&sv.AutomationRulesMetadata, 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_deserializeOpListEnabledProductsForImport struct { } func (*awsRestjson1_deserializeOpListEnabledProductsForImport) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListEnabledProductsForImport) 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_deserializeOpErrorListEnabledProductsForImport(response, &metadata) } output := &ListEnabledProductsForImportOutput{} 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_deserializeOpDocumentListEnabledProductsForImportOutput(&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_deserializeOpErrorListEnabledProductsForImport(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(v **ListEnabledProductsForImportOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListEnabledProductsForImportOutput if *v == nil { sv = &ListEnabledProductsForImportOutput{} } 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 "ProductSubscriptions": if err := awsRestjson1_deserializeDocumentProductSubscriptionArnList(&sv.ProductSubscriptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListFindingAggregators struct { } func (*awsRestjson1_deserializeOpListFindingAggregators) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListFindingAggregators) 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_deserializeOpErrorListFindingAggregators(response, &metadata) } output := &ListFindingAggregatorsOutput{} 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_deserializeOpDocumentListFindingAggregatorsOutput(&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_deserializeOpErrorListFindingAggregators(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListFindingAggregatorsOutput(v **ListFindingAggregatorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListFindingAggregatorsOutput if *v == nil { sv = &ListFindingAggregatorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FindingAggregators": if err := awsRestjson1_deserializeDocumentFindingAggregatorList(&sv.FindingAggregators, 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_deserializeOpListInvitations struct { } func (*awsRestjson1_deserializeOpListInvitations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListInvitations) 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_deserializeOpErrorListInvitations(response, &metadata) } output := &ListInvitationsOutput{} 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_deserializeOpDocumentListInvitationsOutput(&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_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListInvitationsOutput if *v == nil { sv = &ListInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Invitations": if err := awsRestjson1_deserializeDocumentInvitationList(&sv.Invitations, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(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 NonEmptyString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListOrganizationAdminAccounts struct { } func (*awsRestjson1_deserializeOpListOrganizationAdminAccounts) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) 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_deserializeOpErrorListOrganizationAdminAccounts(response, &metadata) } output := &ListOrganizationAdminAccountsOutput{} 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_deserializeOpDocumentListOrganizationAdminAccountsOutput(&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_deserializeOpErrorListOrganizationAdminAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **ListOrganizationAdminAccountsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListOrganizationAdminAccountsOutput if *v == nil { sv = &ListOrganizationAdminAccountsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AdminAccounts": if err := awsRestjson1_deserializeDocumentAdminAccounts(&sv.AdminAccounts, 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_deserializeOpListSecurityControlDefinitions struct { } func (*awsRestjson1_deserializeOpListSecurityControlDefinitions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSecurityControlDefinitions) 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_deserializeOpErrorListSecurityControlDefinitions(response, &metadata) } output := &ListSecurityControlDefinitionsOutput{} 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_deserializeOpDocumentListSecurityControlDefinitionsOutput(&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_deserializeOpErrorListSecurityControlDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSecurityControlDefinitionsOutput(v **ListSecurityControlDefinitionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSecurityControlDefinitionsOutput if *v == nil { sv = &ListSecurityControlDefinitionsOutput{} } 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 "SecurityControlDefinitions": if err := awsRestjson1_deserializeDocumentSecurityControlDefinitions(&sv.SecurityControlDefinitions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListStandardsControlAssociations struct { } func (*awsRestjson1_deserializeOpListStandardsControlAssociations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListStandardsControlAssociations) 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_deserializeOpErrorListStandardsControlAssociations(response, &metadata) } output := &ListStandardsControlAssociationsOutput{} 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_deserializeOpDocumentListStandardsControlAssociationsOutput(&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_deserializeOpErrorListStandardsControlAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListStandardsControlAssociationsOutput(v **ListStandardsControlAssociationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListStandardsControlAssociationsOutput if *v == nil { sv = &ListStandardsControlAssociationsOutput{} } 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 "StandardsControlAssociationSummaries": if err := awsRestjson1_deserializeDocumentStandardsControlAssociationSummaries(&sv.StandardsControlAssociationSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(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_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateActionTarget struct { } func (*awsRestjson1_deserializeOpUpdateActionTarget) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateActionTarget) 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_deserializeOpErrorUpdateActionTarget(response, &metadata) } output := &UpdateActionTargetOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateFindingAggregator struct { } func (*awsRestjson1_deserializeOpUpdateFindingAggregator) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateFindingAggregator) 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_deserializeOpErrorUpdateFindingAggregator(response, &metadata) } output := &UpdateFindingAggregatorOutput{} 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_deserializeOpDocumentUpdateFindingAggregatorOutput(&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_deserializeOpErrorUpdateFindingAggregator(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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateFindingAggregatorOutput(v **UpdateFindingAggregatorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateFindingAggregatorOutput if *v == nil { sv = &UpdateFindingAggregatorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FindingAggregationRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingAggregationRegion = ptr.String(jtv) } case "FindingAggregatorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingAggregatorArn = ptr.String(jtv) } case "RegionLinkingMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegionLinkingMode = ptr.String(jtv) } case "Regions": if err := awsRestjson1_deserializeDocumentStringList(&sv.Regions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateFindings struct { } func (*awsRestjson1_deserializeOpUpdateFindings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateFindings) 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_deserializeOpErrorUpdateFindings(response, &metadata) } output := &UpdateFindingsOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateInsight struct { } func (*awsRestjson1_deserializeOpUpdateInsight) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateInsight) 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_deserializeOpErrorUpdateInsight(response, &metadata) } output := &UpdateInsightOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } 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 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("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateSecurityHubConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) 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_deserializeOpErrorUpdateSecurityHubConfiguration(response, &metadata) } output := &UpdateSecurityHubConfigurationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateSecurityHubConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateStandardsControl struct { } func (*awsRestjson1_deserializeOpUpdateStandardsControl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateStandardsControl) 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_deserializeOpErrorUpdateStandardsControl(response, &metadata) } output := &UpdateStandardsControlOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateStandardsControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidAccessException", errorCode): return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } 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_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInvalidAccessException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidAccessException{} 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_deserializeDocumentInvalidAccessException(&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_deserializeErrorInvalidInputException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidInputException{} 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_deserializeDocumentInvalidInputException(&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_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.LimitExceededException{} 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_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceConflictException{} 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_deserializeDocumentResourceConflictException(&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_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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAction(v **types.Action, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Action if *v == nil { sv = &types.Action{} } else { sv = *v } for key, value := range shape { switch key { case "ActionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActionType = ptr.String(jtv) } case "AwsApiCallAction": if err := awsRestjson1_deserializeDocumentAwsApiCallAction(&sv.AwsApiCallAction, value); err != nil { return err } case "DnsRequestAction": if err := awsRestjson1_deserializeDocumentDnsRequestAction(&sv.DnsRequestAction, value); err != nil { return err } case "NetworkConnectionAction": if err := awsRestjson1_deserializeDocumentNetworkConnectionAction(&sv.NetworkConnectionAction, value); err != nil { return err } case "PortProbeAction": if err := awsRestjson1_deserializeDocumentPortProbeAction(&sv.PortProbeAction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActionList(v *[]types.AutomationRulesAction, 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.AutomationRulesAction if *v == nil { cv = []types.AutomationRulesAction{} } else { cv = *v } for _, value := range shape { var col types.AutomationRulesAction destAddr := &col if err := awsRestjson1_deserializeDocumentAutomationRulesAction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentActionLocalIpDetails(v **types.ActionLocalIpDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActionLocalIpDetails if *v == nil { sv = &types.ActionLocalIpDetails{} } else { sv = *v } for key, value := range shape { switch key { case "IpAddressV4": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IpAddressV4 = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActionLocalPortDetails(v **types.ActionLocalPortDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActionLocalPortDetails if *v == nil { sv = &types.ActionLocalPortDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Port": 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.Port = int32(i64) } case "PortName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PortName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActionRemoteIpDetails(v **types.ActionRemoteIpDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActionRemoteIpDetails if *v == nil { sv = &types.ActionRemoteIpDetails{} } else { sv = *v } for key, value := range shape { switch key { case "City": if err := awsRestjson1_deserializeDocumentCity(&sv.City, value); err != nil { return err } case "Country": if err := awsRestjson1_deserializeDocumentCountry(&sv.Country, value); err != nil { return err } case "GeoLocation": if err := awsRestjson1_deserializeDocumentGeoLocation(&sv.GeoLocation, value); err != nil { return err } case "IpAddressV4": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IpAddressV4 = ptr.String(jtv) } case "Organization": if err := awsRestjson1_deserializeDocumentIpOrganizationDetails(&sv.Organization, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActionRemotePortDetails(v **types.ActionRemotePortDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActionRemotePortDetails if *v == nil { sv = &types.ActionRemotePortDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Port": 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.Port = int32(i64) } case "PortName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PortName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActionTarget(v **types.ActionTarget, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActionTarget if *v == nil { sv = &types.ActionTarget{} } else { sv = *v } for key, value := range shape { switch key { case "ActionTargetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActionTargetArn = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActionTargetList(v *[]types.ActionTarget, 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.ActionTarget if *v == nil { cv = []types.ActionTarget{} } else { cv = *v } for _, value := range shape { var col types.ActionTarget destAddr := &col if err := awsRestjson1_deserializeDocumentActionTarget(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAdjustment(v **types.Adjustment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Adjustment if *v == nil { sv = &types.Adjustment{} } 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_deserializeDocumentAdjustmentList(v *[]types.Adjustment, 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.Adjustment if *v == nil { cv = []types.Adjustment{} } else { cv = *v } for _, value := range shape { var col types.Adjustment destAddr := &col if err := awsRestjson1_deserializeDocumentAdjustment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAdminAccount(v **types.AdminAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AdminAccount if *v == nil { sv = &types.AdminAccount{} } 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 NonEmptyString 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 AdminStatus to be of type string, got %T instead", value) } sv.Status = types.AdminStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAdminAccounts(v *[]types.AdminAccount, 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.AdminAccount if *v == nil { cv = []types.AdminAccount{} } else { cv = *v } for _, value := range shape { var col types.AdminAccount destAddr := &col if err := awsRestjson1_deserializeDocumentAdminAccount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssociatedStandard(v **types.AssociatedStandard, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AssociatedStandard if *v == nil { sv = &types.AssociatedStandard{} } else { sv = *v } for key, value := range shape { switch key { case "StandardsId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssociatedStandardsList(v *[]types.AssociatedStandard, 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.AssociatedStandard if *v == nil { cv = []types.AssociatedStandard{} } else { cv = *v } for _, value := range shape { var col types.AssociatedStandard destAddr := &col if err := awsRestjson1_deserializeDocumentAssociatedStandard(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssociationSetDetails(v **types.AssociationSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AssociationSetDetails if *v == nil { sv = &types.AssociationSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AssociationState": if err := awsRestjson1_deserializeDocumentAssociationStateDetails(&sv.AssociationState, value); err != nil { return err } case "GatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GatewayId = ptr.String(jtv) } case "Main": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Main = jtv } case "RouteTableAssociationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RouteTableAssociationId = ptr.String(jtv) } case "RouteTableId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RouteTableId = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssociationSetList(v *[]types.AssociationSetDetails, 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.AssociationSetDetails if *v == nil { cv = []types.AssociationSetDetails{} } else { cv = *v } for _, value := range shape { var col types.AssociationSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAssociationSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssociationStateDetails(v **types.AssociationStateDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AssociationStateDetails if *v == nil { sv = &types.AssociationStateDetails{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } case "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutomationRulesAction(v **types.AutomationRulesAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AutomationRulesAction if *v == nil { sv = &types.AutomationRulesAction{} } else { sv = *v } for key, value := range shape { switch key { case "FindingFieldsUpdate": if err := awsRestjson1_deserializeDocumentAutomationRulesFindingFieldsUpdate(&sv.FindingFieldsUpdate, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AutomationRulesActionType to be of type string, got %T instead", value) } sv.Type = types.AutomationRulesActionType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutomationRulesArnsList(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_deserializeDocumentAutomationRulesConfig(v **types.AutomationRulesConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AutomationRulesConfig if *v == nil { sv = &types.AutomationRulesConfig{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentActionList(&sv.Actions, value); err != nil { return err } case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedAt = ptr.Time(t) } case "CreatedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedBy = ptr.String(jtv) } case "Criteria": if err := awsRestjson1_deserializeDocumentAutomationRulesFindingFilters(&sv.Criteria, value); err != nil { return err } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "IsTerminal": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsTerminal = jtv } case "RuleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleArn = ptr.String(jtv) } case "RuleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleName = ptr.String(jtv) } case "RuleOrder": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RuleOrderValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RuleOrder = int32(i64) } case "RuleStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RuleStatus to be of type string, got %T instead", value) } sv.RuleStatus = types.RuleStatus(jtv) } case "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutomationRulesConfigList(v *[]types.AutomationRulesConfig, 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.AutomationRulesConfig if *v == nil { cv = []types.AutomationRulesConfig{} } else { cv = *v } for _, value := range shape { var col types.AutomationRulesConfig destAddr := &col if err := awsRestjson1_deserializeDocumentAutomationRulesConfig(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAutomationRulesFindingFieldsUpdate(v **types.AutomationRulesFindingFieldsUpdate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AutomationRulesFindingFieldsUpdate if *v == nil { sv = &types.AutomationRulesFindingFieldsUpdate{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Confidence = int32(i64) } case "Criticality": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Criticality = int32(i64) } case "Note": if err := awsRestjson1_deserializeDocumentNoteUpdate(&sv.Note, value); err != nil { return err } case "RelatedFindings": if err := awsRestjson1_deserializeDocumentRelatedFindingList(&sv.RelatedFindings, value); err != nil { return err } case "Severity": if err := awsRestjson1_deserializeDocumentSeverityUpdate(&sv.Severity, value); err != nil { return err } case "Types": if err := awsRestjson1_deserializeDocumentTypeList(&sv.Types, value); err != nil { return err } case "UserDefinedFields": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.UserDefinedFields, value); err != nil { return err } case "VerificationState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VerificationState to be of type string, got %T instead", value) } sv.VerificationState = types.VerificationState(jtv) } case "Workflow": if err := awsRestjson1_deserializeDocumentWorkflowUpdate(&sv.Workflow, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutomationRulesFindingFilters(v **types.AutomationRulesFindingFilters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AutomationRulesFindingFilters if *v == nil { sv = &types.AutomationRulesFindingFilters{} } else { sv = *v } for key, value := range shape { switch key { case "AwsAccountId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.AwsAccountId, value); err != nil { return err } case "CompanyName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.CompanyName, value); err != nil { return err } case "ComplianceAssociatedStandardsId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceAssociatedStandardsId, value); err != nil { return err } case "ComplianceSecurityControlId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceSecurityControlId, value); err != nil { return err } case "ComplianceStatus": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceStatus, value); err != nil { return err } case "Confidence": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Confidence, value); err != nil { return err } case "CreatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.CreatedAt, value); err != nil { return err } case "Criticality": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Criticality, value); err != nil { return err } case "Description": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Description, value); err != nil { return err } case "FirstObservedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.FirstObservedAt, value); err != nil { return err } case "GeneratorId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.GeneratorId, value); err != nil { return err } case "Id": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Id, value); err != nil { return err } case "LastObservedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.LastObservedAt, value); err != nil { return err } case "NoteText": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteText, value); err != nil { return err } case "NoteUpdatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.NoteUpdatedAt, value); err != nil { return err } case "NoteUpdatedBy": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteUpdatedBy, value); err != nil { return err } case "ProductArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductArn, value); err != nil { return err } case "ProductName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductName, value); err != nil { return err } case "RecordState": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RecordState, value); err != nil { return err } case "RelatedFindingsId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsId, value); err != nil { return err } case "RelatedFindingsProductArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsProductArn, value); err != nil { return err } case "ResourceDetailsOther": if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ResourceDetailsOther, value); err != nil { return err } case "ResourceId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceId, value); err != nil { return err } case "ResourcePartition": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourcePartition, value); err != nil { return err } case "ResourceRegion": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceRegion, 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 "SeverityLabel": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SeverityLabel, value); err != nil { return err } case "SourceUrl": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SourceUrl, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Title, value); err != nil { return err } case "Type": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Type, value); err != nil { return err } case "UpdatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.UpdatedAt, value); err != nil { return err } case "UserDefinedFields": if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.UserDefinedFields, value); err != nil { return err } case "VerificationState": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VerificationState, value); err != nil { return err } case "WorkflowStatus": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.WorkflowStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutomationRulesMetadata(v **types.AutomationRulesMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AutomationRulesMetadata if *v == nil { sv = &types.AutomationRulesMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedAt = ptr.Time(t) } case "CreatedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedBy = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "IsTerminal": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsTerminal = jtv } case "RuleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleArn = ptr.String(jtv) } case "RuleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleName = ptr.String(jtv) } case "RuleOrder": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RuleOrderValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RuleOrder = int32(i64) } case "RuleStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RuleStatus to be of type string, got %T instead", value) } sv.RuleStatus = types.RuleStatus(jtv) } case "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutomationRulesMetadataList(v *[]types.AutomationRulesMetadata, 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.AutomationRulesMetadata if *v == nil { cv = []types.AutomationRulesMetadata{} } else { cv = *v } for _, value := range shape { var col types.AutomationRulesMetadata destAddr := &col if err := awsRestjson1_deserializeDocumentAutomationRulesMetadata(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AvailabilityZone if *v == nil { sv = &types.AvailabilityZone{} } else { sv = *v } for key, value := range shape { switch key { 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 "ZoneName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ZoneName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAvailabilityZones(v *[]types.AvailabilityZone, 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.AvailabilityZone if *v == nil { cv = []types.AvailabilityZone{} } else { cv = *v } for _, value := range shape { var col types.AvailabilityZone destAddr := &col if err := awsRestjson1_deserializeDocumentAvailabilityZone(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerDetails(v **types.AwsAmazonMqBrokerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAmazonMqBrokerDetails if *v == nil { sv = &types.AwsAmazonMqBrokerDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AuthenticationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AuthenticationStrategy = ptr.String(jtv) } case "AutoMinorVersionUpgrade": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoMinorVersionUpgrade = jtv } case "BrokerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BrokerArn = ptr.String(jtv) } case "BrokerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BrokerId = ptr.String(jtv) } case "BrokerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BrokerName = ptr.String(jtv) } case "DeploymentMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeploymentMode = ptr.String(jtv) } case "EncryptionOptions": if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerEncryptionOptionsDetails(&sv.EncryptionOptions, value); err != nil { return err } case "EngineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineType = ptr.String(jtv) } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "HostInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HostInstanceType = ptr.String(jtv) } case "LdapServerMetadata": if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerLdapServerMetadataDetails(&sv.LdapServerMetadata, value); err != nil { return err } case "Logs": if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerLogsDetails(&sv.Logs, value); err != nil { return err } case "MaintenanceWindowStartTime": if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerMaintenanceWindowStartTimeDetails(&sv.MaintenanceWindowStartTime, value); err != nil { return err } case "PubliclyAccessible": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PubliclyAccessible = jtv } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentStringList(&sv.SecurityGroups, value); err != nil { return err } case "StorageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StorageType = ptr.String(jtv) } case "SubnetIds": if err := awsRestjson1_deserializeDocumentStringList(&sv.SubnetIds, value); err != nil { return err } case "Users": if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerUsersList(&sv.Users, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerEncryptionOptionsDetails(v **types.AwsAmazonMqBrokerEncryptionOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAmazonMqBrokerEncryptionOptionsDetails if *v == nil { sv = &types.AwsAmazonMqBrokerEncryptionOptionsDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "UseAwsOwnedKey": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseAwsOwnedKey = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerLdapServerMetadataDetails(v **types.AwsAmazonMqBrokerLdapServerMetadataDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAmazonMqBrokerLdapServerMetadataDetails if *v == nil { sv = &types.AwsAmazonMqBrokerLdapServerMetadataDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Hosts": if err := awsRestjson1_deserializeDocumentStringList(&sv.Hosts, value); err != nil { return err } case "RoleBase": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleBase = ptr.String(jtv) } case "RoleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } case "RoleSearchMatching": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleSearchMatching = ptr.String(jtv) } case "RoleSearchSubtree": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RoleSearchSubtree = jtv } case "ServiceAccountUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceAccountUsername = ptr.String(jtv) } case "UserBase": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserBase = ptr.String(jtv) } case "UserRoleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserRoleName = ptr.String(jtv) } case "UserSearchMatching": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserSearchMatching = ptr.String(jtv) } case "UserSearchSubtree": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UserSearchSubtree = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerLogsDetails(v **types.AwsAmazonMqBrokerLogsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAmazonMqBrokerLogsDetails if *v == nil { sv = &types.AwsAmazonMqBrokerLogsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Audit": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Audit = jtv } case "AuditLogGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AuditLogGroup = ptr.String(jtv) } case "General": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.General = jtv } case "GeneralLogGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GeneralLogGroup = ptr.String(jtv) } case "Pending": if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerLogsPendingDetails(&sv.Pending, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerLogsPendingDetails(v **types.AwsAmazonMqBrokerLogsPendingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAmazonMqBrokerLogsPendingDetails if *v == nil { sv = &types.AwsAmazonMqBrokerLogsPendingDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Audit": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Audit = jtv } case "General": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.General = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerMaintenanceWindowStartTimeDetails(v **types.AwsAmazonMqBrokerMaintenanceWindowStartTimeDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAmazonMqBrokerMaintenanceWindowStartTimeDetails if *v == nil { sv = &types.AwsAmazonMqBrokerMaintenanceWindowStartTimeDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DayOfWeek": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DayOfWeek = ptr.String(jtv) } case "TimeOfDay": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TimeOfDay = ptr.String(jtv) } case "TimeZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TimeZone = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerUsersDetails(v **types.AwsAmazonMqBrokerUsersDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAmazonMqBrokerUsersDetails if *v == nil { sv = &types.AwsAmazonMqBrokerUsersDetails{} } else { sv = *v } for key, value := range shape { switch key { case "PendingChange": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PendingChange = ptr.String(jtv) } case "Username": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Username = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAmazonMqBrokerUsersList(v *[]types.AwsAmazonMqBrokerUsersDetails, 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.AwsAmazonMqBrokerUsersDetails if *v == nil { cv = []types.AwsAmazonMqBrokerUsersDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsAmazonMqBrokerUsersDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerUsersDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsApiCallAction(v **types.AwsApiCallAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiCallAction if *v == nil { sv = &types.AwsApiCallAction{} } else { sv = *v } for key, value := range shape { switch key { case "AffectedResources": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.AffectedResources, value); err != nil { return err } case "Api": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Api = ptr.String(jtv) } case "CallerType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CallerType = ptr.String(jtv) } case "DomainDetails": if err := awsRestjson1_deserializeDocumentAwsApiCallActionDomainDetails(&sv.DomainDetails, value); err != nil { return err } case "FirstSeen": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirstSeen = ptr.String(jtv) } case "LastSeen": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastSeen = ptr.String(jtv) } case "RemoteIpDetails": if err := awsRestjson1_deserializeDocumentActionRemoteIpDetails(&sv.RemoteIpDetails, value); err != nil { return err } case "ServiceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsApiCallActionDomainDetails(v **types.AwsApiCallActionDomainDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiCallActionDomainDetails if *v == nil { sv = &types.AwsApiCallActionDomainDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsApiGatewayAccessLogSettings(v **types.AwsApiGatewayAccessLogSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayAccessLogSettings if *v == nil { sv = &types.AwsApiGatewayAccessLogSettings{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationArn = ptr.String(jtv) } case "Format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Format = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsApiGatewayCanarySettings(v **types.AwsApiGatewayCanarySettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayCanarySettings if *v == nil { sv = &types.AwsApiGatewayCanarySettings{} } else { sv = *v } for key, value := range shape { switch key { case "DeploymentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeploymentId = ptr.String(jtv) } case "PercentTraffic": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.PercentTraffic = 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.PercentTraffic = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "StageVariableOverrides": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.StageVariableOverrides, value); err != nil { return err } case "UseStageCache": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseStageCache = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsApiGatewayEndpointConfiguration(v **types.AwsApiGatewayEndpointConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayEndpointConfiguration if *v == nil { sv = &types.AwsApiGatewayEndpointConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Types": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Types, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettings(v **types.AwsApiGatewayMethodSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayMethodSettings if *v == nil { sv = &types.AwsApiGatewayMethodSettings{} } else { sv = *v } for key, value := range shape { switch key { case "CacheDataEncrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CacheDataEncrypted = jtv } case "CacheTtlInSeconds": 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.CacheTtlInSeconds = int32(i64) } case "CachingEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CachingEnabled = jtv } case "DataTraceEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DataTraceEnabled = jtv } case "HttpMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpMethod = ptr.String(jtv) } case "LoggingLevel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LoggingLevel = ptr.String(jtv) } case "MetricsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MetricsEnabled = jtv } case "RequireAuthorizationForCacheControl": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RequireAuthorizationForCacheControl = jtv } case "ResourcePath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourcePath = ptr.String(jtv) } case "ThrottlingBurstLimit": 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.ThrottlingBurstLimit = int32(i64) } case "ThrottlingRateLimit": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ThrottlingRateLimit = 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.ThrottlingRateLimit = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "UnauthorizedCacheControlHeaderStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UnauthorizedCacheControlHeaderStrategy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettingsList(v *[]types.AwsApiGatewayMethodSettings, 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.AwsApiGatewayMethodSettings if *v == nil { cv = []types.AwsApiGatewayMethodSettings{} } else { cv = *v } for _, value := range shape { var col types.AwsApiGatewayMethodSettings destAddr := &col if err := awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettings(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsApiGatewayRestApiDetails(v **types.AwsApiGatewayRestApiDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayRestApiDetails if *v == nil { sv = &types.AwsApiGatewayRestApiDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ApiKeySource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApiKeySource = ptr.String(jtv) } case "BinaryMediaTypes": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.BinaryMediaTypes, value); err != nil { return err } case "CreatedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedDate = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "EndpointConfiguration": if err := awsRestjson1_deserializeDocumentAwsApiGatewayEndpointConfiguration(&sv.EndpointConfiguration, 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 "MinimumCompressionSize": 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.MinimumCompressionSize = int32(i64) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = 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_deserializeDocumentAwsApiGatewayStageDetails(v **types.AwsApiGatewayStageDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayStageDetails if *v == nil { sv = &types.AwsApiGatewayStageDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessLogSettings": if err := awsRestjson1_deserializeDocumentAwsApiGatewayAccessLogSettings(&sv.AccessLogSettings, value); err != nil { return err } case "CacheClusterEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CacheClusterEnabled = jtv } case "CacheClusterSize": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CacheClusterSize = ptr.String(jtv) } case "CacheClusterStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CacheClusterStatus = ptr.String(jtv) } case "CanarySettings": if err := awsRestjson1_deserializeDocumentAwsApiGatewayCanarySettings(&sv.CanarySettings, value); err != nil { return err } case "ClientCertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClientCertificateId = ptr.String(jtv) } case "CreatedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedDate = ptr.String(jtv) } case "DeploymentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeploymentId = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "DocumentationVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DocumentationVersion = ptr.String(jtv) } case "LastUpdatedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastUpdatedDate = ptr.String(jtv) } case "MethodSettings": if err := awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettingsList(&sv.MethodSettings, value); err != nil { return err } case "StageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StageName = ptr.String(jtv) } case "TracingEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.TracingEnabled = jtv } case "Variables": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Variables, value); err != nil { return err } case "WebAclArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WebAclArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsApiGatewayV2ApiDetails(v **types.AwsApiGatewayV2ApiDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayV2ApiDetails if *v == nil { sv = &types.AwsApiGatewayV2ApiDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ApiEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApiEndpoint = ptr.String(jtv) } case "ApiId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApiId = ptr.String(jtv) } case "ApiKeySelectionExpression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApiKeySelectionExpression = ptr.String(jtv) } case "CorsConfiguration": if err := awsRestjson1_deserializeDocumentAwsCorsConfiguration(&sv.CorsConfiguration, value); err != nil { return err } case "CreatedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedDate = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ProtocolType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProtocolType = ptr.String(jtv) } case "RouteSelectionExpression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RouteSelectionExpression = 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_deserializeDocumentAwsApiGatewayV2RouteSettings(v **types.AwsApiGatewayV2RouteSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayV2RouteSettings if *v == nil { sv = &types.AwsApiGatewayV2RouteSettings{} } else { sv = *v } for key, value := range shape { switch key { case "DataTraceEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DataTraceEnabled = jtv } case "DetailedMetricsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DetailedMetricsEnabled = jtv } case "LoggingLevel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LoggingLevel = ptr.String(jtv) } case "ThrottlingBurstLimit": 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.ThrottlingBurstLimit = int32(i64) } case "ThrottlingRateLimit": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ThrottlingRateLimit = 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.ThrottlingRateLimit = 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_deserializeDocumentAwsApiGatewayV2StageDetails(v **types.AwsApiGatewayV2StageDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsApiGatewayV2StageDetails if *v == nil { sv = &types.AwsApiGatewayV2StageDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessLogSettings": if err := awsRestjson1_deserializeDocumentAwsApiGatewayAccessLogSettings(&sv.AccessLogSettings, value); err != nil { return err } case "ApiGatewayManaged": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ApiGatewayManaged = jtv } case "AutoDeploy": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoDeploy = jtv } case "ClientCertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClientCertificateId = ptr.String(jtv) } case "CreatedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedDate = ptr.String(jtv) } case "DefaultRouteSettings": if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2RouteSettings(&sv.DefaultRouteSettings, value); err != nil { return err } case "DeploymentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeploymentId = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "LastDeploymentStatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastDeploymentStatusMessage = ptr.String(jtv) } case "LastUpdatedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastUpdatedDate = ptr.String(jtv) } case "RouteSettings": if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2RouteSettings(&sv.RouteSettings, value); err != nil { return err } case "StageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StageName = ptr.String(jtv) } case "StageVariables": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.StageVariables, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails(v **types.AwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails if *v == nil { sv = &types.AwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AuthenticationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AuthenticationType = ptr.String(jtv) } case "LambdaAuthorizerConfig": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiLambdaAuthorizerConfigDetails(&sv.LambdaAuthorizerConfig, value); err != nil { return err } case "OpenIdConnectConfig": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiOpenIdConnectConfigDetails(&sv.OpenIdConnectConfig, value); err != nil { return err } case "UserPoolConfig": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiUserPoolConfigDetails(&sv.UserPoolConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiAdditionalAuthenticationProvidersList(v *[]types.AwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails, 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.AwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails if *v == nil { cv = []types.AwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiAdditionalAuthenticationProvidersDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiDetails(v **types.AwsAppSyncGraphQlApiDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAppSyncGraphQlApiDetails if *v == nil { sv = &types.AwsAppSyncGraphQlApiDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AdditionalAuthenticationProviders": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiAdditionalAuthenticationProvidersList(&sv.AdditionalAuthenticationProviders, value); err != nil { return err } case "ApiId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApiId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AuthenticationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AuthenticationType = ptr.String(jtv) } 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 "LambdaAuthorizerConfig": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiLambdaAuthorizerConfigDetails(&sv.LambdaAuthorizerConfig, value); err != nil { return err } case "LogConfig": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiLogConfigDetails(&sv.LogConfig, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OpenIdConnectConfig": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiOpenIdConnectConfigDetails(&sv.OpenIdConnectConfig, value); err != nil { return err } case "UserPoolConfig": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiUserPoolConfigDetails(&sv.UserPoolConfig, value); err != nil { return err } case "WafWebAclArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WafWebAclArn = ptr.String(jtv) } case "XrayEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.XrayEnabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiLambdaAuthorizerConfigDetails(v **types.AwsAppSyncGraphQlApiLambdaAuthorizerConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAppSyncGraphQlApiLambdaAuthorizerConfigDetails if *v == nil { sv = &types.AwsAppSyncGraphQlApiLambdaAuthorizerConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AuthorizerResultTtlInSeconds": 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.AuthorizerResultTtlInSeconds = int32(i64) } case "AuthorizerUri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AuthorizerUri = ptr.String(jtv) } case "IdentityValidationExpression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IdentityValidationExpression = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiLogConfigDetails(v **types.AwsAppSyncGraphQlApiLogConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAppSyncGraphQlApiLogConfigDetails if *v == nil { sv = &types.AwsAppSyncGraphQlApiLogConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogsRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CloudWatchLogsRoleArn = ptr.String(jtv) } case "ExcludeVerboseContent": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ExcludeVerboseContent = jtv } case "FieldLogLevel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FieldLogLevel = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiOpenIdConnectConfigDetails(v **types.AwsAppSyncGraphQlApiOpenIdConnectConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAppSyncGraphQlApiOpenIdConnectConfigDetails if *v == nil { sv = &types.AwsAppSyncGraphQlApiOpenIdConnectConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AuthTtL": 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.AuthTtL = i64 } case "ClientId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClientId = ptr.String(jtv) } case "IatTtL": 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.IatTtL = i64 } case "Issuer": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Issuer = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiUserPoolConfigDetails(v **types.AwsAppSyncGraphQlApiUserPoolConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAppSyncGraphQlApiUserPoolConfigDetails if *v == nil { sv = &types.AwsAppSyncGraphQlApiUserPoolConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AppIdClientRegex": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AppIdClientRegex = ptr.String(jtv) } case "AwsRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AwsRegion = ptr.String(jtv) } case "DefaultAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultAction = ptr.String(jtv) } case "UserPoolId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserPoolId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAthenaWorkGroupConfigurationDetails(v **types.AwsAthenaWorkGroupConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAthenaWorkGroupConfigurationDetails if *v == nil { sv = &types.AwsAthenaWorkGroupConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ResultConfiguration": if err := awsRestjson1_deserializeDocumentAwsAthenaWorkGroupConfigurationResultConfigurationDetails(&sv.ResultConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAthenaWorkGroupConfigurationResultConfigurationDetails(v **types.AwsAthenaWorkGroupConfigurationResultConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAthenaWorkGroupConfigurationResultConfigurationDetails if *v == nil { sv = &types.AwsAthenaWorkGroupConfigurationResultConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "EncryptionConfiguration": if err := awsRestjson1_deserializeDocumentAwsAthenaWorkGroupConfigurationResultConfigurationEncryptionConfigurationDetails(&sv.EncryptionConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAthenaWorkGroupConfigurationResultConfigurationEncryptionConfigurationDetails(v **types.AwsAthenaWorkGroupConfigurationResultConfigurationEncryptionConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAthenaWorkGroupConfigurationResultConfigurationEncryptionConfigurationDetails if *v == nil { sv = &types.AwsAthenaWorkGroupConfigurationResultConfigurationEncryptionConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "EncryptionOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EncryptionOption = ptr.String(jtv) } case "KmsKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKey = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAthenaWorkGroupDetails(v **types.AwsAthenaWorkGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAthenaWorkGroupDetails if *v == nil { sv = &types.AwsAthenaWorkGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Configuration": if err := awsRestjson1_deserializeDocumentAwsAthenaWorkGroupConfigurationDetails(&sv.Configuration, value); err != nil { return err } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupAvailabilityZonesList(v *[]types.AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails, 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.AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails if *v == nil { cv = []types.AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails(v **types.AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails{} } else { sv = *v } for key, value := range shape { switch key { 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_deserializeDocumentAwsAutoScalingAutoScalingGroupDetails(v **types.AwsAutoScalingAutoScalingGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupDetails if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupAvailabilityZonesList(&sv.AvailabilityZones, value); err != nil { return err } case "CapacityRebalance": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CapacityRebalance = jtv } case "CreatedTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedTime = ptr.String(jtv) } case "HealthCheckGracePeriod": 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.HealthCheckGracePeriod = int32(i64) } case "HealthCheckType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HealthCheckType = ptr.String(jtv) } case "LaunchConfigurationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchConfigurationName = ptr.String(jtv) } case "LaunchTemplate": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification(&sv.LaunchTemplate, value); err != nil { return err } case "LoadBalancerNames": if err := awsRestjson1_deserializeDocumentStringList(&sv.LoadBalancerNames, value); err != nil { return err } case "MixedInstancesPolicy": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails(&sv.MixedInstancesPolicy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification(v **types.AwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification{} } else { sv = *v } for key, value := range shape { switch key { case "LaunchTemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchTemplateId = ptr.String(jtv) } case "LaunchTemplateName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchTemplateName = 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_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails(v **types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "InstancesDistribution": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails(&sv.InstancesDistribution, value); err != nil { return err } case "LaunchTemplate": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateDetails(&sv.LaunchTemplate, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails(v **types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "OnDemandAllocationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OnDemandAllocationStrategy = ptr.String(jtv) } case "OnDemandBaseCapacity": 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.OnDemandBaseCapacity = int32(i64) } case "OnDemandPercentageAboveBaseCapacity": 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.OnDemandPercentageAboveBaseCapacity = int32(i64) } case "SpotAllocationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SpotAllocationStrategy = ptr.String(jtv) } case "SpotInstancePools": 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.SpotInstancePools = int32(i64) } case "SpotMaxPrice": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SpotMaxPrice = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateDetails(v **types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateDetails if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateDetails{} } else { sv = *v } for key, value := range shape { switch key { case "LaunchTemplateSpecification": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification(&sv.LaunchTemplateSpecification, value); err != nil { return err } case "Overrides": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesList(&sv.Overrides, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification(v **types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateLaunchTemplateSpecification{} } else { sv = *v } for key, value := range shape { switch key { case "LaunchTemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchTemplateId = ptr.String(jtv) } case "LaunchTemplateName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchTemplateName = 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_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesList(v *[]types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails, 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.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails if *v == nil { cv = []types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails(v **types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails if *v == nil { sv = &types.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyLaunchTemplateOverridesListDetails{} } else { sv = *v } for key, value := range shape { switch key { case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "WeightedCapacity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WeightedCapacity = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails(v **types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails if *v == nil { sv = &types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "Ebs": if err := awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails(&sv.Ebs, value); err != nil { return err } case "NoDevice": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.NoDevice = jtv } case "VirtualName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VirtualName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails(v **types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails if *v == nil { sv = &types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsEbsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeleteOnTermination": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeleteOnTermination = jtv } case "Encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Encrypted = jtv } case "Iops": 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.Iops = int32(i64) } case "SnapshotId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotId = ptr.String(jtv) } case "VolumeSize": 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.VolumeSize = int32(i64) } case "VolumeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VolumeType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationBlockDeviceMappingsList(v *[]types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails, 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.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails if *v == nil { cv = []types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationBlockDeviceMappingsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationDetails(v **types.AwsAutoScalingLaunchConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingLaunchConfigurationDetails if *v == nil { sv = &types.AwsAutoScalingLaunchConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AssociatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = jtv } case "BlockDeviceMappings": if err := awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationBlockDeviceMappingsList(&sv.BlockDeviceMappings, value); err != nil { return err } case "ClassicLinkVpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClassicLinkVpcId = ptr.String(jtv) } case "ClassicLinkVpcSecurityGroups": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ClassicLinkVpcSecurityGroups, value); err != nil { return err } case "CreatedTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedTime = ptr.String(jtv) } case "EbsOptimized": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EbsOptimized = jtv } case "IamInstanceProfile": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IamInstanceProfile = 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 "InstanceMonitoring": if err := awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationInstanceMonitoringDetails(&sv.InstanceMonitoring, value); err != nil { return err } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "KernelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KernelId = ptr.String(jtv) } 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 "LaunchConfigurationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchConfigurationName = ptr.String(jtv) } case "MetadataOptions": if err := awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationMetadataOptions(&sv.MetadataOptions, value); err != nil { return err } case "PlacementTenancy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PlacementTenancy = ptr.String(jtv) } case "RamdiskId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RamdiskId = ptr.String(jtv) } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroups, value); err != nil { return err } case "SpotPrice": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SpotPrice = ptr.String(jtv) } case "UserData": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserData = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationInstanceMonitoringDetails(v **types.AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails if *v == nil { sv = &types.AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationMetadataOptions(v **types.AwsAutoScalingLaunchConfigurationMetadataOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsAutoScalingLaunchConfigurationMetadataOptions if *v == nil { sv = &types.AwsAutoScalingLaunchConfigurationMetadataOptions{} } else { sv = *v } for key, value := range shape { switch key { case "HttpEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpEndpoint = ptr.String(jtv) } case "HttpPutResponseHopLimit": 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.HttpPutResponseHopLimit = int32(i64) } case "HttpTokens": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpTokens = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanAdvancedBackupSettingsDetails(v **types.AwsBackupBackupPlanAdvancedBackupSettingsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupPlanAdvancedBackupSettingsDetails if *v == nil { sv = &types.AwsBackupBackupPlanAdvancedBackupSettingsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BackupOptions": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.BackupOptions, value); err != nil { return err } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanAdvancedBackupSettingsList(v *[]types.AwsBackupBackupPlanAdvancedBackupSettingsDetails, 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.AwsBackupBackupPlanAdvancedBackupSettingsDetails if *v == nil { cv = []types.AwsBackupBackupPlanAdvancedBackupSettingsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsBackupBackupPlanAdvancedBackupSettingsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanAdvancedBackupSettingsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanBackupPlanDetails(v **types.AwsBackupBackupPlanBackupPlanDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupPlanBackupPlanDetails if *v == nil { sv = &types.AwsBackupBackupPlanBackupPlanDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AdvancedBackupSettings": if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanAdvancedBackupSettingsList(&sv.AdvancedBackupSettings, value); err != nil { return err } case "BackupPlanName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupPlanName = ptr.String(jtv) } case "BackupPlanRule": if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleList(&sv.BackupPlanRule, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanDetails(v **types.AwsBackupBackupPlanDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupPlanDetails if *v == nil { sv = &types.AwsBackupBackupPlanDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BackupPlan": if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanBackupPlanDetails(&sv.BackupPlan, value); err != nil { return err } case "BackupPlanArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupPlanArn = ptr.String(jtv) } case "BackupPlanId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupPlanId = ptr.String(jtv) } case "VersionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VersionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanLifecycleDetails(v **types.AwsBackupBackupPlanLifecycleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupPlanLifecycleDetails if *v == nil { sv = &types.AwsBackupBackupPlanLifecycleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeleteAfterDays": 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.DeleteAfterDays = i64 } case "MoveToColdStorageAfterDays": 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.MoveToColdStorageAfterDays = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleCopyActionsDetails(v **types.AwsBackupBackupPlanRuleCopyActionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupPlanRuleCopyActionsDetails if *v == nil { sv = &types.AwsBackupBackupPlanRuleCopyActionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationBackupVaultArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationBackupVaultArn = ptr.String(jtv) } case "Lifecycle": if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanLifecycleDetails(&sv.Lifecycle, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleCopyActionsList(v *[]types.AwsBackupBackupPlanRuleCopyActionsDetails, 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.AwsBackupBackupPlanRuleCopyActionsDetails if *v == nil { cv = []types.AwsBackupBackupPlanRuleCopyActionsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsBackupBackupPlanRuleCopyActionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleCopyActionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleDetails(v **types.AwsBackupBackupPlanRuleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupPlanRuleDetails if *v == nil { sv = &types.AwsBackupBackupPlanRuleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CompletionWindowMinutes": 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.CompletionWindowMinutes = i64 } case "CopyActions": if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleCopyActionsList(&sv.CopyActions, value); err != nil { return err } case "EnableContinuousBackup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableContinuousBackup = jtv } case "Lifecycle": if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanLifecycleDetails(&sv.Lifecycle, 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 "RuleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleName = ptr.String(jtv) } case "ScheduleExpression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ScheduleExpression = ptr.String(jtv) } case "StartWindowMinutes": 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.StartWindowMinutes = i64 } case "TargetBackupVault": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TargetBackupVault = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleList(v *[]types.AwsBackupBackupPlanRuleDetails, 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.AwsBackupBackupPlanRuleDetails if *v == nil { cv = []types.AwsBackupBackupPlanRuleDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsBackupBackupPlanRuleDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanRuleDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupVaultDetails(v **types.AwsBackupBackupVaultDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupVaultDetails if *v == nil { sv = &types.AwsBackupBackupVaultDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccessPolicy = ptr.String(jtv) } case "BackupVaultArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupVaultArn = ptr.String(jtv) } case "BackupVaultName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupVaultName = ptr.String(jtv) } case "EncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EncryptionKeyArn = ptr.String(jtv) } case "Notifications": if err := awsRestjson1_deserializeDocumentAwsBackupBackupVaultNotificationsDetails(&sv.Notifications, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupBackupVaultNotificationsDetails(v **types.AwsBackupBackupVaultNotificationsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupBackupVaultNotificationsDetails if *v == nil { sv = &types.AwsBackupBackupVaultNotificationsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BackupVaultEvents": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.BackupVaultEvents, value); err != nil { return err } case "SnsTopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnsTopicArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupRecoveryPointCalculatedLifecycleDetails(v **types.AwsBackupRecoveryPointCalculatedLifecycleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupRecoveryPointCalculatedLifecycleDetails if *v == nil { sv = &types.AwsBackupRecoveryPointCalculatedLifecycleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeleteAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeleteAt = ptr.String(jtv) } case "MoveToColdStorageAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MoveToColdStorageAt = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupRecoveryPointCreatedByDetails(v **types.AwsBackupRecoveryPointCreatedByDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupRecoveryPointCreatedByDetails if *v == nil { sv = &types.AwsBackupRecoveryPointCreatedByDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BackupPlanArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupPlanArn = ptr.String(jtv) } case "BackupPlanId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupPlanId = ptr.String(jtv) } case "BackupPlanVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupPlanVersion = ptr.String(jtv) } case "BackupRuleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupRuleId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupRecoveryPointDetails(v **types.AwsBackupRecoveryPointDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupRecoveryPointDetails if *v == nil { sv = &types.AwsBackupRecoveryPointDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BackupSizeInBytes": 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.BackupSizeInBytes = i64 } case "BackupVaultArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupVaultArn = ptr.String(jtv) } case "BackupVaultName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BackupVaultName = ptr.String(jtv) } case "CalculatedLifecycle": if err := awsRestjson1_deserializeDocumentAwsBackupRecoveryPointCalculatedLifecycleDetails(&sv.CalculatedLifecycle, value); err != nil { return err } case "CompletionDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CompletionDate = ptr.String(jtv) } case "CreatedBy": if err := awsRestjson1_deserializeDocumentAwsBackupRecoveryPointCreatedByDetails(&sv.CreatedBy, value); err != nil { return err } case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreationDate = ptr.String(jtv) } case "EncryptionKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EncryptionKeyArn = ptr.String(jtv) } case "IamRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IamRoleArn = ptr.String(jtv) } case "IsEncrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsEncrypted = jtv } case "LastRestoreTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastRestoreTime = ptr.String(jtv) } case "Lifecycle": if err := awsRestjson1_deserializeDocumentAwsBackupRecoveryPointLifecycleDetails(&sv.Lifecycle, value); err != nil { return err } case "RecoveryPointArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RecoveryPointArn = ptr.String(jtv) } case "ResourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceArn = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } case "SourceBackupVaultArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceBackupVaultArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "StorageClass": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StorageClass = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsBackupRecoveryPointLifecycleDetails(v **types.AwsBackupRecoveryPointLifecycleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsBackupRecoveryPointLifecycleDetails if *v == nil { sv = &types.AwsBackupRecoveryPointLifecycleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeleteAfterDays": 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.DeleteAfterDays = i64 } case "MoveToColdStorageAfterDays": 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.MoveToColdStorageAfterDays = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDetails(v **types.AwsCertificateManagerCertificateDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCertificateManagerCertificateDetails if *v == nil { sv = &types.AwsCertificateManagerCertificateDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CertificateAuthorityArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CertificateAuthorityArn = ptr.String(jtv) } case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedAt = ptr.String(jtv) } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "DomainValidationOptions": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOptions(&sv.DomainValidationOptions, value); err != nil { return err } case "ExtendedKeyUsages": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsages(&sv.ExtendedKeyUsages, value); err != nil { return err } case "FailureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "ImportedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ImportedAt = ptr.String(jtv) } case "InUseBy": if err := awsRestjson1_deserializeDocumentStringList(&sv.InUseBy, value); err != nil { return err } case "IssuedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IssuedAt = ptr.String(jtv) } case "Issuer": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Issuer = ptr.String(jtv) } case "KeyAlgorithm": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyAlgorithm = ptr.String(jtv) } case "KeyUsages": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsages(&sv.KeyUsages, value); err != nil { return err } case "NotAfter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NotAfter = ptr.String(jtv) } case "NotBefore": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NotBefore = ptr.String(jtv) } case "Options": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateOptions(&sv.Options, value); err != nil { return err } case "RenewalEligibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RenewalEligibility = ptr.String(jtv) } case "RenewalSummary": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateRenewalSummary(&sv.RenewalSummary, value); err != nil { return err } case "Serial": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Serial = ptr.String(jtv) } case "SignatureAlgorithm": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SignatureAlgorithm = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "Subject": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Subject = ptr.String(jtv) } case "SubjectAlternativeNames": if err := awsRestjson1_deserializeDocumentStringList(&sv.SubjectAlternativeNames, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOption(v **types.AwsCertificateManagerCertificateDomainValidationOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCertificateManagerCertificateDomainValidationOption if *v == nil { sv = &types.AwsCertificateManagerCertificateDomainValidationOption{} } else { sv = *v } for key, value := range shape { switch key { case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "ResourceRecord": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateResourceRecord(&sv.ResourceRecord, value); err != nil { return err } case "ValidationDomain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ValidationDomain = ptr.String(jtv) } case "ValidationEmails": if err := awsRestjson1_deserializeDocumentStringList(&sv.ValidationEmails, value); err != nil { return err } case "ValidationMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ValidationMethod = ptr.String(jtv) } case "ValidationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ValidationStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOptions(v *[]types.AwsCertificateManagerCertificateDomainValidationOption, 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.AwsCertificateManagerCertificateDomainValidationOption if *v == nil { cv = []types.AwsCertificateManagerCertificateDomainValidationOption{} } else { cv = *v } for _, value := range shape { var col types.AwsCertificateManagerCertificateDomainValidationOption destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsage(v **types.AwsCertificateManagerCertificateExtendedKeyUsage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCertificateManagerCertificateExtendedKeyUsage if *v == nil { sv = &types.AwsCertificateManagerCertificateExtendedKeyUsage{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsages(v *[]types.AwsCertificateManagerCertificateExtendedKeyUsage, 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.AwsCertificateManagerCertificateExtendedKeyUsage if *v == nil { cv = []types.AwsCertificateManagerCertificateExtendedKeyUsage{} } else { cv = *v } for _, value := range shape { var col types.AwsCertificateManagerCertificateExtendedKeyUsage destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsage(v **types.AwsCertificateManagerCertificateKeyUsage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCertificateManagerCertificateKeyUsage if *v == nil { sv = &types.AwsCertificateManagerCertificateKeyUsage{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsages(v *[]types.AwsCertificateManagerCertificateKeyUsage, 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.AwsCertificateManagerCertificateKeyUsage if *v == nil { cv = []types.AwsCertificateManagerCertificateKeyUsage{} } else { cv = *v } for _, value := range shape { var col types.AwsCertificateManagerCertificateKeyUsage destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateOptions(v **types.AwsCertificateManagerCertificateOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCertificateManagerCertificateOptions if *v == nil { sv = &types.AwsCertificateManagerCertificateOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CertificateTransparencyLoggingPreference": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CertificateTransparencyLoggingPreference = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateRenewalSummary(v **types.AwsCertificateManagerCertificateRenewalSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCertificateManagerCertificateRenewalSummary if *v == nil { sv = &types.AwsCertificateManagerCertificateRenewalSummary{} } else { sv = *v } for key, value := range shape { switch key { case "DomainValidationOptions": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOptions(&sv.DomainValidationOptions, value); err != nil { return err } case "RenewalStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RenewalStatus = ptr.String(jtv) } case "RenewalStatusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RenewalStatusReason = ptr.String(jtv) } case "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedAt = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateResourceRecord(v **types.AwsCertificateManagerCertificateResourceRecord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCertificateManagerCertificateResourceRecord if *v == nil { sv = &types.AwsCertificateManagerCertificateResourceRecord{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = 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 "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_deserializeDocumentAwsCloudFormationStackDetails(v **types.AwsCloudFormationStackDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFormationStackDetails if *v == nil { sv = &types.AwsCloudFormationStackDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Capabilities": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Capabilities, value); err != nil { return err } case "CreationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "DisableRollback": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DisableRollback = jtv } case "DriftInformation": if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackDriftInformationDetails(&sv.DriftInformation, value); err != nil { return err } case "EnableTerminationProtection": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableTerminationProtection = jtv } case "LastUpdatedTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastUpdatedTime = ptr.String(jtv) } case "NotificationArns": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.NotificationArns, value); err != nil { return err } case "Outputs": if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsList(&sv.Outputs, value); err != nil { return err } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "StackId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StackId = ptr.String(jtv) } case "StackName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StackName = ptr.String(jtv) } case "StackStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StackStatus = ptr.String(jtv) } case "StackStatusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StackStatusReason = ptr.String(jtv) } case "TimeoutInMinutes": 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.TimeoutInMinutes = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFormationStackDriftInformationDetails(v **types.AwsCloudFormationStackDriftInformationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFormationStackDriftInformationDetails if *v == nil { sv = &types.AwsCloudFormationStackDriftInformationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "StackDriftStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StackDriftStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsDetails(v **types.AwsCloudFormationStackOutputsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFormationStackOutputsDetails if *v == nil { sv = &types.AwsCloudFormationStackOutputsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "OutputKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OutputKey = ptr.String(jtv) } case "OutputValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OutputValue = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsList(v *[]types.AwsCloudFormationStackOutputsDetails, 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.AwsCloudFormationStackOutputsDetails if *v == nil { cv = []types.AwsCloudFormationStackOutputsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsCloudFormationStackOutputsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehavior(v **types.AwsCloudFrontDistributionCacheBehavior, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionCacheBehavior if *v == nil { sv = &types.AwsCloudFrontDistributionCacheBehavior{} } else { sv = *v } for key, value := range shape { switch key { case "ViewerProtocolPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ViewerProtocolPolicy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviors(v **types.AwsCloudFrontDistributionCacheBehaviors, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionCacheBehaviors if *v == nil { sv = &types.AwsCloudFrontDistributionCacheBehaviors{} } else { sv = *v } for key, value := range shape { switch key { case "Items": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviorsItemList(&sv.Items, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviorsItemList(v *[]types.AwsCloudFrontDistributionCacheBehavior, 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.AwsCloudFrontDistributionCacheBehavior if *v == nil { cv = []types.AwsCloudFrontDistributionCacheBehavior{} } else { cv = *v } for _, value := range shape { var col types.AwsCloudFrontDistributionCacheBehavior destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehavior(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDefaultCacheBehavior(v **types.AwsCloudFrontDistributionDefaultCacheBehavior, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionDefaultCacheBehavior if *v == nil { sv = &types.AwsCloudFrontDistributionDefaultCacheBehavior{} } else { sv = *v } for key, value := range shape { switch key { case "ViewerProtocolPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ViewerProtocolPolicy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDetails(v **types.AwsCloudFrontDistributionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionDetails if *v == nil { sv = &types.AwsCloudFrontDistributionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CacheBehaviors": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviors(&sv.CacheBehaviors, value); err != nil { return err } case "DefaultCacheBehavior": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDefaultCacheBehavior(&sv.DefaultCacheBehavior, value); err != nil { return err } case "DefaultRootObject": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultRootObject = ptr.String(jtv) } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "ETag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ETag = ptr.String(jtv) } case "LastModifiedTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastModifiedTime = ptr.String(jtv) } case "Logging": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionLogging(&sv.Logging, value); err != nil { return err } case "OriginGroups": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroups(&sv.OriginGroups, value); err != nil { return err } case "Origins": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOrigins(&sv.Origins, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "ViewerCertificate": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionViewerCertificate(&sv.ViewerCertificate, value); err != nil { return err } case "WebAclId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WebAclId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionLogging(v **types.AwsCloudFrontDistributionLogging, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionLogging if *v == nil { sv = &types.AwsCloudFrontDistributionLogging{} } else { sv = *v } for key, value := range shape { switch key { case "Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "IncludeCookies": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeCookies = jtv } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginCustomOriginConfig(v **types.AwsCloudFrontDistributionOriginCustomOriginConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginCustomOriginConfig if *v == nil { sv = &types.AwsCloudFrontDistributionOriginCustomOriginConfig{} } else { sv = *v } for key, value := range shape { switch key { case "HttpPort": 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.HttpPort = int32(i64) } case "HttpsPort": 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.HttpsPort = int32(i64) } case "OriginKeepaliveTimeout": 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.OriginKeepaliveTimeout = int32(i64) } case "OriginProtocolPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OriginProtocolPolicy = ptr.String(jtv) } case "OriginReadTimeout": 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.OriginReadTimeout = int32(i64) } case "OriginSslProtocols": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginSslProtocols(&sv.OriginSslProtocols, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroup(v **types.AwsCloudFrontDistributionOriginGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginGroup if *v == nil { sv = &types.AwsCloudFrontDistributionOriginGroup{} } else { sv = *v } for key, value := range shape { switch key { case "FailoverCriteria": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailover(&sv.FailoverCriteria, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailover(v **types.AwsCloudFrontDistributionOriginGroupFailover, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginGroupFailover if *v == nil { sv = &types.AwsCloudFrontDistributionOriginGroupFailover{} } else { sv = *v } for key, value := range shape { switch key { case "StatusCodes": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodes(&sv.StatusCodes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodes(v **types.AwsCloudFrontDistributionOriginGroupFailoverStatusCodes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginGroupFailoverStatusCodes if *v == nil { sv = &types.AwsCloudFrontDistributionOriginGroupFailoverStatusCodes{} } else { sv = *v } for key, value := range shape { switch key { case "Items": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodesItemList(&sv.Items, value); err != nil { return err } case "Quantity": 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.Quantity = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodesItemList(v *[]int32, 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 []int32 if *v == nil { cv = []int32{} } else { cv = *v } for _, value := range shape { var col int32 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 } col = int32(i64) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroups(v **types.AwsCloudFrontDistributionOriginGroups, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginGroups if *v == nil { sv = &types.AwsCloudFrontDistributionOriginGroups{} } else { sv = *v } for key, value := range shape { switch key { case "Items": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupsItemList(&sv.Items, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupsItemList(v *[]types.AwsCloudFrontDistributionOriginGroup, 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.AwsCloudFrontDistributionOriginGroup if *v == nil { cv = []types.AwsCloudFrontDistributionOriginGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsCloudFrontDistributionOriginGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItem(v **types.AwsCloudFrontDistributionOriginItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginItem if *v == nil { sv = &types.AwsCloudFrontDistributionOriginItem{} } else { sv = *v } for key, value := range shape { switch key { case "CustomOriginConfig": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginCustomOriginConfig(&sv.CustomOriginConfig, value); err != nil { return err } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } 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 "OriginPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OriginPath = ptr.String(jtv) } case "S3OriginConfig": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginS3OriginConfig(&sv.S3OriginConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItemList(v *[]types.AwsCloudFrontDistributionOriginItem, 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.AwsCloudFrontDistributionOriginItem if *v == nil { cv = []types.AwsCloudFrontDistributionOriginItem{} } else { cv = *v } for _, value := range shape { var col types.AwsCloudFrontDistributionOriginItem destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItem(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOrigins(v **types.AwsCloudFrontDistributionOrigins, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOrigins if *v == nil { sv = &types.AwsCloudFrontDistributionOrigins{} } else { sv = *v } for key, value := range shape { switch key { case "Items": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItemList(&sv.Items, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginS3OriginConfig(v **types.AwsCloudFrontDistributionOriginS3OriginConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginS3OriginConfig if *v == nil { sv = &types.AwsCloudFrontDistributionOriginS3OriginConfig{} } else { sv = *v } for key, value := range shape { switch key { case "OriginAccessIdentity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OriginAccessIdentity = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginSslProtocols(v **types.AwsCloudFrontDistributionOriginSslProtocols, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionOriginSslProtocols if *v == nil { sv = &types.AwsCloudFrontDistributionOriginSslProtocols{} } else { sv = *v } for key, value := range shape { switch key { case "Items": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Items, value); err != nil { return err } case "Quantity": 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.Quantity = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionViewerCertificate(v **types.AwsCloudFrontDistributionViewerCertificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudFrontDistributionViewerCertificate if *v == nil { sv = &types.AwsCloudFrontDistributionViewerCertificate{} } else { sv = *v } for key, value := range shape { switch key { case "AcmCertificateArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AcmCertificateArn = ptr.String(jtv) } case "Certificate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Certificate = ptr.String(jtv) } case "CertificateSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CertificateSource = ptr.String(jtv) } case "CloudFrontDefaultCertificate": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CloudFrontDefaultCertificate = jtv } case "IamCertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IamCertificateId = ptr.String(jtv) } case "MinimumProtocolVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MinimumProtocolVersion = ptr.String(jtv) } case "SslSupportMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SslSupportMethod = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudTrailTrailDetails(v **types.AwsCloudTrailTrailDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudTrailTrailDetails if *v == nil { sv = &types.AwsCloudTrailTrailDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogsLogGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CloudWatchLogsLogGroupArn = ptr.String(jtv) } case "CloudWatchLogsRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CloudWatchLogsRoleArn = ptr.String(jtv) } case "HasCustomEventSelectors": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.HasCustomEventSelectors = jtv } case "HomeRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HomeRegion = ptr.String(jtv) } case "IncludeGlobalServiceEvents": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeGlobalServiceEvents = jtv } case "IsMultiRegionTrail": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsMultiRegionTrail = jtv } case "IsOrganizationTrail": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsOrganizationTrail = jtv } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "LogFileValidationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.LogFileValidationEnabled = jtv } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "S3BucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3BucketName = ptr.String(jtv) } case "S3KeyPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3KeyPrefix = ptr.String(jtv) } case "SnsTopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnsTopicArn = ptr.String(jtv) } case "SnsTopicName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnsTopicName = ptr.String(jtv) } case "TrailArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TrailArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDetails(v **types.AwsCloudWatchAlarmDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudWatchAlarmDetails if *v == nil { sv = &types.AwsCloudWatchAlarmDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ActionsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ActionsEnabled = jtv } case "AlarmActions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AlarmActions, value); err != nil { return err } case "AlarmArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AlarmArn = ptr.String(jtv) } case "AlarmConfigurationUpdatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AlarmConfigurationUpdatedTimestamp = ptr.String(jtv) } case "AlarmDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AlarmDescription = ptr.String(jtv) } case "AlarmName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AlarmName = ptr.String(jtv) } case "ComparisonOperator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ComparisonOperator = ptr.String(jtv) } case "DatapointsToAlarm": 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.DatapointsToAlarm = int32(i64) } case "Dimensions": if err := awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsList(&sv.Dimensions, value); err != nil { return err } case "EvaluateLowSampleCountPercentile": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EvaluateLowSampleCountPercentile = ptr.String(jtv) } case "EvaluationPeriods": 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.EvaluationPeriods = int32(i64) } case "ExtendedStatistic": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ExtendedStatistic = ptr.String(jtv) } case "InsufficientDataActions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.InsufficientDataActions, value); err != nil { return err } case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Namespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } case "OkActions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.OkActions, value); err != nil { return err } case "Period": 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.Period = int32(i64) } case "Statistic": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Statistic = ptr.String(jtv) } case "Threshold": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Threshold = 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.Threshold = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "ThresholdMetricId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ThresholdMetricId = ptr.String(jtv) } case "TreatMissingData": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TreatMissingData = ptr.String(jtv) } case "Unit": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Unit = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsDetails(v **types.AwsCloudWatchAlarmDimensionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCloudWatchAlarmDimensionsDetails if *v == nil { sv = &types.AwsCloudWatchAlarmDimensionsDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsList(v *[]types.AwsCloudWatchAlarmDimensionsDetails, 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.AwsCloudWatchAlarmDimensionsDetails if *v == nil { cv = []types.AwsCloudWatchAlarmDimensionsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsCloudWatchAlarmDimensionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectArtifactsDetails(v **types.AwsCodeBuildProjectArtifactsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectArtifactsDetails if *v == nil { sv = &types.AwsCodeBuildProjectArtifactsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ArtifactIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ArtifactIdentifier = ptr.String(jtv) } case "EncryptionDisabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EncryptionDisabled = jtv } case "Location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Location = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NamespaceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NamespaceType = ptr.String(jtv) } case "OverrideArtifactName": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.OverrideArtifactName = jtv } case "Packaging": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Packaging = ptr.String(jtv) } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectArtifactsList(v *[]types.AwsCodeBuildProjectArtifactsDetails, 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.AwsCodeBuildProjectArtifactsDetails if *v == nil { cv = []types.AwsCodeBuildProjectArtifactsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsCodeBuildProjectArtifactsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectArtifactsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectDetails(v **types.AwsCodeBuildProjectDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectDetails if *v == nil { sv = &types.AwsCodeBuildProjectDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Artifacts": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectArtifactsList(&sv.Artifacts, value); err != nil { return err } case "EncryptionKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EncryptionKey = ptr.String(jtv) } case "Environment": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironment(&sv.Environment, value); err != nil { return err } case "LogsConfig": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectLogsConfigDetails(&sv.LogsConfig, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SecondaryArtifacts": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectArtifactsList(&sv.SecondaryArtifacts, value); err != nil { return err } case "ServiceRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceRole = ptr.String(jtv) } case "Source": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectSource(&sv.Source, value); err != nil { return err } case "VpcConfig": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectVpcConfig(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironment(v **types.AwsCodeBuildProjectEnvironment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectEnvironment if *v == nil { sv = &types.AwsCodeBuildProjectEnvironment{} } else { sv = *v } for key, value := range shape { switch key { case "Certificate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Certificate = ptr.String(jtv) } case "EnvironmentVariables": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironmentEnvironmentVariablesList(&sv.EnvironmentVariables, value); err != nil { return err } case "ImagePullCredentialsType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ImagePullCredentialsType = ptr.String(jtv) } case "PrivilegedMode": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PrivilegedMode = jtv } case "RegistryCredential": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironmentRegistryCredential(&sv.RegistryCredential, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails(v **types.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails if *v == nil { sv = &types.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = 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 "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_deserializeDocumentAwsCodeBuildProjectEnvironmentEnvironmentVariablesList(v *[]types.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails, 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.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails if *v == nil { cv = []types.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironmentRegistryCredential(v **types.AwsCodeBuildProjectEnvironmentRegistryCredential, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectEnvironmentRegistryCredential if *v == nil { sv = &types.AwsCodeBuildProjectEnvironmentRegistryCredential{} } else { sv = *v } for key, value := range shape { switch key { case "Credential": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Credential = ptr.String(jtv) } case "CredentialProvider": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CredentialProvider = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectLogsConfigCloudWatchLogsDetails(v **types.AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails if *v == nil { sv = &types.AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "StreamName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StreamName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectLogsConfigDetails(v **types.AwsCodeBuildProjectLogsConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectLogsConfigDetails if *v == nil { sv = &types.AwsCodeBuildProjectLogsConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogs": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectLogsConfigCloudWatchLogsDetails(&sv.CloudWatchLogs, value); err != nil { return err } case "S3Logs": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectLogsConfigS3LogsDetails(&sv.S3Logs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectLogsConfigS3LogsDetails(v **types.AwsCodeBuildProjectLogsConfigS3LogsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectLogsConfigS3LogsDetails if *v == nil { sv = &types.AwsCodeBuildProjectLogsConfigS3LogsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "EncryptionDisabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EncryptionDisabled = jtv } case "Location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Location = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectSource(v **types.AwsCodeBuildProjectSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectSource if *v == nil { sv = &types.AwsCodeBuildProjectSource{} } else { sv = *v } for key, value := range shape { switch key { case "GitCloneDepth": 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.GitCloneDepth = int32(i64) } case "InsecureSsl": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.InsecureSsl = jtv } case "Location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Location = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsCodeBuildProjectVpcConfig(v **types.AwsCodeBuildProjectVpcConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCodeBuildProjectVpcConfig if *v == nil { sv = &types.AwsCodeBuildProjectVpcConfig{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { return err } case "Subnets": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Subnets, value); err != nil { return err } 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_deserializeDocumentAwsCorsConfiguration(v **types.AwsCorsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsCorsConfiguration if *v == nil { sv = &types.AwsCorsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "AllowCredentials": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AllowCredentials = jtv } case "AllowHeaders": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AllowHeaders, value); err != nil { return err } case "AllowMethods": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AllowMethods, value); err != nil { return err } case "AllowOrigins": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AllowOrigins, value); err != nil { return err } case "ExposeHeaders": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ExposeHeaders, value); err != nil { return err } case "MaxAge": 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.MaxAge = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinition(v **types.AwsDynamoDbTableAttributeDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableAttributeDefinition if *v == nil { sv = &types.AwsDynamoDbTableAttributeDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "AttributeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AttributeName = ptr.String(jtv) } case "AttributeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AttributeType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinitionList(v *[]types.AwsDynamoDbTableAttributeDefinition, 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.AwsDynamoDbTableAttributeDefinition if *v == nil { cv = []types.AwsDynamoDbTableAttributeDefinition{} } else { cv = *v } for _, value := range shape { var col types.AwsDynamoDbTableAttributeDefinition destAddr := &col if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinition(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableBillingModeSummary(v **types.AwsDynamoDbTableBillingModeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableBillingModeSummary if *v == nil { sv = &types.AwsDynamoDbTableBillingModeSummary{} } else { sv = *v } for key, value := range shape { switch key { case "BillingMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BillingMode = ptr.String(jtv) } case "LastUpdateToPayPerRequestDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastUpdateToPayPerRequestDateTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableDetails(v **types.AwsDynamoDbTableDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableDetails if *v == nil { sv = &types.AwsDynamoDbTableDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AttributeDefinitions": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinitionList(&sv.AttributeDefinitions, value); err != nil { return err } case "BillingModeSummary": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableBillingModeSummary(&sv.BillingModeSummary, value); err != nil { return err } case "CreationDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreationDateTime = ptr.String(jtv) } case "GlobalSecondaryIndexes": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndexList(&sv.GlobalSecondaryIndexes, value); err != nil { return err } case "GlobalTableVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GlobalTableVersion = ptr.String(jtv) } case "ItemCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ItemCount = int32(i64) } case "KeySchema": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(&sv.KeySchema, value); err != nil { return err } case "LatestStreamArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LatestStreamArn = ptr.String(jtv) } case "LatestStreamLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LatestStreamLabel = ptr.String(jtv) } case "LocalSecondaryIndexes": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndexList(&sv.LocalSecondaryIndexes, value); err != nil { return err } case "ProvisionedThroughput": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { return err } case "Replicas": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaList(&sv.Replicas, value); err != nil { return err } case "RestoreSummary": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableRestoreSummary(&sv.RestoreSummary, value); err != nil { return err } case "SseDescription": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableSseDescription(&sv.SseDescription, value); err != nil { return err } case "StreamSpecification": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableStreamSpecification(&sv.StreamSpecification, value); err != nil { return err } case "TableId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TableId = ptr.String(jtv) } case "TableName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TableName = ptr.String(jtv) } case "TableSizeBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SizeBytes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TableSizeBytes = i64 } case "TableStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TableStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndex(v **types.AwsDynamoDbTableGlobalSecondaryIndex, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableGlobalSecondaryIndex if *v == nil { sv = &types.AwsDynamoDbTableGlobalSecondaryIndex{} } else { sv = *v } for key, value := range shape { switch key { case "Backfilling": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Backfilling = jtv } case "IndexArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IndexArn = ptr.String(jtv) } case "IndexName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IndexName = ptr.String(jtv) } case "IndexSizeBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SizeBytes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IndexSizeBytes = i64 } case "IndexStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IndexStatus = ptr.String(jtv) } case "ItemCount": 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.ItemCount = int32(i64) } case "KeySchema": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(&sv.KeySchema, value); err != nil { return err } case "Projection": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProjection(&sv.Projection, value); err != nil { return err } case "ProvisionedThroughput": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndexList(v *[]types.AwsDynamoDbTableGlobalSecondaryIndex, 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.AwsDynamoDbTableGlobalSecondaryIndex if *v == nil { cv = []types.AwsDynamoDbTableGlobalSecondaryIndex{} } else { cv = *v } for _, value := range shape { var col types.AwsDynamoDbTableGlobalSecondaryIndex destAddr := &col if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndex(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchema(v **types.AwsDynamoDbTableKeySchema, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableKeySchema if *v == nil { sv = &types.AwsDynamoDbTableKeySchema{} } else { sv = *v } for key, value := range shape { switch key { case "AttributeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AttributeName = ptr.String(jtv) } case "KeyType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(v *[]types.AwsDynamoDbTableKeySchema, 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.AwsDynamoDbTableKeySchema if *v == nil { cv = []types.AwsDynamoDbTableKeySchema{} } else { cv = *v } for _, value := range shape { var col types.AwsDynamoDbTableKeySchema destAddr := &col if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchema(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndex(v **types.AwsDynamoDbTableLocalSecondaryIndex, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableLocalSecondaryIndex if *v == nil { sv = &types.AwsDynamoDbTableLocalSecondaryIndex{} } else { sv = *v } for key, value := range shape { switch key { case "IndexArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IndexArn = ptr.String(jtv) } case "IndexName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IndexName = ptr.String(jtv) } case "KeySchema": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(&sv.KeySchema, value); err != nil { return err } case "Projection": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProjection(&sv.Projection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndexList(v *[]types.AwsDynamoDbTableLocalSecondaryIndex, 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.AwsDynamoDbTableLocalSecondaryIndex if *v == nil { cv = []types.AwsDynamoDbTableLocalSecondaryIndex{} } else { cv = *v } for _, value := range shape { var col types.AwsDynamoDbTableLocalSecondaryIndex destAddr := &col if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndex(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableProjection(v **types.AwsDynamoDbTableProjection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableProjection if *v == nil { sv = &types.AwsDynamoDbTableProjection{} } else { sv = *v } for key, value := range shape { switch key { case "NonKeyAttributes": if err := awsRestjson1_deserializeDocumentStringList(&sv.NonKeyAttributes, value); err != nil { return err } case "ProjectionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProjectionType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughput(v **types.AwsDynamoDbTableProvisionedThroughput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableProvisionedThroughput if *v == nil { sv = &types.AwsDynamoDbTableProvisionedThroughput{} } else { sv = *v } for key, value := range shape { switch key { case "LastDecreaseDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastDecreaseDateTime = ptr.String(jtv) } case "LastIncreaseDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastIncreaseDateTime = ptr.String(jtv) } case "NumberOfDecreasesToday": 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.NumberOfDecreasesToday = int32(i64) } case "ReadCapacityUnits": 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.ReadCapacityUnits = int32(i64) } case "WriteCapacityUnits": 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.WriteCapacityUnits = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughputOverride(v **types.AwsDynamoDbTableProvisionedThroughputOverride, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableProvisionedThroughputOverride if *v == nil { sv = &types.AwsDynamoDbTableProvisionedThroughputOverride{} } else { sv = *v } for key, value := range shape { switch key { case "ReadCapacityUnits": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ReadCapacityUnits = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplica(v **types.AwsDynamoDbTableReplica, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableReplica if *v == nil { sv = &types.AwsDynamoDbTableReplica{} } else { sv = *v } for key, value := range shape { switch key { case "GlobalSecondaryIndexes": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndexList(&sv.GlobalSecondaryIndexes, value); err != nil { return err } case "KmsMasterKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsMasterKeyId = ptr.String(jtv) } case "ProvisionedThroughputOverride": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil { return err } case "RegionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegionName = ptr.String(jtv) } case "ReplicaStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ReplicaStatus = ptr.String(jtv) } case "ReplicaStatusDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ReplicaStatusDescription = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndex(v **types.AwsDynamoDbTableReplicaGlobalSecondaryIndex, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableReplicaGlobalSecondaryIndex if *v == nil { sv = &types.AwsDynamoDbTableReplicaGlobalSecondaryIndex{} } else { sv = *v } for key, value := range shape { switch key { case "IndexName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IndexName = ptr.String(jtv) } case "ProvisionedThroughputOverride": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndexList(v *[]types.AwsDynamoDbTableReplicaGlobalSecondaryIndex, 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.AwsDynamoDbTableReplicaGlobalSecondaryIndex if *v == nil { cv = []types.AwsDynamoDbTableReplicaGlobalSecondaryIndex{} } else { cv = *v } for _, value := range shape { var col types.AwsDynamoDbTableReplicaGlobalSecondaryIndex destAddr := &col if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndex(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaList(v *[]types.AwsDynamoDbTableReplica, 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.AwsDynamoDbTableReplica if *v == nil { cv = []types.AwsDynamoDbTableReplica{} } else { cv = *v } for _, value := range shape { var col types.AwsDynamoDbTableReplica destAddr := &col if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplica(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableRestoreSummary(v **types.AwsDynamoDbTableRestoreSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableRestoreSummary if *v == nil { sv = &types.AwsDynamoDbTableRestoreSummary{} } else { sv = *v } for key, value := range shape { switch key { case "RestoreDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RestoreDateTime = ptr.String(jtv) } case "RestoreInProgress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RestoreInProgress = jtv } case "SourceBackupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceBackupArn = ptr.String(jtv) } case "SourceTableArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceTableArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableSseDescription(v **types.AwsDynamoDbTableSseDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableSseDescription if *v == nil { sv = &types.AwsDynamoDbTableSseDescription{} } else { sv = *v } for key, value := range shape { switch key { case "InaccessibleEncryptionDateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InaccessibleEncryptionDateTime = ptr.String(jtv) } case "KmsMasterKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsMasterKeyArn = ptr.String(jtv) } case "SseType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SseType = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsDynamoDbTableStreamSpecification(v **types.AwsDynamoDbTableStreamSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsDynamoDbTableStreamSpecification if *v == nil { sv = &types.AwsDynamoDbTableStreamSpecification{} } else { sv = *v } for key, value := range shape { switch key { case "StreamEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.StreamEnabled = jtv } case "StreamViewType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StreamViewType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2EipDetails(v **types.AwsEc2EipDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2EipDetails if *v == nil { sv = &types.AwsEc2EipDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AllocationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AllocationId = ptr.String(jtv) } case "AssociationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AssociationId = ptr.String(jtv) } case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Domain = 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 "NetworkBorderGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkBorderGroup = ptr.String(jtv) } case "NetworkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } case "NetworkInterfaceOwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkInterfaceOwnerId = ptr.String(jtv) } case "PrivateIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrivateIpAddress = ptr.String(jtv) } case "PublicIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PublicIp = ptr.String(jtv) } case "PublicIpv4Pool": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PublicIpv4Pool = ptr.String(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_deserializeDocumentStringList(&sv.IpV4Addresses, value); err != nil { return err } case "IpV6Addresses": if err := awsRestjson1_deserializeDocumentStringList(&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 { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchedAt = ptr.String(jtv) } case "MetadataOptions": if err := awsRestjson1_deserializeDocumentAwsEc2InstanceMetadataOptions(&sv.MetadataOptions, value); err != nil { return err } case "Monitoring": if err := awsRestjson1_deserializeDocumentAwsEc2InstanceMonitoringDetails(&sv.Monitoring, value); err != nil { return err } case "NetworkInterfaces": if err := awsRestjson1_deserializeDocumentAwsEc2InstanceNetworkInterfacesList(&sv.NetworkInterfaces, value); err != nil { return err } 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 "VirtualizationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VirtualizationType = 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_deserializeDocumentAwsEc2InstanceMetadataOptions(v **types.AwsEc2InstanceMetadataOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2InstanceMetadataOptions if *v == nil { sv = &types.AwsEc2InstanceMetadataOptions{} } else { sv = *v } for key, value := range shape { switch key { case "HttpEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpEndpoint = ptr.String(jtv) } case "HttpProtocolIpv6": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpProtocolIpv6 = ptr.String(jtv) } case "HttpPutResponseHopLimit": 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.HttpPutResponseHopLimit = int32(i64) } case "HttpTokens": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpTokens = ptr.String(jtv) } case "InstanceMetadataTags": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceMetadataTags = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2InstanceMonitoringDetails(v **types.AwsEc2InstanceMonitoringDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2InstanceMonitoringDetails if *v == nil { sv = &types.AwsEc2InstanceMonitoringDetails{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2InstanceNetworkInterfacesDetails(v **types.AwsEc2InstanceNetworkInterfacesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2InstanceNetworkInterfacesDetails if *v == nil { sv = &types.AwsEc2InstanceNetworkInterfacesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "NetworkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2InstanceNetworkInterfacesList(v *[]types.AwsEc2InstanceNetworkInterfacesDetails, 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.AwsEc2InstanceNetworkInterfacesDetails if *v == nil { cv = []types.AwsEc2InstanceNetworkInterfacesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2InstanceNetworkInterfacesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2InstanceNetworkInterfacesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails(v **types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "Ebs": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataBlockDeviceMappingSetEbsDetails(&sv.Ebs, value); err != nil { return err } case "NoDevice": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NoDevice = ptr.String(jtv) } case "VirtualName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VirtualName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataBlockDeviceMappingSetEbsDetails(v **types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetEbsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetEbsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetEbsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeleteOnTermination": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeleteOnTermination = jtv } case "Encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Encrypted = jtv } case "Iops": 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.Iops = int32(i64) } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "SnapshotId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotId = ptr.String(jtv) } case "Throughput": 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.Throughput = int32(i64) } case "VolumeSize": 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.VolumeSize = int32(i64) } case "VolumeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VolumeType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataBlockDeviceMappingSetList(v *[]types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails, 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.AwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataBlockDeviceMappingSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCapacityReservationSpecificationCapacityReservationTargetDetails(v **types.AwsEc2LaunchTemplateDataCapacityReservationSpecificationCapacityReservationTargetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataCapacityReservationSpecificationCapacityReservationTargetDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataCapacityReservationSpecificationCapacityReservationTargetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CapacityReservationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CapacityReservationId = ptr.String(jtv) } case "CapacityReservationResourceGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CapacityReservationResourceGroupArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCapacityReservationSpecificationDetails(v **types.AwsEc2LaunchTemplateDataCapacityReservationSpecificationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataCapacityReservationSpecificationDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataCapacityReservationSpecificationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CapacityReservationPreference": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CapacityReservationPreference = ptr.String(jtv) } case "CapacityReservationTarget": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCapacityReservationSpecificationCapacityReservationTargetDetails(&sv.CapacityReservationTarget, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCpuOptionsDetails(v **types.AwsEc2LaunchTemplateDataCpuOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataCpuOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataCpuOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CoreCount": 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.CoreCount = int32(i64) } case "ThreadsPerCore": 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.ThreadsPerCore = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCreditSpecificationDetails(v **types.AwsEc2LaunchTemplateDataCreditSpecificationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataCreditSpecificationDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataCreditSpecificationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CpuCredits": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CpuCredits = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataDetails(v **types.AwsEc2LaunchTemplateDataDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BlockDeviceMappingSet": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataBlockDeviceMappingSetList(&sv.BlockDeviceMappingSet, value); err != nil { return err } case "CapacityReservationSpecification": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCapacityReservationSpecificationDetails(&sv.CapacityReservationSpecification, value); err != nil { return err } case "CpuOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCpuOptionsDetails(&sv.CpuOptions, value); err != nil { return err } case "CreditSpecification": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataCreditSpecificationDetails(&sv.CreditSpecification, value); err != nil { return err } case "DisableApiStop": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DisableApiStop = jtv } case "DisableApiTermination": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DisableApiTermination = jtv } case "EbsOptimized": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EbsOptimized = jtv } case "ElasticGpuSpecificationSet": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticGpuSpecificationSetList(&sv.ElasticGpuSpecificationSet, value); err != nil { return err } case "ElasticInferenceAcceleratorSet": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetList(&sv.ElasticInferenceAcceleratorSet, value); err != nil { return err } case "EnclaveOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataEnclaveOptionsDetails(&sv.EnclaveOptions, value); err != nil { return err } case "HibernationOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataHibernationOptionsDetails(&sv.HibernationOptions, value); err != nil { return err } case "IamInstanceProfile": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataIamInstanceProfileDetails(&sv.IamInstanceProfile, value); err != nil { return err } 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 "InstanceInitiatedShutdownBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceInitiatedShutdownBehavior = ptr.String(jtv) } case "InstanceMarketOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceMarketOptionsDetails(&sv.InstanceMarketOptions, value); err != nil { return err } case "InstanceRequirements": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsDetails(&sv.InstanceRequirements, value); err != nil { return err } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "KernelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KernelId = ptr.String(jtv) } 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 "LicenseSet": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataLicenseSetList(&sv.LicenseSet, value); err != nil { return err } case "MaintenanceOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataMaintenanceOptionsDetails(&sv.MaintenanceOptions, value); err != nil { return err } case "MetadataOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataMetadataOptionsDetails(&sv.MetadataOptions, value); err != nil { return err } case "Monitoring": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataMonitoringDetails(&sv.Monitoring, value); err != nil { return err } case "NetworkInterfaceSet": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetList(&sv.NetworkInterfaceSet, value); err != nil { return err } case "Placement": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataPlacementDetails(&sv.Placement, value); err != nil { return err } case "PrivateDnsNameOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataPrivateDnsNameOptionsDetails(&sv.PrivateDnsNameOptions, value); err != nil { return err } case "RamDiskId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RamDiskId = ptr.String(jtv) } case "SecurityGroupIdSet": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIdSet, value); err != nil { return err } case "SecurityGroupSet": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupSet, value); err != nil { return err } case "UserData": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserData = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails(v **types.AwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticGpuSpecificationSetList(v *[]types.AwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails, 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.AwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticGpuSpecificationSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails(v **types.AwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails{} } 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 Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = int32(i64) } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetList(v *[]types.AwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails, 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.AwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataElasticInferenceAcceleratorSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataEnclaveOptionsDetails(v **types.AwsEc2LaunchTemplateDataEnclaveOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataEnclaveOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataEnclaveOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataHibernationOptionsDetails(v **types.AwsEc2LaunchTemplateDataHibernationOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataHibernationOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataHibernationOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Configured": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Configured = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataIamInstanceProfileDetails(v **types.AwsEc2LaunchTemplateDataIamInstanceProfileDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataIamInstanceProfileDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataIamInstanceProfileDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceMarketOptionsDetails(v **types.AwsEc2LaunchTemplateDataInstanceMarketOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceMarketOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceMarketOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MarketType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MarketType = ptr.String(jtv) } case "SpotOptions": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails(&sv.SpotOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails(v **types.AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BlockDurationMinutes": 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.BlockDurationMinutes = int32(i64) } case "InstanceInterruptionBehavior": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceInterruptionBehavior = ptr.String(jtv) } case "MaxPrice": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MaxPrice = ptr.String(jtv) } case "SpotInstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SpotInstanceType = ptr.String(jtv) } case "ValidUntil": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ValidUntil = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorCountDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorCountDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorCountDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorCountDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": 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.Max = int32(i64) } case "Min": 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.Min = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorTotalMemoryMiBDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorTotalMemoryMiBDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorTotalMemoryMiBDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorTotalMemoryMiBDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": 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.Max = int32(i64) } case "Min": 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.Min = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsBaselineEbsBandwidthMbpsDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsBaselineEbsBandwidthMbpsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsBaselineEbsBandwidthMbpsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsBaselineEbsBandwidthMbpsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": 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.Max = int32(i64) } case "Min": 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.Min = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AcceleratorCount": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorCountDetails(&sv.AcceleratorCount, value); err != nil { return err } case "AcceleratorManufacturers": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AcceleratorManufacturers, value); err != nil { return err } case "AcceleratorNames": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AcceleratorNames, value); err != nil { return err } case "AcceleratorTotalMemoryMiB": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsAcceleratorTotalMemoryMiBDetails(&sv.AcceleratorTotalMemoryMiB, value); err != nil { return err } case "AcceleratorTypes": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AcceleratorTypes, value); err != nil { return err } case "BareMetal": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BareMetal = ptr.String(jtv) } case "BaselineEbsBandwidthMbps": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsBaselineEbsBandwidthMbpsDetails(&sv.BaselineEbsBandwidthMbps, value); err != nil { return err } case "BurstablePerformance": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BurstablePerformance = ptr.String(jtv) } case "CpuManufacturers": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.CpuManufacturers, value); err != nil { return err } case "ExcludedInstanceTypes": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ExcludedInstanceTypes, value); err != nil { return err } case "InstanceGenerations": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.InstanceGenerations, value); err != nil { return err } case "LocalStorage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LocalStorage = ptr.String(jtv) } case "LocalStorageTypes": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.LocalStorageTypes, value); err != nil { return err } case "MemoryGiBPerVCpu": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsMemoryGiBPerVCpuDetails(&sv.MemoryGiBPerVCpu, value); err != nil { return err } case "MemoryMiB": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsMemoryMiBDetails(&sv.MemoryMiB, value); err != nil { return err } case "NetworkInterfaceCount": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsNetworkInterfaceCountDetails(&sv.NetworkInterfaceCount, value); err != nil { return err } case "OnDemandMaxPricePercentageOverLowestPrice": 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.OnDemandMaxPricePercentageOverLowestPrice = int32(i64) } case "RequireHibernateSupport": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RequireHibernateSupport = jtv } case "SpotMaxPricePercentageOverLowestPrice": 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.SpotMaxPricePercentageOverLowestPrice = int32(i64) } case "TotalLocalStorageGB": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsTotalLocalStorageGBDetails(&sv.TotalLocalStorageGB, value); err != nil { return err } case "VCpuCount": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsVCpuCountDetails(&sv.VCpuCount, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsMemoryGiBPerVCpuDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsMemoryGiBPerVCpuDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsMemoryGiBPerVCpuDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsMemoryGiBPerVCpuDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Max = 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.Max = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Min": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Min = 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.Min = 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_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsMemoryMiBDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsMemoryMiBDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsMemoryMiBDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsMemoryMiBDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": 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.Max = int32(i64) } case "Min": 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.Min = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsNetworkInterfaceCountDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsNetworkInterfaceCountDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsNetworkInterfaceCountDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsNetworkInterfaceCountDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": 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.Max = int32(i64) } case "Min": 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.Min = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsTotalLocalStorageGBDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsTotalLocalStorageGBDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsTotalLocalStorageGBDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsTotalLocalStorageGBDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Max = 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.Max = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Min": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Min = 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.Min = 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_deserializeDocumentAwsEc2LaunchTemplateDataInstanceRequirementsVCpuCountDetails(v **types.AwsEc2LaunchTemplateDataInstanceRequirementsVCpuCountDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataInstanceRequirementsVCpuCountDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataInstanceRequirementsVCpuCountDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Max": 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.Max = int32(i64) } case "Min": 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.Min = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataLicenseSetDetails(v **types.AwsEc2LaunchTemplateDataLicenseSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataLicenseSetDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataLicenseSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "LicenseConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LicenseConfigurationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataLicenseSetList(v *[]types.AwsEc2LaunchTemplateDataLicenseSetDetails, 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.AwsEc2LaunchTemplateDataLicenseSetDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataLicenseSetDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataLicenseSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataLicenseSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataMaintenanceOptionsDetails(v **types.AwsEc2LaunchTemplateDataMaintenanceOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataMaintenanceOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataMaintenanceOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AutoRecovery": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AutoRecovery = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataMetadataOptionsDetails(v **types.AwsEc2LaunchTemplateDataMetadataOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataMetadataOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataMetadataOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "HttpEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpEndpoint = ptr.String(jtv) } case "HttpProtocolIpv6": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpProtocolIpv6 = ptr.String(jtv) } case "HttpPutResponseHopLimit": 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.HttpPutResponseHopLimit = int32(i64) } case "HttpTokens": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpTokens = ptr.String(jtv) } case "InstanceMetadataTags": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceMetadataTags = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataMonitoringDetails(v **types.AwsEc2LaunchTemplateDataMonitoringDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataMonitoringDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataMonitoringDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetDetails(v **types.AwsEc2LaunchTemplateDataNetworkInterfaceSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataNetworkInterfaceSetDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataNetworkInterfaceSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AssociateCarrierIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociateCarrierIpAddress = jtv } case "AssociatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = jtv } case "DeleteOnTermination": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeleteOnTermination = jtv } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "DeviceIndex": 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.DeviceIndex = int32(i64) } case "Groups": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Groups, value); err != nil { return err } case "InterfaceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InterfaceType = ptr.String(jtv) } case "Ipv4PrefixCount": 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.Ipv4PrefixCount = int32(i64) } case "Ipv4Prefixes": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesList(&sv.Ipv4Prefixes, value); err != nil { return err } case "Ipv6AddressCount": 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.Ipv6AddressCount = int32(i64) } case "Ipv6Addresses": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesList(&sv.Ipv6Addresses, value); err != nil { return err } case "Ipv6PrefixCount": 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.Ipv6PrefixCount = int32(i64) } case "Ipv6Prefixes": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesList(&sv.Ipv6Prefixes, value); err != nil { return err } case "NetworkCardIndex": 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.NetworkCardIndex = int32(i64) } case "NetworkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } case "PrivateIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrivateIpAddress = ptr.String(jtv) } case "PrivateIpAddresses": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesList(&sv.PrivateIpAddresses, value); err != nil { return err } case "SecondaryPrivateIpAddressCount": 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.SecondaryPrivateIpAddressCount = int32(i64) } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails(v **types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Ipv4Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ipv4Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesList(v *[]types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails, 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.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv4PrefixesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails(v **types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Ipv6Address": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ipv6Address = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesList(v *[]types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails, 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.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6AddressesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails(v **types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Ipv6Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ipv6Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesList(v *[]types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails, 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.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetIpv6PrefixesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetList(v *[]types.AwsEc2LaunchTemplateDataNetworkInterfaceSetDetails, 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.AwsEc2LaunchTemplateDataNetworkInterfaceSetDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataNetworkInterfaceSetDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataNetworkInterfaceSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails(v **types.AwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Primary": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Primary = jtv } case "PrivateIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrivateIpAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesList(v *[]types.AwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails, 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.AwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails if *v == nil { cv = []types.AwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataNetworkInterfaceSetPrivateIpAddressesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataPlacementDetails(v **types.AwsEc2LaunchTemplateDataPlacementDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataPlacementDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataPlacementDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Affinity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Affinity = ptr.String(jtv) } case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } case "HostId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HostId = ptr.String(jtv) } case "HostResourceGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HostResourceGroupArn = ptr.String(jtv) } case "PartitionNumber": 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.PartitionNumber = int32(i64) } case "SpreadDomain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SpreadDomain = ptr.String(jtv) } case "Tenancy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Tenancy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataPrivateDnsNameOptionsDetails(v **types.AwsEc2LaunchTemplateDataPrivateDnsNameOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDataPrivateDnsNameOptionsDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDataPrivateDnsNameOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "EnableResourceNameDnsAAAARecord": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableResourceNameDnsAAAARecord = jtv } case "EnableResourceNameDnsARecord": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableResourceNameDnsARecord = jtv } case "HostnameType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HostnameType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDetails(v **types.AwsEc2LaunchTemplateDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2LaunchTemplateDetails if *v == nil { sv = &types.AwsEc2LaunchTemplateDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultVersionNumber": 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.DefaultVersionNumber = i64 } 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 "LatestVersionNumber": 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.LatestVersionNumber = i64 } case "LaunchTemplateData": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDataDetails(&sv.LaunchTemplateData, value); err != nil { return err } case "LaunchTemplateName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchTemplateName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkAclAssociation(v **types.AwsEc2NetworkAclAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkAclAssociation if *v == nil { sv = &types.AwsEc2NetworkAclAssociation{} } else { sv = *v } for key, value := range shape { switch key { case "NetworkAclAssociationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkAclAssociationId = ptr.String(jtv) } case "NetworkAclId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkAclId = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkAclAssociationList(v *[]types.AwsEc2NetworkAclAssociation, 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.AwsEc2NetworkAclAssociation if *v == nil { cv = []types.AwsEc2NetworkAclAssociation{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2NetworkAclAssociation destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2NetworkAclAssociation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkAclDetails(v **types.AwsEc2NetworkAclDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkAclDetails if *v == nil { sv = &types.AwsEc2NetworkAclDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Associations": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkAclAssociationList(&sv.Associations, value); err != nil { return err } case "Entries": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkAclEntryList(&sv.Entries, value); err != nil { return err } case "IsDefault": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsDefault = jtv } case "NetworkAclId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkAclId = ptr.String(jtv) } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerId = 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_deserializeDocumentAwsEc2NetworkAclEntry(v **types.AwsEc2NetworkAclEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkAclEntry if *v == nil { sv = &types.AwsEc2NetworkAclEntry{} } else { sv = *v } for key, value := range shape { switch key { case "CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrBlock = ptr.String(jtv) } case "Egress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Egress = jtv } case "IcmpTypeCode": if err := awsRestjson1_deserializeDocumentIcmpTypeCode(&sv.IcmpTypeCode, value); err != nil { return err } case "Ipv6CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ipv6CidrBlock = ptr.String(jtv) } case "PortRange": if err := awsRestjson1_deserializeDocumentPortRangeFromTo(&sv.PortRange, value); err != nil { return err } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } case "RuleAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleAction = ptr.String(jtv) } case "RuleNumber": 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.RuleNumber = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkAclEntryList(v *[]types.AwsEc2NetworkAclEntry, 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.AwsEc2NetworkAclEntry if *v == nil { cv = []types.AwsEc2NetworkAclEntry{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2NetworkAclEntry destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2NetworkAclEntry(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceAttachment(v **types.AwsEc2NetworkInterfaceAttachment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkInterfaceAttachment if *v == nil { sv = &types.AwsEc2NetworkInterfaceAttachment{} } else { sv = *v } for key, value := range shape { switch key { case "AttachmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AttachmentId = ptr.String(jtv) } case "AttachTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AttachTime = ptr.String(jtv) } case "DeleteOnTermination": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeleteOnTermination = jtv } case "DeviceIndex": 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.DeviceIndex = int32(i64) } 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 "InstanceOwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceOwnerId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceDetails(v **types.AwsEc2NetworkInterfaceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkInterfaceDetails if *v == nil { sv = &types.AwsEc2NetworkInterfaceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Attachment": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceAttachment(&sv.Attachment, value); err != nil { return err } case "IpV6Addresses": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceIpV6AddressList(&sv.IpV6Addresses, value); err != nil { return err } case "NetworkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } case "PrivateIpAddresses": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfacePrivateIpAddressList(&sv.PrivateIpAddresses, value); err != nil { return err } case "PublicDnsName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PublicDnsName = ptr.String(jtv) } case "PublicIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PublicIp = ptr.String(jtv) } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroupList(&sv.SecurityGroups, value); err != nil { return err } case "SourceDestCheck": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.SourceDestCheck = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceIpV6AddressDetail(v **types.AwsEc2NetworkInterfaceIpV6AddressDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkInterfaceIpV6AddressDetail if *v == nil { sv = &types.AwsEc2NetworkInterfaceIpV6AddressDetail{} } else { sv = *v } for key, value := range shape { switch key { case "IpV6Address": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IpV6Address = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceIpV6AddressList(v *[]types.AwsEc2NetworkInterfaceIpV6AddressDetail, 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.AwsEc2NetworkInterfaceIpV6AddressDetail if *v == nil { cv = []types.AwsEc2NetworkInterfaceIpV6AddressDetail{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2NetworkInterfaceIpV6AddressDetail destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceIpV6AddressDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfacePrivateIpAddressDetail(v **types.AwsEc2NetworkInterfacePrivateIpAddressDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkInterfacePrivateIpAddressDetail if *v == nil { sv = &types.AwsEc2NetworkInterfacePrivateIpAddressDetail{} } else { sv = *v } for key, value := range shape { switch key { case "PrivateDnsName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrivateDnsName = ptr.String(jtv) } case "PrivateIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrivateIpAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfacePrivateIpAddressList(v *[]types.AwsEc2NetworkInterfacePrivateIpAddressDetail, 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.AwsEc2NetworkInterfacePrivateIpAddressDetail if *v == nil { cv = []types.AwsEc2NetworkInterfacePrivateIpAddressDetail{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2NetworkInterfacePrivateIpAddressDetail destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfacePrivateIpAddressDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroup(v **types.AwsEc2NetworkInterfaceSecurityGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2NetworkInterfaceSecurityGroup if *v == nil { sv = &types.AwsEc2NetworkInterfaceSecurityGroup{} } else { sv = *v } for key, value := range shape { switch key { case "GroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupId = ptr.String(jtv) } case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroupList(v *[]types.AwsEc2NetworkInterfaceSecurityGroup, 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.AwsEc2NetworkInterfaceSecurityGroup if *v == nil { cv = []types.AwsEc2NetworkInterfaceSecurityGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2NetworkInterfaceSecurityGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2RouteTableDetails(v **types.AwsEc2RouteTableDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2RouteTableDetails if *v == nil { sv = &types.AwsEc2RouteTableDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AssociationSet": if err := awsRestjson1_deserializeDocumentAssociationSetList(&sv.AssociationSet, value); err != nil { return err } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerId = ptr.String(jtv) } case "PropagatingVgwSet": if err := awsRestjson1_deserializeDocumentPropagatingVgwSetList(&sv.PropagatingVgwSet, value); err != nil { return err } case "RouteSet": if err := awsRestjson1_deserializeDocumentRouteSetList(&sv.RouteSet, value); err != nil { return err } case "RouteTableId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RouteTableId = 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_deserializeDocumentAwsEc2SecurityGroupDetails(v **types.AwsEc2SecurityGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2SecurityGroupDetails if *v == nil { sv = &types.AwsEc2SecurityGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "GroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupId = ptr.String(jtv) } case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } case "IpPermissions": if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermissionList(&sv.IpPermissions, value); err != nil { return err } case "IpPermissionsEgress": if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermissionList(&sv.IpPermissionsEgress, value); err != nil { return err } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerId = 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_deserializeDocumentAwsEc2SecurityGroupIpPermission(v **types.AwsEc2SecurityGroupIpPermission, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2SecurityGroupIpPermission if *v == nil { sv = &types.AwsEc2SecurityGroupIpPermission{} } else { sv = *v } for key, value := range shape { switch key { case "FromPort": 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.FromPort = int32(i64) } case "IpProtocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IpProtocol = ptr.String(jtv) } case "IpRanges": if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRangeList(&sv.IpRanges, value); err != nil { return err } case "Ipv6Ranges": if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6RangeList(&sv.Ipv6Ranges, value); err != nil { return err } case "PrefixListIds": if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListIdList(&sv.PrefixListIds, value); err != nil { return err } case "ToPort": 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.ToPort = int32(i64) } case "UserIdGroupPairs": if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPairList(&sv.UserIdGroupPairs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermissionList(v *[]types.AwsEc2SecurityGroupIpPermission, 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.AwsEc2SecurityGroupIpPermission if *v == nil { cv = []types.AwsEc2SecurityGroupIpPermission{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2SecurityGroupIpPermission destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermission(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRange(v **types.AwsEc2SecurityGroupIpRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2SecurityGroupIpRange if *v == nil { sv = &types.AwsEc2SecurityGroupIpRange{} } else { sv = *v } for key, value := range shape { switch key { case "CidrIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrIp = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRangeList(v *[]types.AwsEc2SecurityGroupIpRange, 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.AwsEc2SecurityGroupIpRange if *v == nil { cv = []types.AwsEc2SecurityGroupIpRange{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2SecurityGroupIpRange destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRange(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6Range(v **types.AwsEc2SecurityGroupIpv6Range, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2SecurityGroupIpv6Range if *v == nil { sv = &types.AwsEc2SecurityGroupIpv6Range{} } else { sv = *v } for key, value := range shape { switch key { case "CidrIpv6": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrIpv6 = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6RangeList(v *[]types.AwsEc2SecurityGroupIpv6Range, 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.AwsEc2SecurityGroupIpv6Range if *v == nil { cv = []types.AwsEc2SecurityGroupIpv6Range{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2SecurityGroupIpv6Range destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6Range(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListId(v **types.AwsEc2SecurityGroupPrefixListId, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2SecurityGroupPrefixListId if *v == nil { sv = &types.AwsEc2SecurityGroupPrefixListId{} } else { sv = *v } for key, value := range shape { switch key { case "PrefixListId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrefixListId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListIdList(v *[]types.AwsEc2SecurityGroupPrefixListId, 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.AwsEc2SecurityGroupPrefixListId if *v == nil { cv = []types.AwsEc2SecurityGroupPrefixListId{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2SecurityGroupPrefixListId destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListId(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPair(v **types.AwsEc2SecurityGroupUserIdGroupPair, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2SecurityGroupUserIdGroupPair if *v == nil { sv = &types.AwsEc2SecurityGroupUserIdGroupPair{} } else { sv = *v } for key, value := range shape { switch key { case "GroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupId = ptr.String(jtv) } case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } case "PeeringStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PeeringStatus = ptr.String(jtv) } case "UserId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserId = 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) } case "VpcPeeringConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpcPeeringConnectionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPairList(v *[]types.AwsEc2SecurityGroupUserIdGroupPair, 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.AwsEc2SecurityGroupUserIdGroupPair if *v == nil { cv = []types.AwsEc2SecurityGroupUserIdGroupPair{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2SecurityGroupUserIdGroupPair destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPair(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2SubnetDetails(v **types.AwsEc2SubnetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2SubnetDetails if *v == nil { sv = &types.AwsEc2SubnetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AssignIpv6AddressOnCreation": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AssignIpv6AddressOnCreation = jtv } case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "AvailabilityZoneId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AvailabilityZoneId = ptr.String(jtv) } case "AvailableIpAddressCount": 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.AvailableIpAddressCount = int32(i64) } case "CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrBlock = ptr.String(jtv) } case "DefaultForAz": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DefaultForAz = jtv } case "Ipv6CidrBlockAssociationSet": if err := awsRestjson1_deserializeDocumentIpv6CidrBlockAssociationList(&sv.Ipv6CidrBlockAssociationSet, value); err != nil { return err } case "MapPublicIpOnLaunch": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MapPublicIpOnLaunch = jtv } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerId = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } case "SubnetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubnetArn = 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 "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_deserializeDocumentAwsEc2TransitGatewayDetails(v **types.AwsEc2TransitGatewayDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2TransitGatewayDetails if *v == nil { sv = &types.AwsEc2TransitGatewayDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AmazonSideAsn": 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.AmazonSideAsn = int32(i64) } case "AssociationDefaultRouteTableId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AssociationDefaultRouteTableId = ptr.String(jtv) } case "AutoAcceptSharedAttachments": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AutoAcceptSharedAttachments = ptr.String(jtv) } case "DefaultRouteTableAssociation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultRouteTableAssociation = ptr.String(jtv) } case "DefaultRouteTablePropagation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultRouteTablePropagation = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "DnsSupport": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DnsSupport = ptr.String(jtv) } 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 "MulticastSupport": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MulticastSupport = ptr.String(jtv) } case "PropagationDefaultRouteTableId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PropagationDefaultRouteTableId = ptr.String(jtv) } case "TransitGatewayCidrBlocks": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.TransitGatewayCidrBlocks, value); err != nil { return err } case "VpnEcmpSupport": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpnEcmpSupport = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VolumeAttachment(v **types.AwsEc2VolumeAttachment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VolumeAttachment if *v == nil { sv = &types.AwsEc2VolumeAttachment{} } else { sv = *v } for key, value := range shape { switch key { case "AttachTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AttachTime = ptr.String(jtv) } case "DeleteOnTermination": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeleteOnTermination = 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 "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VolumeAttachmentList(v *[]types.AwsEc2VolumeAttachment, 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.AwsEc2VolumeAttachment if *v == nil { cv = []types.AwsEc2VolumeAttachment{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2VolumeAttachment destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2VolumeAttachment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2VolumeDetails(v **types.AwsEc2VolumeDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VolumeDetails if *v == nil { sv = &types.AwsEc2VolumeDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Attachments": if err := awsRestjson1_deserializeDocumentAwsEc2VolumeAttachmentList(&sv.Attachments, value); err != nil { return err } case "CreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateTime = ptr.String(jtv) } case "DeviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "Encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Encrypted = jtv } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "Size": 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.Size = int32(i64) } case "SnapshotId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "VolumeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VolumeId = ptr.String(jtv) } case "VolumeScanStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VolumeScanStatus = ptr.String(jtv) } case "VolumeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VolumeType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpcDetails(v **types.AwsEc2VpcDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpcDetails if *v == nil { sv = &types.AwsEc2VpcDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CidrBlockAssociationSet": if err := awsRestjson1_deserializeDocumentCidrBlockAssociationList(&sv.CidrBlockAssociationSet, value); err != nil { return err } case "DhcpOptionsId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DhcpOptionsId = ptr.String(jtv) } case "Ipv6CidrBlockAssociationSet": if err := awsRestjson1_deserializeDocumentIpv6CidrBlockAssociationList(&sv.Ipv6CidrBlockAssociationSet, value); err != nil { return err } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpcEndpointServiceDetails(v **types.AwsEc2VpcEndpointServiceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpcEndpointServiceDetails if *v == nil { sv = &types.AwsEc2VpcEndpointServiceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AcceptanceRequired": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AcceptanceRequired = jtv } case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AvailabilityZones, value); err != nil { return err } case "BaseEndpointDnsNames": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.BaseEndpointDnsNames, value); err != nil { return err } case "GatewayLoadBalancerArns": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.GatewayLoadBalancerArns, value); err != nil { return err } case "ManagesVpcEndpoints": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ManagesVpcEndpoints = jtv } case "NetworkLoadBalancerArns": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.NetworkLoadBalancerArns, value); err != nil { return err } case "PrivateDnsName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrivateDnsName = ptr.String(jtv) } case "ServiceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceId = ptr.String(jtv) } case "ServiceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceName = ptr.String(jtv) } case "ServiceState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceState = ptr.String(jtv) } case "ServiceType": if err := awsRestjson1_deserializeDocumentAwsEc2VpcEndpointServiceServiceTypeList(&sv.ServiceType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpcEndpointServiceServiceTypeDetails(v **types.AwsEc2VpcEndpointServiceServiceTypeDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpcEndpointServiceServiceTypeDetails if *v == nil { sv = &types.AwsEc2VpcEndpointServiceServiceTypeDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ServiceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpcEndpointServiceServiceTypeList(v *[]types.AwsEc2VpcEndpointServiceServiceTypeDetails, 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.AwsEc2VpcEndpointServiceServiceTypeDetails if *v == nil { cv = []types.AwsEc2VpcEndpointServiceServiceTypeDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2VpcEndpointServiceServiceTypeDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2VpcEndpointServiceServiceTypeDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionDetails(v **types.AwsEc2VpcPeeringConnectionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpcPeeringConnectionDetails if *v == nil { sv = &types.AwsEc2VpcPeeringConnectionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccepterVpcInfo": if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(&sv.AccepterVpcInfo, value); err != nil { return err } case "ExpirationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ExpirationTime = ptr.String(jtv) } case "RequesterVpcInfo": if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(&sv.RequesterVpcInfo, value); err != nil { return err } case "Status": if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionStatusDetails(&sv.Status, value); err != nil { return err } case "VpcPeeringConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpcPeeringConnectionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionStatusDetails(v **types.AwsEc2VpcPeeringConnectionStatusDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpcPeeringConnectionStatusDetails if *v == nil { sv = &types.AwsEc2VpcPeeringConnectionStatusDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(v **types.AwsEc2VpcPeeringConnectionVpcInfoDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpcPeeringConnectionVpcInfoDetails if *v == nil { sv = &types.AwsEc2VpcPeeringConnectionVpcInfoDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrBlock = ptr.String(jtv) } case "CidrBlockSet": if err := awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetList(&sv.CidrBlockSet, value); err != nil { return err } case "Ipv6CidrBlockSet": if err := awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetList(&sv.Ipv6CidrBlockSet, value); err != nil { return err } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerId = ptr.String(jtv) } case "PeeringOptions": if err := awsRestjson1_deserializeDocumentVpcInfoPeeringOptionsDetails(&sv.PeeringOptions, value); err != nil { return err } 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 "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_deserializeDocumentAwsEc2VpnConnectionDetails(v **types.AwsEc2VpnConnectionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpnConnectionDetails if *v == nil { sv = &types.AwsEc2VpnConnectionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Category = ptr.String(jtv) } case "CustomerGatewayConfiguration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustomerGatewayConfiguration = ptr.String(jtv) } case "CustomerGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustomerGatewayId = ptr.String(jtv) } case "Options": if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionOptionsDetails(&sv.Options, value); err != nil { return err } case "Routes": if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionRoutesList(&sv.Routes, value); err != nil { return err } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } case "TransitGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TransitGatewayId = 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 "VgwTelemetry": if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionVgwTelemetryList(&sv.VgwTelemetry, value); err != nil { return err } case "VpnConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpnConnectionId = ptr.String(jtv) } case "VpnGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpnGatewayId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionOptionsDetails(v **types.AwsEc2VpnConnectionOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpnConnectionOptionsDetails if *v == nil { sv = &types.AwsEc2VpnConnectionOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "StaticRoutesOnly": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.StaticRoutesOnly = jtv } case "TunnelOptions": if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionOptionsTunnelOptionsList(&sv.TunnelOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionOptionsTunnelOptionsDetails(v **types.AwsEc2VpnConnectionOptionsTunnelOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpnConnectionOptionsTunnelOptionsDetails if *v == nil { sv = &types.AwsEc2VpnConnectionOptionsTunnelOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DpdTimeoutSeconds": 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.DpdTimeoutSeconds = int32(i64) } case "IkeVersions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.IkeVersions, value); err != nil { return err } case "OutsideIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OutsideIpAddress = ptr.String(jtv) } case "Phase1DhGroupNumbers": if err := awsRestjson1_deserializeDocumentIntegerList(&sv.Phase1DhGroupNumbers, value); err != nil { return err } case "Phase1EncryptionAlgorithms": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Phase1EncryptionAlgorithms, value); err != nil { return err } case "Phase1IntegrityAlgorithms": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Phase1IntegrityAlgorithms, value); err != nil { return err } case "Phase1LifetimeSeconds": 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.Phase1LifetimeSeconds = int32(i64) } case "Phase2DhGroupNumbers": if err := awsRestjson1_deserializeDocumentIntegerList(&sv.Phase2DhGroupNumbers, value); err != nil { return err } case "Phase2EncryptionAlgorithms": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Phase2EncryptionAlgorithms, value); err != nil { return err } case "Phase2IntegrityAlgorithms": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Phase2IntegrityAlgorithms, value); err != nil { return err } case "Phase2LifetimeSeconds": 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.Phase2LifetimeSeconds = int32(i64) } case "PreSharedKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PreSharedKey = ptr.String(jtv) } case "RekeyFuzzPercentage": 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.RekeyFuzzPercentage = int32(i64) } case "RekeyMarginTimeSeconds": 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.RekeyMarginTimeSeconds = int32(i64) } case "ReplayWindowSize": 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.ReplayWindowSize = int32(i64) } case "TunnelInsideCidr": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TunnelInsideCidr = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionOptionsTunnelOptionsList(v *[]types.AwsEc2VpnConnectionOptionsTunnelOptionsDetails, 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.AwsEc2VpnConnectionOptionsTunnelOptionsDetails if *v == nil { cv = []types.AwsEc2VpnConnectionOptionsTunnelOptionsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2VpnConnectionOptionsTunnelOptionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionOptionsTunnelOptionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionRoutesDetails(v **types.AwsEc2VpnConnectionRoutesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpnConnectionRoutesDetails if *v == nil { sv = &types.AwsEc2VpnConnectionRoutesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationCidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationCidrBlock = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionRoutesList(v *[]types.AwsEc2VpnConnectionRoutesDetails, 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.AwsEc2VpnConnectionRoutesDetails if *v == nil { cv = []types.AwsEc2VpnConnectionRoutesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2VpnConnectionRoutesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionRoutesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionVgwTelemetryDetails(v **types.AwsEc2VpnConnectionVgwTelemetryDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEc2VpnConnectionVgwTelemetryDetails if *v == nil { sv = &types.AwsEc2VpnConnectionVgwTelemetryDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AcceptedRouteCount": 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.AcceptedRouteCount = int32(i64) } case "CertificateArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CertificateArn = ptr.String(jtv) } case "LastStatusChange": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastStatusChange = ptr.String(jtv) } case "OutsideIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OutsideIpAddress = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "StatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionVgwTelemetryList(v *[]types.AwsEc2VpnConnectionVgwTelemetryDetails, 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.AwsEc2VpnConnectionVgwTelemetryDetails if *v == nil { cv = []types.AwsEc2VpnConnectionVgwTelemetryDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEc2VpnConnectionVgwTelemetryDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionVgwTelemetryDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv 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 "ImageDigest": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ImageDigest = ptr.String(jtv) } case "ImagePublishedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ImagePublishedAt = ptr.String(jtv) } case "ImageTags": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ImageTags, value); err != nil { return err } case "RegistryId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegistryId = 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_deserializeDocumentAwsEcrRepositoryDetails(v **types.AwsEcrRepositoryDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcrRepositoryDetails if *v == nil { sv = &types.AwsEcrRepositoryDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ImageScanningConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcrRepositoryImageScanningConfigurationDetails(&sv.ImageScanningConfiguration, value); err != nil { return err } case "ImageTagMutability": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ImageTagMutability = ptr.String(jtv) } case "LifecyclePolicy": if err := awsRestjson1_deserializeDocumentAwsEcrRepositoryLifecyclePolicyDetails(&sv.LifecyclePolicy, value); err != nil { return err } 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) } case "RepositoryPolicyText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RepositoryPolicyText = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcrRepositoryImageScanningConfigurationDetails(v **types.AwsEcrRepositoryImageScanningConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcrRepositoryImageScanningConfigurationDetails if *v == nil { sv = &types.AwsEcrRepositoryImageScanningConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ScanOnPush": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ScanOnPush = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcrRepositoryLifecyclePolicyDetails(v **types.AwsEcrRepositoryLifecyclePolicyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcrRepositoryLifecyclePolicyDetails if *v == nil { sv = &types.AwsEcrRepositoryLifecyclePolicyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "LifecyclePolicyText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LifecyclePolicyText = ptr.String(jtv) } case "RegistryId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegistryId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterClusterSettingsDetails(v **types.AwsEcsClusterClusterSettingsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsClusterClusterSettingsDetails if *v == nil { sv = &types.AwsEcsClusterClusterSettingsDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterClusterSettingsList(v *[]types.AwsEcsClusterClusterSettingsDetails, 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.AwsEcsClusterClusterSettingsDetails if *v == nil { cv = []types.AwsEcsClusterClusterSettingsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsClusterClusterSettingsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsClusterClusterSettingsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterConfigurationDetails(v **types.AwsEcsClusterConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsClusterConfigurationDetails if *v == nil { sv = &types.AwsEcsClusterConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ExecuteCommandConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsClusterConfigurationExecuteCommandConfigurationDetails(&sv.ExecuteCommandConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterConfigurationExecuteCommandConfigurationDetails(v **types.AwsEcsClusterConfigurationExecuteCommandConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsClusterConfigurationExecuteCommandConfigurationDetails if *v == nil { sv = &types.AwsEcsClusterConfigurationExecuteCommandConfigurationDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "LogConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsClusterConfigurationExecuteCommandConfigurationLogConfigurationDetails(&sv.LogConfiguration, value); err != nil { return err } case "Logging": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Logging = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterConfigurationExecuteCommandConfigurationLogConfigurationDetails(v **types.AwsEcsClusterConfigurationExecuteCommandConfigurationLogConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsClusterConfigurationExecuteCommandConfigurationLogConfigurationDetails if *v == nil { sv = &types.AwsEcsClusterConfigurationExecuteCommandConfigurationLogConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchEncryptionEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CloudWatchEncryptionEnabled = jtv } case "CloudWatchLogGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CloudWatchLogGroupName = ptr.String(jtv) } case "S3BucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3BucketName = ptr.String(jtv) } case "S3EncryptionEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.S3EncryptionEnabled = jtv } case "S3KeyPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3KeyPrefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterDefaultCapacityProviderStrategyDetails(v **types.AwsEcsClusterDefaultCapacityProviderStrategyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsClusterDefaultCapacityProviderStrategyDetails if *v == nil { sv = &types.AwsEcsClusterDefaultCapacityProviderStrategyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Base": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Base = int32(i64) } case "CapacityProvider": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CapacityProvider = ptr.String(jtv) } case "Weight": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Weight = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterDefaultCapacityProviderStrategyList(v *[]types.AwsEcsClusterDefaultCapacityProviderStrategyDetails, 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.AwsEcsClusterDefaultCapacityProviderStrategyDetails if *v == nil { cv = []types.AwsEcsClusterDefaultCapacityProviderStrategyDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsClusterDefaultCapacityProviderStrategyDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsClusterDefaultCapacityProviderStrategyDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsClusterDetails(v **types.AwsEcsClusterDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsClusterDetails if *v == nil { sv = &types.AwsEcsClusterDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveServicesCount": 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.ActiveServicesCount = int32(i64) } case "CapacityProviders": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.CapacityProviders, value); err != nil { return err } case "ClusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "ClusterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterName = ptr.String(jtv) } case "ClusterSettings": if err := awsRestjson1_deserializeDocumentAwsEcsClusterClusterSettingsList(&sv.ClusterSettings, value); err != nil { return err } case "Configuration": if err := awsRestjson1_deserializeDocumentAwsEcsClusterConfigurationDetails(&sv.Configuration, value); err != nil { return err } case "DefaultCapacityProviderStrategy": if err := awsRestjson1_deserializeDocumentAwsEcsClusterDefaultCapacityProviderStrategyList(&sv.DefaultCapacityProviderStrategy, value); err != nil { return err } case "RegisteredContainerInstancesCount": 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.RegisteredContainerInstancesCount = int32(i64) } case "RunningTasksCount": 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.RunningTasksCount = int32(i64) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsContainerDetails(v **types.AwsEcsContainerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsContainerDetails if *v == nil { sv = &types.AwsEcsContainerDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Image": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Image = ptr.String(jtv) } case "MountPoints": if err := awsRestjson1_deserializeDocumentAwsMountPointList(&sv.MountPoints, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Privileged": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Privileged = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsContainerDetailsList(v *[]types.AwsEcsContainerDetails, 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.AwsEcsContainerDetails if *v == nil { cv = []types.AwsEcsContainerDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsContainerDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsContainerDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceCapacityProviderStrategyDetails(v **types.AwsEcsServiceCapacityProviderStrategyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceCapacityProviderStrategyDetails if *v == nil { sv = &types.AwsEcsServiceCapacityProviderStrategyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Base": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Base = int32(i64) } case "CapacityProvider": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CapacityProvider = ptr.String(jtv) } case "Weight": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Weight = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceCapacityProviderStrategyList(v *[]types.AwsEcsServiceCapacityProviderStrategyDetails, 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.AwsEcsServiceCapacityProviderStrategyDetails if *v == nil { cv = []types.AwsEcsServiceCapacityProviderStrategyDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsServiceCapacityProviderStrategyDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsServiceCapacityProviderStrategyDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceDeploymentConfigurationDeploymentCircuitBreakerDetails(v **types.AwsEcsServiceDeploymentConfigurationDeploymentCircuitBreakerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceDeploymentConfigurationDeploymentCircuitBreakerDetails if *v == nil { sv = &types.AwsEcsServiceDeploymentConfigurationDeploymentCircuitBreakerDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enable = jtv } case "Rollback": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Rollback = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceDeploymentConfigurationDetails(v **types.AwsEcsServiceDeploymentConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceDeploymentConfigurationDetails if *v == nil { sv = &types.AwsEcsServiceDeploymentConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeploymentCircuitBreaker": if err := awsRestjson1_deserializeDocumentAwsEcsServiceDeploymentConfigurationDeploymentCircuitBreakerDetails(&sv.DeploymentCircuitBreaker, value); err != nil { return err } case "MaximumPercent": 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.MaximumPercent = int32(i64) } case "MinimumHealthyPercent": 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.MinimumHealthyPercent = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceDeploymentControllerDetails(v **types.AwsEcsServiceDeploymentControllerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceDeploymentControllerDetails if *v == nil { sv = &types.AwsEcsServiceDeploymentControllerDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceDetails(v **types.AwsEcsServiceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceDetails if *v == nil { sv = &types.AwsEcsServiceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CapacityProviderStrategy": if err := awsRestjson1_deserializeDocumentAwsEcsServiceCapacityProviderStrategyList(&sv.CapacityProviderStrategy, value); err != nil { return err } case "Cluster": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Cluster = ptr.String(jtv) } case "DeploymentConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsServiceDeploymentConfigurationDetails(&sv.DeploymentConfiguration, value); err != nil { return err } case "DeploymentController": if err := awsRestjson1_deserializeDocumentAwsEcsServiceDeploymentControllerDetails(&sv.DeploymentController, value); err != nil { return err } case "DesiredCount": 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.DesiredCount = int32(i64) } case "EnableEcsManagedTags": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableEcsManagedTags = jtv } case "EnableExecuteCommand": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnableExecuteCommand = jtv } case "HealthCheckGracePeriodSeconds": 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.HealthCheckGracePeriodSeconds = int32(i64) } case "LaunchType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchType = ptr.String(jtv) } case "LoadBalancers": if err := awsRestjson1_deserializeDocumentAwsEcsServiceLoadBalancersList(&sv.LoadBalancers, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NetworkConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsServiceNetworkConfigurationDetails(&sv.NetworkConfiguration, value); err != nil { return err } case "PlacementConstraints": if err := awsRestjson1_deserializeDocumentAwsEcsServicePlacementConstraintsList(&sv.PlacementConstraints, value); err != nil { return err } case "PlacementStrategies": if err := awsRestjson1_deserializeDocumentAwsEcsServicePlacementStrategiesList(&sv.PlacementStrategies, value); err != nil { return err } case "PlatformVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PlatformVersion = ptr.String(jtv) } case "PropagateTags": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PropagateTags = ptr.String(jtv) } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Role = ptr.String(jtv) } case "SchedulingStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SchedulingStrategy = ptr.String(jtv) } case "ServiceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceArn = ptr.String(jtv) } case "ServiceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceName = ptr.String(jtv) } case "ServiceRegistries": if err := awsRestjson1_deserializeDocumentAwsEcsServiceServiceRegistriesList(&sv.ServiceRegistries, value); err != nil { return err } case "TaskDefinition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TaskDefinition = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceLoadBalancersDetails(v **types.AwsEcsServiceLoadBalancersDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceLoadBalancersDetails if *v == nil { sv = &types.AwsEcsServiceLoadBalancersDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerName = ptr.String(jtv) } case "ContainerPort": 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.ContainerPort = int32(i64) } case "LoadBalancerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LoadBalancerName = ptr.String(jtv) } case "TargetGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TargetGroupArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceLoadBalancersList(v *[]types.AwsEcsServiceLoadBalancersDetails, 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.AwsEcsServiceLoadBalancersDetails if *v == nil { cv = []types.AwsEcsServiceLoadBalancersDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsServiceLoadBalancersDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsServiceLoadBalancersDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails(v **types.AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails if *v == nil { sv = &types.AwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AssignPublicIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AssignPublicIp = ptr.String(jtv) } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroups, value); err != nil { return err } case "Subnets": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Subnets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceNetworkConfigurationDetails(v **types.AwsEcsServiceNetworkConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceNetworkConfigurationDetails if *v == nil { sv = &types.AwsEcsServiceNetworkConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AwsVpcConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsServiceNetworkConfigurationAwsVpcConfigurationDetails(&sv.AwsVpcConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServicePlacementConstraintsDetails(v **types.AwsEcsServicePlacementConstraintsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServicePlacementConstraintsDetails if *v == nil { sv = &types.AwsEcsServicePlacementConstraintsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServicePlacementConstraintsList(v *[]types.AwsEcsServicePlacementConstraintsDetails, 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.AwsEcsServicePlacementConstraintsDetails if *v == nil { cv = []types.AwsEcsServicePlacementConstraintsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsServicePlacementConstraintsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsServicePlacementConstraintsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsServicePlacementStrategiesDetails(v **types.AwsEcsServicePlacementStrategiesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServicePlacementStrategiesDetails if *v == nil { sv = &types.AwsEcsServicePlacementStrategiesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Field": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Field = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServicePlacementStrategiesList(v *[]types.AwsEcsServicePlacementStrategiesDetails, 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.AwsEcsServicePlacementStrategiesDetails if *v == nil { cv = []types.AwsEcsServicePlacementStrategiesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsServicePlacementStrategiesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsServicePlacementStrategiesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceServiceRegistriesDetails(v **types.AwsEcsServiceServiceRegistriesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsServiceServiceRegistriesDetails if *v == nil { sv = &types.AwsEcsServiceServiceRegistriesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerName = ptr.String(jtv) } case "ContainerPort": 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.ContainerPort = int32(i64) } case "Port": 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.Port = int32(i64) } case "RegistryArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegistryArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsServiceServiceRegistriesList(v *[]types.AwsEcsServiceServiceRegistriesDetails, 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.AwsEcsServiceServiceRegistriesDetails if *v == nil { cv = []types.AwsEcsServiceServiceRegistriesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsServiceServiceRegistriesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsServiceServiceRegistriesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Condition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Condition = ptr.String(jtv) } case "ContainerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsDependsOnList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Command": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Command, value); err != nil { return err } case "Cpu": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Cpu = int32(i64) } case "DependsOn": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsDependsOnList(&sv.DependsOn, value); err != nil { return err } case "DisableNetworking": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DisableNetworking = jtv } case "DnsSearchDomains": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.DnsSearchDomains, value); err != nil { return err } case "DnsServers": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.DnsServers, value); err != nil { return err } case "DockerLabels": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.DockerLabels, value); err != nil { return err } case "DockerSecurityOptions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.DockerSecurityOptions, value); err != nil { return err } case "EntryPoint": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.EntryPoint, value); err != nil { return err } case "Environment": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentList(&sv.Environment, value); err != nil { return err } case "EnvironmentFiles": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesList(&sv.EnvironmentFiles, value); err != nil { return err } case "Essential": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Essential = jtv } case "ExtraHosts": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsExtraHostsList(&sv.ExtraHosts, value); err != nil { return err } case "FirelensConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsFirelensConfigurationDetails(&sv.FirelensConfiguration, value); err != nil { return err } case "HealthCheck": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails(&sv.HealthCheck, value); err != nil { return err } case "Hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "Image": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Image = ptr.String(jtv) } case "Interactive": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Interactive = jtv } case "Links": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Links, value); err != nil { return err } case "LinuxParameters": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDetails(&sv.LinuxParameters, value); err != nil { return err } case "LogConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationDetails(&sv.LogConfiguration, value); err != nil { return err } case "Memory": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Memory = int32(i64) } case "MemoryReservation": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MemoryReservation = int32(i64) } case "MountPoints": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsMountPointsList(&sv.MountPoints, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "PortMappings": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsPortMappingsList(&sv.PortMappings, value); err != nil { return err } case "Privileged": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Privileged = jtv } case "PseudoTerminal": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PseudoTerminal = jtv } case "ReadonlyRootFilesystem": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ReadonlyRootFilesystem = jtv } case "RepositoryCredentials": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsRepositoryCredentialsDetails(&sv.RepositoryCredentials, value); err != nil { return err } case "ResourceRequirements": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsList(&sv.ResourceRequirements, value); err != nil { return err } case "Secrets": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSecretsList(&sv.Secrets, value); err != nil { return err } case "StartTimeout": 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.StartTimeout = int32(i64) } case "StopTimeout": 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.StopTimeout = int32(i64) } case "SystemControls": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSystemControlsList(&sv.SystemControls, value); err != nil { return err } case "Ulimits": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsUlimitsList(&sv.Ulimits, value); err != nil { return err } case "User": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.User = ptr.String(jtv) } case "VolumesFrom": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsVolumesFromList(&sv.VolumesFrom, value); err != nil { return err } case "WorkingDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WorkingDirectory = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = 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_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentFilesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsEnvironmentDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "IpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IpAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsExtraHostsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsExtraHostsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsFirelensConfigurationDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsFirelensConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsFirelensConfigurationDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsFirelensConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Options": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Options, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Command": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Command, value); err != nil { return err } case "Interval": 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.Interval = int32(i64) } case "Retries": 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.Retries = int32(i64) } case "StartPeriod": 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.StartPeriod = int32(i64) } case "Timeout": 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.Timeout = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersCapabilitiesDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersCapabilitiesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersCapabilitiesDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersCapabilitiesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Add": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Add, value); err != nil { return err } case "Drop": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Drop, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Capabilities": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersCapabilitiesDetails(&sv.Capabilities, value); err != nil { return err } case "Devices": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesList(&sv.Devices, value); err != nil { return err } case "InitProcessEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.InitProcessEnabled = jtv } case "MaxSwap": 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.MaxSwap = int32(i64) } case "SharedMemorySize": 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.SharedMemorySize = int32(i64) } case "Swappiness": 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.Swappiness = int32(i64) } case "Tmpfs": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsList(&sv.Tmpfs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerPath = ptr.String(jtv) } case "HostPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HostPath = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Permissions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersDevicesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerPath = ptr.String(jtv) } case "MountOptions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.MountOptions, value); err != nil { return err } case "Size": 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.Size = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLinuxParametersTmpfsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "LogDriver": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LogDriver = ptr.String(jtv) } case "Options": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Options, value); err != nil { return err } case "SecretOptions": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsList(&sv.SecretOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ValueFrom": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ValueFrom = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsLogConfigurationSecretOptionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerPath = ptr.String(jtv) } case "ReadOnly": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ReadOnly = jtv } case "SourceVolume": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceVolume = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsMountPointsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsMountPointsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerPort": 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.ContainerPort = int32(i64) } case "HostPort": 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.HostPort = int32(i64) } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsPortMappingsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsPortMappingsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsRepositoryCredentialsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsRepositoryCredentialsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsRepositoryCredentialsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsRepositoryCredentialsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CredentialsParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CredentialsParameter = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = 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_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsResourceRequirementsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSecretsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsSecretsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsSecretsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsSecretsDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ValueFrom": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ValueFrom = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSecretsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsSecretsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsSecretsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsSecretsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsSecretsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSecretsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Namespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Namespace = 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_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSystemControlsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsSystemControlsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "HardLimit": 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.HardLimit = int32(i64) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SoftLimit": 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.SoftLimit = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsUlimitsList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsUlimitsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails(v **types.AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ReadOnly": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ReadOnly = jtv } case "SourceContainer": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceContainer = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsVolumesFromList(v *[]types.AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails, 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.AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionDetails(v **types.AwsEcsTaskDefinitionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerDefinitions": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionContainerDefinitionsList(&sv.ContainerDefinitions, value); err != nil { return err } case "Cpu": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Cpu = ptr.String(jtv) } case "ExecutionRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } case "Family": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Family = ptr.String(jtv) } case "InferenceAccelerators": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionInferenceAcceleratorsList(&sv.InferenceAccelerators, value); err != nil { return err } case "IpcMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IpcMode = ptr.String(jtv) } case "Memory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Memory = ptr.String(jtv) } case "NetworkMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkMode = ptr.String(jtv) } case "PidMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PidMode = ptr.String(jtv) } case "PlacementConstraints": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionPlacementConstraintsList(&sv.PlacementConstraints, value); err != nil { return err } case "ProxyConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionProxyConfigurationDetails(&sv.ProxyConfiguration, value); err != nil { return err } case "RequiresCompatibilities": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.RequiresCompatibilities, value); err != nil { return err } case "TaskRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TaskRoleArn = ptr.String(jtv) } case "Volumes": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesList(&sv.Volumes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionInferenceAcceleratorsDetails(v **types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "DeviceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeviceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionInferenceAcceleratorsList(v *[]types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails, 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.AwsEcsTaskDefinitionInferenceAcceleratorsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionInferenceAcceleratorsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionPlacementConstraintsDetails(v **types.AwsEcsTaskDefinitionPlacementConstraintsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionPlacementConstraintsDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionPlacementConstraintsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionPlacementConstraintsList(v *[]types.AwsEcsTaskDefinitionPlacementConstraintsDetails, 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.AwsEcsTaskDefinitionPlacementConstraintsDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionPlacementConstraintsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionPlacementConstraintsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionPlacementConstraintsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionProxyConfigurationDetails(v **types.AwsEcsTaskDefinitionProxyConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionProxyConfigurationDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionProxyConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerName = ptr.String(jtv) } case "ProxyConfigurationProperties": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesList(&sv.ProxyConfigurationProperties, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails(v **types.AwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesList(v *[]types.AwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails, 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.AwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionProxyConfigurationProxyConfigurationPropertiesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesDetails(v **types.AwsEcsTaskDefinitionVolumesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionVolumesDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionVolumesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DockerVolumeConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails(&sv.DockerVolumeConfiguration, value); err != nil { return err } case "EfsVolumeConfiguration": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationDetails(&sv.EfsVolumeConfiguration, value); err != nil { return err } case "Host": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesHostDetails(&sv.Host, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails(v **types.AwsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Autoprovision": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Autoprovision = jtv } case "Driver": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Driver = ptr.String(jtv) } case "DriverOpts": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.DriverOpts, value); err != nil { return err } case "Labels": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Labels, value); err != nil { return err } case "Scope": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Scope = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails(v **types.AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccessPointId = ptr.String(jtv) } case "Iam": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Iam = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationDetails(v **types.AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionVolumesEfsVolumeConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AuthorizationConfig": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesEfsVolumeConfigurationAuthorizationConfigDetails(&sv.AuthorizationConfig, value); err != nil { return err } case "FilesystemId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FilesystemId = ptr.String(jtv) } case "RootDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RootDirectory = ptr.String(jtv) } case "TransitEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TransitEncryption = ptr.String(jtv) } case "TransitEncryptionPort": 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.TransitEncryptionPort = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesHostDetails(v **types.AwsEcsTaskDefinitionVolumesHostDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDefinitionVolumesHostDetails if *v == nil { sv = &types.AwsEcsTaskDefinitionVolumesHostDetails{} } else { sv = *v } for key, value := range shape { switch key { case "SourcePath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourcePath = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesList(v *[]types.AwsEcsTaskDefinitionVolumesDetails, 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.AwsEcsTaskDefinitionVolumesDetails if *v == nil { cv = []types.AwsEcsTaskDefinitionVolumesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskDefinitionVolumesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskDetails(v **types.AwsEcsTaskDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskDetails if *v == nil { sv = &types.AwsEcsTaskDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "Containers": if err := awsRestjson1_deserializeDocumentAwsEcsContainerDetailsList(&sv.Containers, value); err != nil { return err } case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedAt = ptr.String(jtv) } case "Group": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Group = ptr.String(jtv) } case "StartedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StartedAt = ptr.String(jtv) } case "StartedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StartedBy = ptr.String(jtv) } case "TaskDefinitionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TaskDefinitionArn = 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) } case "Volumes": if err := awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetailsList(&sv.Volumes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetails(v **types.AwsEcsTaskVolumeDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskVolumeDetails if *v == nil { sv = &types.AwsEcsTaskVolumeDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Host": if err := awsRestjson1_deserializeDocumentAwsEcsTaskVolumeHostDetails(&sv.Host, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetailsList(v *[]types.AwsEcsTaskVolumeDetails, 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.AwsEcsTaskVolumeDetails if *v == nil { cv = []types.AwsEcsTaskVolumeDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEcsTaskVolumeDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEcsTaskVolumeHostDetails(v **types.AwsEcsTaskVolumeHostDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEcsTaskVolumeHostDetails if *v == nil { sv = &types.AwsEcsTaskVolumeHostDetails{} } else { sv = *v } for key, value := range shape { switch key { case "SourcePath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourcePath = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEfsAccessPointDetails(v **types.AwsEfsAccessPointDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEfsAccessPointDetails if *v == nil { sv = &types.AwsEfsAccessPointDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPointId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccessPointId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ClientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "FileSystemId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FileSystemId = ptr.String(jtv) } case "PosixUser": if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointPosixUserDetails(&sv.PosixUser, value); err != nil { return err } case "RootDirectory": if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryDetails(&sv.RootDirectory, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEfsAccessPointPosixUserDetails(v **types.AwsEfsAccessPointPosixUserDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEfsAccessPointPosixUserDetails if *v == nil { sv = &types.AwsEfsAccessPointPosixUserDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Gid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Gid = ptr.String(jtv) } case "SecondaryGids": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecondaryGids, value); err != nil { return err } case "Uid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Uid = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryCreationInfoDetails(v **types.AwsEfsAccessPointRootDirectoryCreationInfoDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEfsAccessPointRootDirectoryCreationInfoDetails if *v == nil { sv = &types.AwsEfsAccessPointRootDirectoryCreationInfoDetails{} } else { sv = *v } for key, value := range shape { switch key { case "OwnerGid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerGid = ptr.String(jtv) } case "OwnerUid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerUid = ptr.String(jtv) } case "Permissions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Permissions = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryDetails(v **types.AwsEfsAccessPointRootDirectoryDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEfsAccessPointRootDirectoryDetails if *v == nil { sv = &types.AwsEfsAccessPointRootDirectoryDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CreationInfo": if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryCreationInfoDetails(&sv.CreationInfo, value); err != nil { return err } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEksClusterDetails(v **types.AwsEksClusterDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEksClusterDetails if *v == nil { sv = &types.AwsEksClusterDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CertificateAuthorityData": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CertificateAuthorityData = ptr.String(jtv) } case "ClusterStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterStatus = ptr.String(jtv) } case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } case "Logging": if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(&sv.Logging, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ResourcesVpcConfig": if err := awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(&sv.ResourcesVpcConfig, value); err != nil { return err } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleArn = 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_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(v **types.AwsEksClusterLoggingClusterLoggingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEksClusterLoggingClusterLoggingDetails if *v == nil { sv = &types.AwsEksClusterLoggingClusterLoggingDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "Types": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Types, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(v *[]types.AwsEksClusterLoggingClusterLoggingDetails, 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.AwsEksClusterLoggingClusterLoggingDetails if *v == nil { cv = []types.AwsEksClusterLoggingClusterLoggingDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsEksClusterLoggingClusterLoggingDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(v **types.AwsEksClusterLoggingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEksClusterLoggingDetails if *v == nil { sv = &types.AwsEksClusterLoggingDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterLogging": if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(&sv.ClusterLogging, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(v **types.AwsEksClusterResourcesVpcConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEksClusterResourcesVpcConfigDetails if *v == nil { sv = &types.AwsEksClusterResourcesVpcConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "EndpointPublicAccess": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EndpointPublicAccess = jtv } case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentDetails(v **types.AwsElasticBeanstalkEnvironmentDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticBeanstalkEnvironmentDetails if *v == nil { sv = &types.AwsElasticBeanstalkEnvironmentDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ApplicationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApplicationName = ptr.String(jtv) } case "Cname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Cname = ptr.String(jtv) } case "DateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "DateUpdated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DateUpdated = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "EndpointUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EndpointUrl = ptr.String(jtv) } case "EnvironmentArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EnvironmentArn = ptr.String(jtv) } case "EnvironmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } case "EnvironmentLinks": if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLinks(&sv.EnvironmentLinks, value); err != nil { return err } case "EnvironmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EnvironmentName = ptr.String(jtv) } case "OptionSettings": if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSettings(&sv.OptionSettings, value); err != nil { return err } case "PlatformArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PlatformArn = ptr.String(jtv) } case "SolutionStackName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SolutionStackName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "Tier": if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentTier(&sv.Tier, value); err != nil { return err } case "VersionLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VersionLabel = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLink(v **types.AwsElasticBeanstalkEnvironmentEnvironmentLink, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticBeanstalkEnvironmentEnvironmentLink if *v == nil { sv = &types.AwsElasticBeanstalkEnvironmentEnvironmentLink{} } else { sv = *v } for key, value := range shape { switch key { case "EnvironmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EnvironmentName = ptr.String(jtv) } case "LinkName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LinkName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLinks(v *[]types.AwsElasticBeanstalkEnvironmentEnvironmentLink, 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.AwsElasticBeanstalkEnvironmentEnvironmentLink if *v == nil { cv = []types.AwsElasticBeanstalkEnvironmentEnvironmentLink{} } else { cv = *v } for _, value := range shape { var col types.AwsElasticBeanstalkEnvironmentEnvironmentLink destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLink(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting(v **types.AwsElasticBeanstalkEnvironmentOptionSetting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticBeanstalkEnvironmentOptionSetting if *v == nil { sv = &types.AwsElasticBeanstalkEnvironmentOptionSetting{} } else { sv = *v } for key, value := range shape { switch key { case "Namespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } case "OptionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OptionName = ptr.String(jtv) } case "ResourceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceName = 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_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSettings(v *[]types.AwsElasticBeanstalkEnvironmentOptionSetting, 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.AwsElasticBeanstalkEnvironmentOptionSetting if *v == nil { cv = []types.AwsElasticBeanstalkEnvironmentOptionSetting{} } else { cv = *v } for _, value := range shape { var col types.AwsElasticBeanstalkEnvironmentOptionSetting destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentTier(v **types.AwsElasticBeanstalkEnvironmentTier, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticBeanstalkEnvironmentTier if *v == nil { sv = &types.AwsElasticBeanstalkEnvironmentTier{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = 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 "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_deserializeDocumentAwsElasticsearchDomainDetails(v **types.AwsElasticsearchDomainDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainDetails if *v == nil { sv = &types.AwsElasticsearchDomainDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPolicies": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccessPolicies = ptr.String(jtv) } case "DomainEndpointOptions": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainDomainEndpointOptions(&sv.DomainEndpointOptions, value); err != nil { return err } case "DomainId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainId = ptr.String(jtv) } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "ElasticsearchClusterConfig": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainElasticsearchClusterConfigDetails(&sv.ElasticsearchClusterConfig, value); err != nil { return err } case "ElasticsearchVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ElasticsearchVersion = ptr.String(jtv) } case "EncryptionAtRestOptions": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainEncryptionAtRestOptions(&sv.EncryptionAtRestOptions, value); err != nil { return err } case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } case "Endpoints": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Endpoints, value); err != nil { return err } case "LogPublishingOptions": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainLogPublishingOptions(&sv.LogPublishingOptions, value); err != nil { return err } case "NodeToNodeEncryptionOptions": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainNodeToNodeEncryptionOptions(&sv.NodeToNodeEncryptionOptions, value); err != nil { return err } case "ServiceSoftwareOptions": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { return err } case "VPCOptions": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainVPCOptions(&sv.VPCOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainDomainEndpointOptions(v **types.AwsElasticsearchDomainDomainEndpointOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainDomainEndpointOptions if *v == nil { sv = &types.AwsElasticsearchDomainDomainEndpointOptions{} } else { sv = *v } for key, value := range shape { switch key { case "EnforceHTTPS": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnforceHTTPS = jtv } case "TLSSecurityPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TLSSecurityPolicy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainElasticsearchClusterConfigDetails(v **types.AwsElasticsearchDomainElasticsearchClusterConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainElasticsearchClusterConfigDetails if *v == nil { sv = &types.AwsElasticsearchDomainElasticsearchClusterConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DedicatedMasterCount": 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.DedicatedMasterCount = int32(i64) } case "DedicatedMasterEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DedicatedMasterEnabled = jtv } case "DedicatedMasterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DedicatedMasterType = ptr.String(jtv) } case "InstanceCount": 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.InstanceCount = int32(i64) } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "ZoneAwarenessConfig": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails(&sv.ZoneAwarenessConfig, value); err != nil { return err } case "ZoneAwarenessEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ZoneAwarenessEnabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails(v **types.AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails if *v == nil { sv = &types.AwsElasticsearchDomainElasticsearchClusterConfigZoneAwarenessConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZoneCount": 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.AvailabilityZoneCount = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainEncryptionAtRestOptions(v **types.AwsElasticsearchDomainEncryptionAtRestOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainEncryptionAtRestOptions if *v == nil { sv = &types.AwsElasticsearchDomainEncryptionAtRestOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainLogPublishingOptions(v **types.AwsElasticsearchDomainLogPublishingOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainLogPublishingOptions if *v == nil { sv = &types.AwsElasticsearchDomainLogPublishingOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AuditLogs": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainLogPublishingOptionsLogConfig(&sv.AuditLogs, value); err != nil { return err } case "IndexSlowLogs": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainLogPublishingOptionsLogConfig(&sv.IndexSlowLogs, value); err != nil { return err } case "SearchSlowLogs": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainLogPublishingOptionsLogConfig(&sv.SearchSlowLogs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainLogPublishingOptionsLogConfig(v **types.AwsElasticsearchDomainLogPublishingOptionsLogConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainLogPublishingOptionsLogConfig if *v == nil { sv = &types.AwsElasticsearchDomainLogPublishingOptionsLogConfig{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogsLogGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CloudWatchLogsLogGroupArn = ptr.String(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainNodeToNodeEncryptionOptions(v **types.AwsElasticsearchDomainNodeToNodeEncryptionOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainNodeToNodeEncryptionOptions if *v == nil { sv = &types.AwsElasticsearchDomainNodeToNodeEncryptionOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainServiceSoftwareOptions(v **types.AwsElasticsearchDomainServiceSoftwareOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainServiceSoftwareOptions if *v == nil { sv = &types.AwsElasticsearchDomainServiceSoftwareOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AutomatedUpdateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AutomatedUpdateDate = ptr.String(jtv) } case "Cancellable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Cancellable = jtv } case "CurrentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "NewVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NewVersion = ptr.String(jtv) } case "UpdateAvailable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UpdateAvailable = jtv } case "UpdateStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdateStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElasticsearchDomainVPCOptions(v **types.AwsElasticsearchDomainVPCOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElasticsearchDomainVPCOptions if *v == nil { sv = &types.AwsElasticsearchDomainVPCOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AvailabilityZones, value); err != nil { return err } case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { return err } 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_deserializeDocumentAwsElbAppCookieStickinessPolicies(v *[]types.AwsElbAppCookieStickinessPolicy, 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.AwsElbAppCookieStickinessPolicy if *v == nil { cv = []types.AwsElbAppCookieStickinessPolicy{} } else { cv = *v } for _, value := range shape { var col types.AwsElbAppCookieStickinessPolicy destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElbAppCookieStickinessPolicy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElbAppCookieStickinessPolicy(v **types.AwsElbAppCookieStickinessPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbAppCookieStickinessPolicy if *v == nil { sv = &types.AwsElbAppCookieStickinessPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "CookieName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CookieName = ptr.String(jtv) } case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicies(v *[]types.AwsElbLbCookieStickinessPolicy, 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.AwsElbLbCookieStickinessPolicy if *v == nil { cv = []types.AwsElbLbCookieStickinessPolicy{} } else { cv = *v } for _, value := range shape { var col types.AwsElbLbCookieStickinessPolicy destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicy(v **types.AwsElbLbCookieStickinessPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLbCookieStickinessPolicy if *v == nil { sv = &types.AwsElbLbCookieStickinessPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "CookieExpirationPeriod": 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.CookieExpirationPeriod = i64 } case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerAccessLog(v **types.AwsElbLoadBalancerAccessLog, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerAccessLog if *v == nil { sv = &types.AwsElbLoadBalancerAccessLog{} } else { sv = *v } for key, value := range shape { switch key { case "EmitInterval": 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.EmitInterval = int32(i64) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "S3BucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3BucketName = ptr.String(jtv) } case "S3BucketPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3BucketPrefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerAdditionalAttribute(v **types.AwsElbLoadBalancerAdditionalAttribute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerAdditionalAttribute if *v == nil { sv = &types.AwsElbLoadBalancerAdditionalAttribute{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected 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_deserializeDocumentAwsElbLoadBalancerAdditionalAttributeList(v *[]types.AwsElbLoadBalancerAdditionalAttribute, 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.AwsElbLoadBalancerAdditionalAttribute if *v == nil { cv = []types.AwsElbLoadBalancerAdditionalAttribute{} } else { cv = *v } for _, value := range shape { var col types.AwsElbLoadBalancerAdditionalAttribute destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerAdditionalAttribute(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerAttributes(v **types.AwsElbLoadBalancerAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerAttributes if *v == nil { sv = &types.AwsElbLoadBalancerAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "AccessLog": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerAccessLog(&sv.AccessLog, value); err != nil { return err } case "AdditionalAttributes": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerAdditionalAttributeList(&sv.AdditionalAttributes, value); err != nil { return err } case "ConnectionDraining": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionDraining(&sv.ConnectionDraining, value); err != nil { return err } case "ConnectionSettings": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionSettings(&sv.ConnectionSettings, value); err != nil { return err } case "CrossZoneLoadBalancing": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerCrossZoneLoadBalancing(&sv.CrossZoneLoadBalancing, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescription(v **types.AwsElbLoadBalancerBackendServerDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerBackendServerDescription if *v == nil { sv = &types.AwsElbLoadBalancerBackendServerDescription{} } else { sv = *v } for key, value := range shape { switch key { case "InstancePort": 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.InstancePort = int32(i64) } case "PolicyNames": if err := awsRestjson1_deserializeDocumentStringList(&sv.PolicyNames, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescriptions(v *[]types.AwsElbLoadBalancerBackendServerDescription, 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.AwsElbLoadBalancerBackendServerDescription if *v == nil { cv = []types.AwsElbLoadBalancerBackendServerDescription{} } else { cv = *v } for _, value := range shape { var col types.AwsElbLoadBalancerBackendServerDescription destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescription(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionDraining(v **types.AwsElbLoadBalancerConnectionDraining, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerConnectionDraining if *v == nil { sv = &types.AwsElbLoadBalancerConnectionDraining{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "Timeout": 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.Timeout = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionSettings(v **types.AwsElbLoadBalancerConnectionSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerConnectionSettings if *v == nil { sv = &types.AwsElbLoadBalancerConnectionSettings{} } else { sv = *v } for key, value := range shape { switch key { case "IdleTimeout": 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.IdleTimeout = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerCrossZoneLoadBalancing(v **types.AwsElbLoadBalancerCrossZoneLoadBalancing, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerCrossZoneLoadBalancing if *v == nil { sv = &types.AwsElbLoadBalancerCrossZoneLoadBalancing{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerDetails(v **types.AwsElbLoadBalancerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerDetails if *v == nil { sv = &types.AwsElbLoadBalancerDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { return err } case "BackendServerDescriptions": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescriptions(&sv.BackendServerDescriptions, value); err != nil { return err } case "CanonicalHostedZoneName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CanonicalHostedZoneName = ptr.String(jtv) } case "CanonicalHostedZoneNameID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CanonicalHostedZoneNameID = ptr.String(jtv) } case "CreatedTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedTime = ptr.String(jtv) } case "DnsName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DnsName = ptr.String(jtv) } case "HealthCheck": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerHealthCheck(&sv.HealthCheck, value); err != nil { return err } case "Instances": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstances(&sv.Instances, value); err != nil { return err } case "ListenerDescriptions": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescriptions(&sv.ListenerDescriptions, value); err != nil { return err } case "LoadBalancerAttributes": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerAttributes(&sv.LoadBalancerAttributes, value); err != nil { return err } case "LoadBalancerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LoadBalancerName = ptr.String(jtv) } case "Policies": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerPolicies(&sv.Policies, value); err != nil { return err } case "Scheme": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Scheme = ptr.String(jtv) } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentStringList(&sv.SecurityGroups, value); err != nil { return err } case "SourceSecurityGroup": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerSourceSecurityGroup(&sv.SourceSecurityGroup, value); err != nil { return err } case "Subnets": if err := awsRestjson1_deserializeDocumentStringList(&sv.Subnets, value); err != nil { return err } 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_deserializeDocumentAwsElbLoadBalancerHealthCheck(v **types.AwsElbLoadBalancerHealthCheck, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerHealthCheck if *v == nil { sv = &types.AwsElbLoadBalancerHealthCheck{} } else { sv = *v } for key, value := range shape { switch key { case "HealthyThreshold": 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.HealthyThreshold = int32(i64) } case "Interval": 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.Interval = int32(i64) } case "Target": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Target = ptr.String(jtv) } case "Timeout": 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.Timeout = int32(i64) } case "UnhealthyThreshold": 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.UnhealthyThreshold = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstance(v **types.AwsElbLoadBalancerInstance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerInstance if *v == nil { sv = &types.AwsElbLoadBalancerInstance{} } else { sv = *v } for key, value := range shape { switch key { 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstances(v *[]types.AwsElbLoadBalancerInstance, 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.AwsElbLoadBalancerInstance if *v == nil { cv = []types.AwsElbLoadBalancerInstance{} } else { cv = *v } for _, value := range shape { var col types.AwsElbLoadBalancerInstance destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstance(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerListener(v **types.AwsElbLoadBalancerListener, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerListener if *v == nil { sv = &types.AwsElbLoadBalancerListener{} } else { sv = *v } for key, value := range shape { switch key { case "InstancePort": 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.InstancePort = int32(i64) } case "InstanceProtocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceProtocol = ptr.String(jtv) } case "LoadBalancerPort": 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.LoadBalancerPort = int32(i64) } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } case "SslCertificateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SslCertificateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescription(v **types.AwsElbLoadBalancerListenerDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerListenerDescription if *v == nil { sv = &types.AwsElbLoadBalancerListenerDescription{} } else { sv = *v } for key, value := range shape { switch key { case "Listener": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerListener(&sv.Listener, value); err != nil { return err } case "PolicyNames": if err := awsRestjson1_deserializeDocumentStringList(&sv.PolicyNames, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescriptions(v *[]types.AwsElbLoadBalancerListenerDescription, 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.AwsElbLoadBalancerListenerDescription if *v == nil { cv = []types.AwsElbLoadBalancerListenerDescription{} } else { cv = *v } for _, value := range shape { var col types.AwsElbLoadBalancerListenerDescription destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescription(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerPolicies(v **types.AwsElbLoadBalancerPolicies, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerPolicies if *v == nil { sv = &types.AwsElbLoadBalancerPolicies{} } else { sv = *v } for key, value := range shape { switch key { case "AppCookieStickinessPolicies": if err := awsRestjson1_deserializeDocumentAwsElbAppCookieStickinessPolicies(&sv.AppCookieStickinessPolicies, value); err != nil { return err } case "LbCookieStickinessPolicies": if err := awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicies(&sv.LbCookieStickinessPolicies, value); err != nil { return err } case "OtherPolicies": if err := awsRestjson1_deserializeDocumentStringList(&sv.OtherPolicies, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbLoadBalancerSourceSecurityGroup(v **types.AwsElbLoadBalancerSourceSecurityGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbLoadBalancerSourceSecurityGroup if *v == nil { sv = &types.AwsElbLoadBalancerSourceSecurityGroup{} } else { sv = *v } for key, value := range shape { switch key { case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } case "OwnerAlias": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerAlias = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsElbv2LoadBalancerAttribute(v **types.AwsElbv2LoadBalancerAttribute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbv2LoadBalancerAttribute if *v == nil { sv = &types.AwsElbv2LoadBalancerAttribute{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected 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_deserializeDocumentAwsElbv2LoadBalancerAttributes(v *[]types.AwsElbv2LoadBalancerAttribute, 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.AwsElbv2LoadBalancerAttribute if *v == nil { cv = []types.AwsElbv2LoadBalancerAttribute{} } else { cv = *v } for _, value := range shape { var col types.AwsElbv2LoadBalancerAttribute destAddr := &col if err := awsRestjson1_deserializeDocumentAwsElbv2LoadBalancerAttribute(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsElbv2LoadBalancerDetails(v **types.AwsElbv2LoadBalancerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsElbv2LoadBalancerDetails if *v == nil { sv = &types.AwsElbv2LoadBalancerDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, value); err != nil { return err } case "CanonicalHostedZoneId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CanonicalHostedZoneId = ptr.String(jtv) } case "CreatedTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedTime = ptr.String(jtv) } case "DNSName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DNSName = ptr.String(jtv) } case "IpAddressType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IpAddressType = ptr.String(jtv) } case "LoadBalancerAttributes": if err := awsRestjson1_deserializeDocumentAwsElbv2LoadBalancerAttributes(&sv.LoadBalancerAttributes, value); err != nil { return err } case "Scheme": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Scheme = ptr.String(jtv) } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil { return err } case "State": if err := awsRestjson1_deserializeDocumentLoadBalancerState(&sv.State, value); err != nil { return err } 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_deserializeDocumentAwsEventSchemasRegistryDetails(v **types.AwsEventSchemasRegistryDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsEventSchemasRegistryDetails if *v == nil { sv = &types.AwsEventSchemasRegistryDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "RegistryArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegistryArn = ptr.String(jtv) } case "RegistryName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RegistryName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesCloudTrailDetails(v **types.AwsGuardDutyDetectorDataSourcesCloudTrailDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesCloudTrailDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesCloudTrailDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesDetails(v **types.AwsGuardDutyDetectorDataSourcesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CloudTrail": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesCloudTrailDetails(&sv.CloudTrail, value); err != nil { return err } case "DnsLogs": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesDnsLogsDetails(&sv.DnsLogs, value); err != nil { return err } case "FlowLogs": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesFlowLogsDetails(&sv.FlowLogs, value); err != nil { return err } case "Kubernetes": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesKubernetesDetails(&sv.Kubernetes, value); err != nil { return err } case "MalwareProtection": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesMalwareProtectionDetails(&sv.MalwareProtection, value); err != nil { return err } case "S3Logs": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesS3LogsDetails(&sv.S3Logs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesDnsLogsDetails(v **types.AwsGuardDutyDetectorDataSourcesDnsLogsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesDnsLogsDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesDnsLogsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesFlowLogsDetails(v **types.AwsGuardDutyDetectorDataSourcesFlowLogsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesFlowLogsDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesFlowLogsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesKubernetesAuditLogsDetails(v **types.AwsGuardDutyDetectorDataSourcesKubernetesAuditLogsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesKubernetesAuditLogsDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesKubernetesAuditLogsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesKubernetesDetails(v **types.AwsGuardDutyDetectorDataSourcesKubernetesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesKubernetesDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesKubernetesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AuditLogs": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesKubernetesAuditLogsDetails(&sv.AuditLogs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesMalwareProtectionDetails(v **types.AwsGuardDutyDetectorDataSourcesMalwareProtectionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesMalwareProtectionDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesMalwareProtectionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ScanEc2InstanceWithFindings": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsDetails(&sv.ScanEc2InstanceWithFindings, value); err != nil { return err } case "ServiceRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceRole = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsDetails(v **types.AwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "EbsVolumes": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesDetails(&sv.EbsVolumes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesDetails(v **types.AwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesS3LogsDetails(v **types.AwsGuardDutyDetectorDataSourcesS3LogsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDataSourcesS3LogsDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDataSourcesS3LogsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDetails(v **types.AwsGuardDutyDetectorDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorDetails if *v == nil { sv = &types.AwsGuardDutyDetectorDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DataSources": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDataSourcesDetails(&sv.DataSources, value); err != nil { return err } case "Features": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorFeaturesList(&sv.Features, value); err != nil { return err } case "FindingPublishingFrequency": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingPublishingFrequency = ptr.String(jtv) } case "ServiceRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServiceRole = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorFeaturesDetails(v **types.AwsGuardDutyDetectorFeaturesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsGuardDutyDetectorFeaturesDetails if *v == nil { sv = &types.AwsGuardDutyDetectorFeaturesDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsGuardDutyDetectorFeaturesList(v *[]types.AwsGuardDutyDetectorFeaturesDetails, 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.AwsGuardDutyDetectorFeaturesDetails if *v == nil { cv = []types.AwsGuardDutyDetectorFeaturesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsGuardDutyDetectorFeaturesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorFeaturesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIamAccessKeyDetails(v **types.AwsIamAccessKeyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamAccessKeyDetails if *v == nil { sv = &types.AwsIamAccessKeyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccessKeyId = ptr.String(jtv) } case "AccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedAt = ptr.String(jtv) } case "PrincipalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrincipalId = ptr.String(jtv) } case "PrincipalName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrincipalName = ptr.String(jtv) } case "PrincipalType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrincipalType = ptr.String(jtv) } case "SessionContext": if err := awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContext(&sv.SessionContext, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsIamAccessKeyStatus to be of type string, got %T instead", value) } sv.Status = types.AwsIamAccessKeyStatus(jtv) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContext(v **types.AwsIamAccessKeySessionContext, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamAccessKeySessionContext if *v == nil { sv = &types.AwsIamAccessKeySessionContext{} } else { sv = *v } for key, value := range shape { switch key { case "Attributes": if err := awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextAttributes(&sv.Attributes, value); err != nil { return err } case "SessionIssuer": if err := awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextSessionIssuer(&sv.SessionIssuer, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextAttributes(v **types.AwsIamAccessKeySessionContextAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamAccessKeySessionContextAttributes if *v == nil { sv = &types.AwsIamAccessKeySessionContextAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "CreationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreationDate = ptr.String(jtv) } case "MfaAuthenticated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MfaAuthenticated = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextSessionIssuer(v **types.AwsIamAccessKeySessionContextSessionIssuer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamAccessKeySessionContextSessionIssuer if *v == nil { sv = &types.AwsIamAccessKeySessionContextSessionIssuer{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "PrincipalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrincipalId = 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 "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicy(v **types.AwsIamAttachedManagedPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamAttachedManagedPolicy if *v == nil { sv = &types.AwsIamAttachedManagedPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "PolicyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyArn = ptr.String(jtv) } case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(v *[]types.AwsIamAttachedManagedPolicy, 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.AwsIamAttachedManagedPolicy if *v == nil { cv = []types.AwsIamAttachedManagedPolicy{} } else { cv = *v } for _, value := range shape { var col types.AwsIamAttachedManagedPolicy destAddr := &col if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIamGroupDetails(v **types.AwsIamGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamGroupDetails if *v == nil { sv = &types.AwsIamGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AttachedManagedPolicies": if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(&sv.AttachedManagedPolicies, value); err != nil { return err } case "CreateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateDate = ptr.String(jtv) } case "GroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupId = ptr.String(jtv) } case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } case "GroupPolicyList": if err := awsRestjson1_deserializeDocumentAwsIamGroupPolicyList(&sv.GroupPolicyList, value); err != nil { return err } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamGroupPolicy(v **types.AwsIamGroupPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamGroupPolicy if *v == nil { sv = &types.AwsIamGroupPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamGroupPolicyList(v *[]types.AwsIamGroupPolicy, 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.AwsIamGroupPolicy if *v == nil { cv = []types.AwsIamGroupPolicy{} } else { cv = *v } for _, value := range shape { var col types.AwsIamGroupPolicy destAddr := &col if err := awsRestjson1_deserializeDocumentAwsIamGroupPolicy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIamInstanceProfile(v **types.AwsIamInstanceProfile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamInstanceProfile if *v == nil { sv = &types.AwsIamInstanceProfile{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateDate = ptr.String(jtv) } case "InstanceProfileId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceProfileId = ptr.String(jtv) } case "InstanceProfileName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceProfileName = ptr.String(jtv) } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "Roles": if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfileRoles(&sv.Roles, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamInstanceProfileList(v *[]types.AwsIamInstanceProfile, 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.AwsIamInstanceProfile if *v == nil { cv = []types.AwsIamInstanceProfile{} } else { cv = *v } for _, value := range shape { var col types.AwsIamInstanceProfile destAddr := &col if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfile(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIamInstanceProfileRole(v **types.AwsIamInstanceProfileRole, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamInstanceProfileRole if *v == nil { sv = &types.AwsIamInstanceProfileRole{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AssumeRolePolicyDocument": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsIamRoleAssumeRolePolicyDocument to be of type string, got %T instead", value) } sv.AssumeRolePolicyDocument = ptr.String(jtv) } case "CreateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateDate = ptr.String(jtv) } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "RoleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleId = ptr.String(jtv) } case "RoleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamInstanceProfileRoles(v *[]types.AwsIamInstanceProfileRole, 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.AwsIamInstanceProfileRole if *v == nil { cv = []types.AwsIamInstanceProfileRole{} } else { cv = *v } for _, value := range shape { var col types.AwsIamInstanceProfileRole destAddr := &col if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfileRole(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIamPermissionsBoundary(v **types.AwsIamPermissionsBoundary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamPermissionsBoundary if *v == nil { sv = &types.AwsIamPermissionsBoundary{} } else { sv = *v } for key, value := range shape { switch key { case "PermissionsBoundaryArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PermissionsBoundaryArn = ptr.String(jtv) } case "PermissionsBoundaryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PermissionsBoundaryType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamPolicyDetails(v **types.AwsIamPolicyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamPolicyDetails if *v == nil { sv = &types.AwsIamPolicyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AttachmentCount": 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.AttachmentCount = int32(i64) } case "CreateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateDate = ptr.String(jtv) } case "DefaultVersionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultVersionId = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "IsAttachable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsAttachable = jtv } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "PermissionsBoundaryUsageCount": 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.PermissionsBoundaryUsageCount = int32(i64) } case "PolicyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyId = ptr.String(jtv) } case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } case "PolicyVersionList": if err := awsRestjson1_deserializeDocumentAwsIamPolicyVersionList(&sv.PolicyVersionList, value); err != nil { return err } case "UpdateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdateDate = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamPolicyVersion(v **types.AwsIamPolicyVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamPolicyVersion if *v == nil { sv = &types.AwsIamPolicyVersion{} } else { sv = *v } for key, value := range shape { switch key { case "CreateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateDate = ptr.String(jtv) } case "IsDefaultVersion": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsDefaultVersion = jtv } case "VersionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VersionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamPolicyVersionList(v *[]types.AwsIamPolicyVersion, 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.AwsIamPolicyVersion if *v == nil { cv = []types.AwsIamPolicyVersion{} } else { cv = *v } for _, value := range shape { var col types.AwsIamPolicyVersion destAddr := &col if err := awsRestjson1_deserializeDocumentAwsIamPolicyVersion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIamRoleDetails(v **types.AwsIamRoleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamRoleDetails if *v == nil { sv = &types.AwsIamRoleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AssumeRolePolicyDocument": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsIamRoleAssumeRolePolicyDocument to be of type string, got %T instead", value) } sv.AssumeRolePolicyDocument = ptr.String(jtv) } case "AttachedManagedPolicies": if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(&sv.AttachedManagedPolicies, value); err != nil { return err } case "CreateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateDate = ptr.String(jtv) } case "InstanceProfileList": if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfileList(&sv.InstanceProfileList, value); err != nil { return err } case "MaxSessionDuration": 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.MaxSessionDuration = int32(i64) } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "PermissionsBoundary": if err := awsRestjson1_deserializeDocumentAwsIamPermissionsBoundary(&sv.PermissionsBoundary, value); err != nil { return err } case "RoleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleId = ptr.String(jtv) } case "RoleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } case "RolePolicyList": if err := awsRestjson1_deserializeDocumentAwsIamRolePolicyList(&sv.RolePolicyList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamRolePolicy(v **types.AwsIamRolePolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamRolePolicy if *v == nil { sv = &types.AwsIamRolePolicy{} } else { sv = *v } for key, value := range shape { switch key { case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamRolePolicyList(v *[]types.AwsIamRolePolicy, 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.AwsIamRolePolicy if *v == nil { cv = []types.AwsIamRolePolicy{} } else { cv = *v } for _, value := range shape { var col types.AwsIamRolePolicy destAddr := &col if err := awsRestjson1_deserializeDocumentAwsIamRolePolicy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIamUserDetails(v **types.AwsIamUserDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamUserDetails if *v == nil { sv = &types.AwsIamUserDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AttachedManagedPolicies": if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(&sv.AttachedManagedPolicies, value); err != nil { return err } case "CreateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreateDate = ptr.String(jtv) } case "GroupList": if err := awsRestjson1_deserializeDocumentStringList(&sv.GroupList, value); err != nil { return err } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "PermissionsBoundary": if err := awsRestjson1_deserializeDocumentAwsIamPermissionsBoundary(&sv.PermissionsBoundary, value); err != nil { return err } case "UserId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserId = ptr.String(jtv) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } case "UserPolicyList": if err := awsRestjson1_deserializeDocumentAwsIamUserPolicyList(&sv.UserPolicyList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamUserPolicy(v **types.AwsIamUserPolicy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsIamUserPolicy if *v == nil { sv = &types.AwsIamUserPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsIamUserPolicyList(v *[]types.AwsIamUserPolicy, 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.AwsIamUserPolicy if *v == nil { cv = []types.AwsIamUserPolicy{} } else { cv = *v } for _, value := range shape { var col types.AwsIamUserPolicy destAddr := &col if err := awsRestjson1_deserializeDocumentAwsIamUserPolicy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsKinesisStreamDetails(v **types.AwsKinesisStreamDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsKinesisStreamDetails if *v == nil { sv = &types.AwsKinesisStreamDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RetentionPeriodHours": 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.RetentionPeriodHours = int32(i64) } case "ShardCount": 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.ShardCount = int32(i64) } case "StreamEncryption": if err := awsRestjson1_deserializeDocumentAwsKinesisStreamStreamEncryptionDetails(&sv.StreamEncryption, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsKinesisStreamStreamEncryptionDetails(v **types.AwsKinesisStreamStreamEncryptionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsKinesisStreamStreamEncryptionDetails if *v == nil { sv = &types.AwsKinesisStreamStreamEncryptionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "EncryptionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EncryptionType = ptr.String(jtv) } case "KeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsKmsKeyDetails(v **types.AwsKmsKeyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsKmsKeyDetails if *v == nil { sv = &types.AwsKmsKeyDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.AWSAccountId = ptr.String(jtv) } case "CreationDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationDate = 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.CreationDate = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "KeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyId = ptr.String(jtv) } case "KeyManager": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyManager = ptr.String(jtv) } case "KeyRotationStatus": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.KeyRotationStatus = jtv } case "KeyState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyState = ptr.String(jtv) } case "Origin": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Origin = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionCode(v **types.AwsLambdaFunctionCode, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionCode if *v == nil { sv = &types.AwsLambdaFunctionCode{} } else { sv = *v } for key, value := range shape { switch key { case "S3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "S3Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3Key = ptr.String(jtv) } case "S3ObjectVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3ObjectVersion = ptr.String(jtv) } case "ZipFile": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ZipFile = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionDeadLetterConfig(v **types.AwsLambdaFunctionDeadLetterConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionDeadLetterConfig if *v == nil { sv = &types.AwsLambdaFunctionDeadLetterConfig{} } else { sv = *v } for key, value := range shape { switch key { case "TargetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TargetArn = 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_deserializeDocumentNonEmptyStringList(&sv.Architectures, value); err != nil { return err } case "Code": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionCode(&sv.Code, 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 "DeadLetterConfig": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionDeadLetterConfig(&sv.DeadLetterConfig, value); err != nil { return err } case "Environment": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironment(&sv.Environment, value); err != nil { return err } 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 "Handler": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Handler = ptr.String(jtv) } case "KmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyArn = ptr.String(jtv) } case "LastModified": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastModified = ptr.String(jtv) } case "Layers": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionLayerList(&sv.Layers, value); err != nil { return err } case "MasterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterArn = ptr.String(jtv) } case "MemorySize": 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.MemorySize = int32(i64) } case "PackageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PackageType = ptr.String(jtv) } case "RevisionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RevisionId = ptr.String(jtv) } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Role = ptr.String(jtv) } case "Runtime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Runtime = ptr.String(jtv) } case "Timeout": 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.Timeout = int32(i64) } case "TracingConfig": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionTracingConfig(&sv.TracingConfig, value); err != nil { return err } 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) } case "VpcConfig": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionVpcConfig(&sv.VpcConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironment(v **types.AwsLambdaFunctionEnvironment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionEnvironment if *v == nil { sv = &types.AwsLambdaFunctionEnvironment{} } else { sv = *v } for key, value := range shape { switch key { case "Error": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironmentError(&sv.Error, value); err != nil { return err } case "Variables": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Variables, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironmentError(v **types.AwsLambdaFunctionEnvironmentError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionEnvironmentError if *v == nil { sv = &types.AwsLambdaFunctionEnvironmentError{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionLayer(v **types.AwsLambdaFunctionLayer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionLayer if *v == nil { sv = &types.AwsLambdaFunctionLayer{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CodeSize": 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.CodeSize = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionLayerList(v *[]types.AwsLambdaFunctionLayer, 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.AwsLambdaFunctionLayer if *v == nil { cv = []types.AwsLambdaFunctionLayer{} } else { cv = *v } for _, value := range shape { var col types.AwsLambdaFunctionLayer destAddr := &col if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionLayer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionTracingConfig(v **types.AwsLambdaFunctionTracingConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionTracingConfig if *v == nil { sv = &types.AwsLambdaFunctionTracingConfig{} } else { sv = *v } for key, value := range shape { switch key { case "Mode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Mode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsLambdaFunctionVpcConfig(v **types.AwsLambdaFunctionVpcConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaFunctionVpcConfig if *v == nil { sv = &types.AwsLambdaFunctionVpcConfig{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { return err } 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_deserializeDocumentAwsLambdaLayerVersionDetails(v **types.AwsLambdaLayerVersionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsLambdaLayerVersionDetails if *v == nil { sv = &types.AwsLambdaLayerVersionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CompatibleRuntimes": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.CompatibleRuntimes, value); err != nil { return err } case "CreatedDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedDate = ptr.String(jtv) } case "Version": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected AwsLambdaLayerVersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Version = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsMountPoint(v **types.AwsMountPoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsMountPoint if *v == nil { sv = &types.AwsMountPoint{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerPath = ptr.String(jtv) } case "SourceVolume": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceVolume = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsMountPointList(v *[]types.AwsMountPoint, 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.AwsMountPoint if *v == nil { cv = []types.AwsMountPoint{} } else { cv = *v } for _, value := range shape { var col types.AwsMountPoint destAddr := &col if err := awsRestjson1_deserializeDocumentAwsMountPoint(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallDetails(v **types.AwsNetworkFirewallFirewallDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsNetworkFirewallFirewallDetails if *v == nil { sv = &types.AwsNetworkFirewallFirewallDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeleteProtection": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeleteProtection = jtv } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "FirewallArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirewallArn = ptr.String(jtv) } case "FirewallId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirewallId = ptr.String(jtv) } case "FirewallName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirewallName = ptr.String(jtv) } case "FirewallPolicyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirewallPolicyArn = ptr.String(jtv) } case "FirewallPolicyChangeProtection": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.FirewallPolicyChangeProtection = jtv } case "SubnetChangeProtection": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.SubnetChangeProtection = jtv } case "SubnetMappings": if err := awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallSubnetMappingsList(&sv.SubnetMappings, value); err != nil { return err } 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_deserializeDocumentAwsNetworkFirewallFirewallPolicyDetails(v **types.AwsNetworkFirewallFirewallPolicyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsNetworkFirewallFirewallPolicyDetails if *v == nil { sv = &types.AwsNetworkFirewallFirewallPolicyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "FirewallPolicy": if err := awsRestjson1_deserializeDocumentFirewallPolicyDetails(&sv.FirewallPolicy, value); err != nil { return err } case "FirewallPolicyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirewallPolicyArn = ptr.String(jtv) } case "FirewallPolicyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirewallPolicyId = ptr.String(jtv) } case "FirewallPolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirewallPolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallSubnetMappingsDetails(v **types.AwsNetworkFirewallFirewallSubnetMappingsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsNetworkFirewallFirewallSubnetMappingsDetails if *v == nil { sv = &types.AwsNetworkFirewallFirewallSubnetMappingsDetails{} } else { sv = *v } for key, value := range shape { switch key { 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallSubnetMappingsList(v *[]types.AwsNetworkFirewallFirewallSubnetMappingsDetails, 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.AwsNetworkFirewallFirewallSubnetMappingsDetails if *v == nil { cv = []types.AwsNetworkFirewallFirewallSubnetMappingsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsNetworkFirewallFirewallSubnetMappingsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallSubnetMappingsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsNetworkFirewallRuleGroupDetails(v **types.AwsNetworkFirewallRuleGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsNetworkFirewallRuleGroupDetails if *v == nil { sv = &types.AwsNetworkFirewallRuleGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Capacity": 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.Capacity = int32(i64) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "RuleGroup": if err := awsRestjson1_deserializeDocumentRuleGroupDetails(&sv.RuleGroup, value); err != nil { return err } case "RuleGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleGroupArn = ptr.String(jtv) } case "RuleGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleGroupId = ptr.String(jtv) } case "RuleGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleGroupName = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails(v **types.AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "InternalUserDatabaseEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.InternalUserDatabaseEnabled = jtv } case "MasterUserOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainMasterUserOptionsDetails(&sv.MasterUserOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainClusterConfigDetails(v **types.AwsOpenSearchServiceDomainClusterConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainClusterConfigDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainClusterConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DedicatedMasterCount": 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.DedicatedMasterCount = int32(i64) } case "DedicatedMasterEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DedicatedMasterEnabled = jtv } case "DedicatedMasterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DedicatedMasterType = ptr.String(jtv) } case "InstanceCount": 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.InstanceCount = int32(i64) } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "WarmCount": 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.WarmCount = int32(i64) } case "WarmEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.WarmEnabled = jtv } case "WarmType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WarmType = ptr.String(jtv) } case "ZoneAwarenessConfig": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainClusterConfigZoneAwarenessConfigDetails(&sv.ZoneAwarenessConfig, value); err != nil { return err } case "ZoneAwarenessEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ZoneAwarenessEnabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainClusterConfigZoneAwarenessConfigDetails(v **types.AwsOpenSearchServiceDomainClusterConfigZoneAwarenessConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainClusterConfigZoneAwarenessConfigDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainClusterConfigZoneAwarenessConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZoneCount": 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.AvailabilityZoneCount = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainDetails(v **types.AwsOpenSearchServiceDomainDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessPolicies": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccessPolicies = ptr.String(jtv) } case "AdvancedSecurityOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails(&sv.AdvancedSecurityOptions, value); err != nil { return err } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ClusterConfig": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainClusterConfigDetails(&sv.ClusterConfig, value); err != nil { return err } case "DomainEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainEndpoint = ptr.String(jtv) } case "DomainEndpointOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainDomainEndpointOptionsDetails(&sv.DomainEndpointOptions, value); err != nil { return err } case "DomainEndpoints": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.DomainEndpoints, value); err != nil { return err } case "DomainName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DomainName = ptr.String(jtv) } case "EncryptionAtRestOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainEncryptionAtRestOptionsDetails(&sv.EncryptionAtRestOptions, value); err != nil { return err } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } 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 "LogPublishingOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainLogPublishingOptionsDetails(&sv.LogPublishingOptions, value); err != nil { return err } case "NodeToNodeEncryptionOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails(&sv.NodeToNodeEncryptionOptions, value); err != nil { return err } case "ServiceSoftwareOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainServiceSoftwareOptionsDetails(&sv.ServiceSoftwareOptions, value); err != nil { return err } case "VpcOptions": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainVpcOptionsDetails(&sv.VpcOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainDomainEndpointOptionsDetails(v **types.AwsOpenSearchServiceDomainDomainEndpointOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainDomainEndpointOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainDomainEndpointOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustomEndpoint = ptr.String(jtv) } case "CustomEndpointCertificateArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustomEndpointCertificateArn = ptr.String(jtv) } case "CustomEndpointEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CustomEndpointEnabled = jtv } case "EnforceHTTPS": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnforceHTTPS = jtv } case "TLSSecurityPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TLSSecurityPolicy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainEncryptionAtRestOptionsDetails(v **types.AwsOpenSearchServiceDomainEncryptionAtRestOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainEncryptionAtRestOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainEncryptionAtRestOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainLogPublishingOption(v **types.AwsOpenSearchServiceDomainLogPublishingOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainLogPublishingOption if *v == nil { sv = &types.AwsOpenSearchServiceDomainLogPublishingOption{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogsLogGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CloudWatchLogsLogGroupArn = ptr.String(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainLogPublishingOptionsDetails(v **types.AwsOpenSearchServiceDomainLogPublishingOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainLogPublishingOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainLogPublishingOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AuditLogs": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainLogPublishingOption(&sv.AuditLogs, value); err != nil { return err } case "IndexSlowLogs": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainLogPublishingOption(&sv.IndexSlowLogs, value); err != nil { return err } case "SearchSlowLogs": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainLogPublishingOption(&sv.SearchSlowLogs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainMasterUserOptionsDetails(v **types.AwsOpenSearchServiceDomainMasterUserOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainMasterUserOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainMasterUserOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MasterUserArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUserArn = ptr.String(jtv) } case "MasterUserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUserName = ptr.String(jtv) } case "MasterUserPassword": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUserPassword = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails(v **types.AwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainServiceSoftwareOptionsDetails(v **types.AwsOpenSearchServiceDomainServiceSoftwareOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainServiceSoftwareOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainServiceSoftwareOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AutomatedUpdateDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AutomatedUpdateDate = ptr.String(jtv) } case "Cancellable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Cancellable = jtv } case "CurrentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "NewVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NewVersion = ptr.String(jtv) } case "OptionalDeployment": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.OptionalDeployment = jtv } case "UpdateAvailable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UpdateAvailable = jtv } case "UpdateStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdateStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainVpcOptionsDetails(v **types.AwsOpenSearchServiceDomainVpcOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsOpenSearchServiceDomainVpcOptionsDetails if *v == nil { sv = &types.AwsOpenSearchServiceDomainVpcOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRole(v **types.AwsRdsDbClusterAssociatedRole, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbClusterAssociatedRole if *v == nil { sv = &types.AwsRdsDbClusterAssociatedRole{} } else { sv = *v } for key, value := range shape { switch key { case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRoles(v *[]types.AwsRdsDbClusterAssociatedRole, 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.AwsRdsDbClusterAssociatedRole if *v == nil { cv = []types.AwsRdsDbClusterAssociatedRole{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbClusterAssociatedRole destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRole(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterDetails(v **types.AwsRdsDbClusterDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbClusterDetails if *v == nil { sv = &types.AwsRdsDbClusterDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ActivityStreamStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActivityStreamStatus = ptr.String(jtv) } case "AllocatedStorage": 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.AllocatedStorage = int32(i64) } case "AssociatedRoles": if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRoles(&sv.AssociatedRoles, value); err != nil { return err } case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { return err } case "BackupRetentionPeriod": 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.BackupRetentionPeriod = int32(i64) } case "ClusterCreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterCreateTime = ptr.String(jtv) } case "CopyTagsToSnapshot": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTagsToSnapshot = jtv } case "CrossAccountClone": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CrossAccountClone = jtv } case "CustomEndpoints": if err := awsRestjson1_deserializeDocumentStringList(&sv.CustomEndpoints, value); err != nil { return err } case "DatabaseName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DatabaseName = ptr.String(jtv) } case "DbClusterIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbClusterIdentifier = ptr.String(jtv) } case "DbClusterMembers": if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterMembers(&sv.DbClusterMembers, value); err != nil { return err } case "DbClusterOptionGroupMemberships": if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMemberships(&sv.DbClusterOptionGroupMemberships, value); err != nil { return err } case "DbClusterParameterGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbClusterParameterGroup = ptr.String(jtv) } case "DbClusterResourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbClusterResourceId = ptr.String(jtv) } case "DbSubnetGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSubnetGroup = ptr.String(jtv) } case "DeletionProtection": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeletionProtection = jtv } case "DomainMemberships": if err := awsRestjson1_deserializeDocumentAwsRdsDbDomainMemberships(&sv.DomainMemberships, value); err != nil { return err } case "EnabledCloudWatchLogsExports": if err := awsRestjson1_deserializeDocumentStringList(&sv.EnabledCloudWatchLogsExports, value); err != nil { return err } case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } case "Engine": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Engine = ptr.String(jtv) } case "EngineMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineMode = ptr.String(jtv) } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "HostedZoneId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HostedZoneId = ptr.String(jtv) } case "HttpEndpointEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.HttpEndpointEnabled = jtv } case "IamDatabaseAuthenticationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IamDatabaseAuthenticationEnabled = jtv } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "MasterUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUsername = ptr.String(jtv) } case "MultiAz": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MultiAz = jtv } case "Port": 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.Port = int32(i64) } case "PreferredBackupWindow": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PreferredBackupWindow = ptr.String(jtv) } case "PreferredMaintenanceWindow": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PreferredMaintenanceWindow = ptr.String(jtv) } case "ReaderEndpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ReaderEndpoint = ptr.String(jtv) } case "ReadReplicaIdentifiers": if err := awsRestjson1_deserializeDocumentStringList(&sv.ReadReplicaIdentifiers, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "StorageEncrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.StorageEncrypted = jtv } case "VpcSecurityGroups": if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroups(&sv.VpcSecurityGroups, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterMember(v **types.AwsRdsDbClusterMember, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbClusterMember if *v == nil { sv = &types.AwsRdsDbClusterMember{} } else { sv = *v } for key, value := range shape { switch key { case "DbClusterParameterGroupStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbClusterParameterGroupStatus = ptr.String(jtv) } case "DbInstanceIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbInstanceIdentifier = ptr.String(jtv) } case "IsClusterWriter": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsClusterWriter = jtv } case "PromotionTier": 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.PromotionTier = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterMembers(v *[]types.AwsRdsDbClusterMember, 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.AwsRdsDbClusterMember if *v == nil { cv = []types.AwsRdsDbClusterMember{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbClusterMember destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterMember(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMembership(v **types.AwsRdsDbClusterOptionGroupMembership, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbClusterOptionGroupMembership if *v == nil { sv = &types.AwsRdsDbClusterOptionGroupMembership{} } else { sv = *v } for key, value := range shape { switch key { case "DbClusterOptionGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbClusterOptionGroupName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMemberships(v *[]types.AwsRdsDbClusterOptionGroupMembership, 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.AwsRdsDbClusterOptionGroupMembership if *v == nil { cv = []types.AwsRdsDbClusterOptionGroupMembership{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbClusterOptionGroupMembership destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMembership(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDbClusterSnapshotAttribute(v **types.AwsRdsDbClusterSnapshotDbClusterSnapshotAttribute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbClusterSnapshotDbClusterSnapshotAttribute if *v == nil { sv = &types.AwsRdsDbClusterSnapshotDbClusterSnapshotAttribute{} } else { sv = *v } for key, value := range shape { switch key { case "AttributeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AttributeName = ptr.String(jtv) } case "AttributeValues": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AttributeValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDbClusterSnapshotAttributes(v *[]types.AwsRdsDbClusterSnapshotDbClusterSnapshotAttribute, 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.AwsRdsDbClusterSnapshotDbClusterSnapshotAttribute if *v == nil { cv = []types.AwsRdsDbClusterSnapshotDbClusterSnapshotAttribute{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbClusterSnapshotDbClusterSnapshotAttribute destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDbClusterSnapshotAttribute(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDetails(v **types.AwsRdsDbClusterSnapshotDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbClusterSnapshotDetails if *v == nil { sv = &types.AwsRdsDbClusterSnapshotDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AllocatedStorage": 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.AllocatedStorage = int32(i64) } case "AvailabilityZones": if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { return err } case "ClusterCreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterCreateTime = ptr.String(jtv) } case "DbClusterIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbClusterIdentifier = ptr.String(jtv) } case "DbClusterSnapshotAttributes": if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDbClusterSnapshotAttributes(&sv.DbClusterSnapshotAttributes, value); err != nil { return err } case "DbClusterSnapshotIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbClusterSnapshotIdentifier = ptr.String(jtv) } case "Engine": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Engine = ptr.String(jtv) } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "IamDatabaseAuthenticationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IamDatabaseAuthenticationEnabled = jtv } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "LicenseModel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LicenseModel = ptr.String(jtv) } case "MasterUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUsername = ptr.String(jtv) } case "PercentProgress": 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.PercentProgress = int32(i64) } case "Port": 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.Port = int32(i64) } case "SnapshotCreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotCreateTime = ptr.String(jtv) } case "SnapshotType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotType = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "StorageEncrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.StorageEncrypted = 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_deserializeDocumentAwsRdsDbDomainMembership(v **types.AwsRdsDbDomainMembership, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbDomainMembership if *v == nil { sv = &types.AwsRdsDbDomainMembership{} } else { sv = *v } for key, value := range shape { switch key { case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } case "Fqdn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Fqdn = ptr.String(jtv) } case "IamRoleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IamRoleName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbDomainMemberships(v *[]types.AwsRdsDbDomainMembership, 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.AwsRdsDbDomainMembership if *v == nil { cv = []types.AwsRdsDbDomainMembership{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbDomainMembership destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbDomainMembership(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRole(v **types.AwsRdsDbInstanceAssociatedRole, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbInstanceAssociatedRole if *v == nil { sv = &types.AwsRdsDbInstanceAssociatedRole{} } else { sv = *v } for key, value := range shape { switch key { case "FeatureName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FeatureName = ptr.String(jtv) } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRoles(v *[]types.AwsRdsDbInstanceAssociatedRole, 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.AwsRdsDbInstanceAssociatedRole if *v == nil { cv = []types.AwsRdsDbInstanceAssociatedRole{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbInstanceAssociatedRole destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRole(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbInstanceDetails(v **types.AwsRdsDbInstanceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbInstanceDetails if *v == nil { sv = &types.AwsRdsDbInstanceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AllocatedStorage": 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.AllocatedStorage = int32(i64) } case "AssociatedRoles": if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRoles(&sv.AssociatedRoles, value); err != nil { return err } case "AutoMinorVersionUpgrade": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoMinorVersionUpgrade = jtv } case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "BackupRetentionPeriod": 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.BackupRetentionPeriod = int32(i64) } case "CACertificateIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CACertificateIdentifier = ptr.String(jtv) } case "CharacterSetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CharacterSetName = ptr.String(jtv) } case "CopyTagsToSnapshot": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CopyTagsToSnapshot = jtv } case "DBClusterIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DBClusterIdentifier = ptr.String(jtv) } case "DBInstanceClass": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DBInstanceClass = ptr.String(jtv) } case "DBInstanceIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DBInstanceIdentifier = ptr.String(jtv) } case "DbInstancePort": 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.DbInstancePort = int32(i64) } case "DbInstanceStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbInstanceStatus = ptr.String(jtv) } case "DbiResourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbiResourceId = ptr.String(jtv) } case "DBName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DBName = ptr.String(jtv) } case "DbParameterGroups": if err := awsRestjson1_deserializeDocumentAwsRdsDbParameterGroups(&sv.DbParameterGroups, value); err != nil { return err } case "DbSecurityGroups": if err := awsRestjson1_deserializeDocumentStringList(&sv.DbSecurityGroups, value); err != nil { return err } case "DbSubnetGroup": if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroup(&sv.DbSubnetGroup, value); err != nil { return err } case "DeletionProtection": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DeletionProtection = jtv } case "DomainMemberships": if err := awsRestjson1_deserializeDocumentAwsRdsDbDomainMemberships(&sv.DomainMemberships, value); err != nil { return err } case "EnabledCloudWatchLogsExports": if err := awsRestjson1_deserializeDocumentStringList(&sv.EnabledCloudWatchLogsExports, value); err != nil { return err } case "Endpoint": if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceEndpoint(&sv.Endpoint, value); err != nil { return err } case "Engine": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Engine = ptr.String(jtv) } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "EnhancedMonitoringResourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EnhancedMonitoringResourceArn = ptr.String(jtv) } case "IAMDatabaseAuthenticationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IAMDatabaseAuthenticationEnabled = jtv } case "InstanceCreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceCreateTime = ptr.String(jtv) } case "Iops": 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.Iops = int32(i64) } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "LatestRestorableTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LatestRestorableTime = ptr.String(jtv) } case "LicenseModel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LicenseModel = ptr.String(jtv) } case "ListenerEndpoint": if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceEndpoint(&sv.ListenerEndpoint, value); err != nil { return err } case "MasterUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUsername = ptr.String(jtv) } case "MaxAllocatedStorage": 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.MaxAllocatedStorage = int32(i64) } case "MonitoringInterval": 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.MonitoringInterval = int32(i64) } case "MonitoringRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MonitoringRoleArn = ptr.String(jtv) } case "MultiAz": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MultiAz = jtv } case "OptionGroupMemberships": if err := awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMemberships(&sv.OptionGroupMemberships, value); err != nil { return err } case "PendingModifiedValues": if err := awsRestjson1_deserializeDocumentAwsRdsDbPendingModifiedValues(&sv.PendingModifiedValues, value); err != nil { return err } case "PerformanceInsightsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PerformanceInsightsEnabled = jtv } case "PerformanceInsightsKmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PerformanceInsightsKmsKeyId = ptr.String(jtv) } case "PerformanceInsightsRetentionPeriod": 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.PerformanceInsightsRetentionPeriod = int32(i64) } case "PreferredBackupWindow": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PreferredBackupWindow = ptr.String(jtv) } case "PreferredMaintenanceWindow": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PreferredMaintenanceWindow = ptr.String(jtv) } case "ProcessorFeatures": if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(&sv.ProcessorFeatures, value); err != nil { return err } case "PromotionTier": 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.PromotionTier = int32(i64) } case "PubliclyAccessible": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PubliclyAccessible = jtv } case "ReadReplicaDBClusterIdentifiers": if err := awsRestjson1_deserializeDocumentStringList(&sv.ReadReplicaDBClusterIdentifiers, value); err != nil { return err } case "ReadReplicaDBInstanceIdentifiers": if err := awsRestjson1_deserializeDocumentStringList(&sv.ReadReplicaDBInstanceIdentifiers, value); err != nil { return err } case "ReadReplicaSourceDBInstanceIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ReadReplicaSourceDBInstanceIdentifier = ptr.String(jtv) } case "SecondaryAvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecondaryAvailabilityZone = ptr.String(jtv) } case "StatusInfos": if err := awsRestjson1_deserializeDocumentAwsRdsDbStatusInfos(&sv.StatusInfos, value); err != nil { return err } case "StorageEncrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.StorageEncrypted = jtv } case "StorageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StorageType = ptr.String(jtv) } case "TdeCredentialArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TdeCredentialArn = ptr.String(jtv) } case "Timezone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Timezone = ptr.String(jtv) } case "VpcSecurityGroups": if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroups(&sv.VpcSecurityGroups, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbInstanceEndpoint(v **types.AwsRdsDbInstanceEndpoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbInstanceEndpoint if *v == nil { sv = &types.AwsRdsDbInstanceEndpoint{} } else { sv = *v } for key, value := range shape { switch key { case "Address": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Address = ptr.String(jtv) } case "HostedZoneId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HostedZoneId = ptr.String(jtv) } case "Port": 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.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroup(v **types.AwsRdsDbInstanceVpcSecurityGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbInstanceVpcSecurityGroup if *v == nil { sv = &types.AwsRdsDbInstanceVpcSecurityGroup{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "VpcSecurityGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpcSecurityGroupId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroups(v *[]types.AwsRdsDbInstanceVpcSecurityGroup, 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.AwsRdsDbInstanceVpcSecurityGroup if *v == nil { cv = []types.AwsRdsDbInstanceVpcSecurityGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbInstanceVpcSecurityGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMembership(v **types.AwsRdsDbOptionGroupMembership, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbOptionGroupMembership if *v == nil { sv = &types.AwsRdsDbOptionGroupMembership{} } else { sv = *v } for key, value := range shape { switch key { case "OptionGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OptionGroupName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMemberships(v *[]types.AwsRdsDbOptionGroupMembership, 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.AwsRdsDbOptionGroupMembership if *v == nil { cv = []types.AwsRdsDbOptionGroupMembership{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbOptionGroupMembership destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMembership(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbParameterGroup(v **types.AwsRdsDbParameterGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbParameterGroup if *v == nil { sv = &types.AwsRdsDbParameterGroup{} } else { sv = *v } for key, value := range shape { switch key { case "DbParameterGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbParameterGroupName = ptr.String(jtv) } case "ParameterApplyStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParameterApplyStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbParameterGroups(v *[]types.AwsRdsDbParameterGroup, 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.AwsRdsDbParameterGroup if *v == nil { cv = []types.AwsRdsDbParameterGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbParameterGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbParameterGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbPendingModifiedValues(v **types.AwsRdsDbPendingModifiedValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbPendingModifiedValues if *v == nil { sv = &types.AwsRdsDbPendingModifiedValues{} } else { sv = *v } for key, value := range shape { switch key { case "AllocatedStorage": 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.AllocatedStorage = int32(i64) } case "BackupRetentionPeriod": 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.BackupRetentionPeriod = int32(i64) } case "CaCertificateIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CaCertificateIdentifier = ptr.String(jtv) } case "DbInstanceClass": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbInstanceClass = ptr.String(jtv) } case "DbInstanceIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbInstanceIdentifier = ptr.String(jtv) } case "DbSubnetGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSubnetGroupName = ptr.String(jtv) } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "Iops": 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.Iops = int32(i64) } case "LicenseModel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LicenseModel = ptr.String(jtv) } case "MasterUserPassword": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUserPassword = ptr.String(jtv) } case "MultiAZ": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.MultiAZ = jtv } case "PendingCloudWatchLogsExports": if err := awsRestjson1_deserializeDocumentAwsRdsPendingCloudWatchLogsExports(&sv.PendingCloudWatchLogsExports, value); err != nil { return err } case "Port": 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.Port = int32(i64) } case "ProcessorFeatures": if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(&sv.ProcessorFeatures, value); err != nil { return err } case "StorageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StorageType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeature(v **types.AwsRdsDbProcessorFeature, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbProcessorFeature if *v == nil { sv = &types.AwsRdsDbProcessorFeature{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(v *[]types.AwsRdsDbProcessorFeature, 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.AwsRdsDbProcessorFeature if *v == nil { cv = []types.AwsRdsDbProcessorFeature{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbProcessorFeature destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeature(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupDetails(v **types.AwsRdsDbSecurityGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbSecurityGroupDetails if *v == nil { sv = &types.AwsRdsDbSecurityGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DbSecurityGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSecurityGroupArn = ptr.String(jtv) } case "DbSecurityGroupDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSecurityGroupDescription = ptr.String(jtv) } case "DbSecurityGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSecurityGroupName = ptr.String(jtv) } case "Ec2SecurityGroups": if err := awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupEc2SecurityGroups(&sv.Ec2SecurityGroups, value); err != nil { return err } case "IpRanges": if err := awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupIpRanges(&sv.IpRanges, value); err != nil { return err } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerId = 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_deserializeDocumentAwsRdsDbSecurityGroupEc2SecurityGroup(v **types.AwsRdsDbSecurityGroupEc2SecurityGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbSecurityGroupEc2SecurityGroup if *v == nil { sv = &types.AwsRdsDbSecurityGroupEc2SecurityGroup{} } else { sv = *v } for key, value := range shape { switch key { case "Ec2SecurityGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ec2SecurityGroupId = ptr.String(jtv) } case "Ec2SecurityGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ec2SecurityGroupName = ptr.String(jtv) } case "Ec2SecurityGroupOwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ec2SecurityGroupOwnerId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupEc2SecurityGroups(v *[]types.AwsRdsDbSecurityGroupEc2SecurityGroup, 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.AwsRdsDbSecurityGroupEc2SecurityGroup if *v == nil { cv = []types.AwsRdsDbSecurityGroupEc2SecurityGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbSecurityGroupEc2SecurityGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupEc2SecurityGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupIpRange(v **types.AwsRdsDbSecurityGroupIpRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbSecurityGroupIpRange if *v == nil { sv = &types.AwsRdsDbSecurityGroupIpRange{} } else { sv = *v } for key, value := range shape { switch key { case "CidrIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrIp = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupIpRanges(v *[]types.AwsRdsDbSecurityGroupIpRange, 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.AwsRdsDbSecurityGroupIpRange if *v == nil { cv = []types.AwsRdsDbSecurityGroupIpRange{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbSecurityGroupIpRange destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupIpRange(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSnapshotDetails(v **types.AwsRdsDbSnapshotDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbSnapshotDetails if *v == nil { sv = &types.AwsRdsDbSnapshotDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AllocatedStorage": 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.AllocatedStorage = int32(i64) } case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "DbInstanceIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbInstanceIdentifier = ptr.String(jtv) } case "DbiResourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbiResourceId = ptr.String(jtv) } case "DbSnapshotIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSnapshotIdentifier = ptr.String(jtv) } case "Encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Encrypted = jtv } case "Engine": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Engine = ptr.String(jtv) } case "EngineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "IamDatabaseAuthenticationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IamDatabaseAuthenticationEnabled = jtv } case "InstanceCreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceCreateTime = ptr.String(jtv) } case "Iops": 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.Iops = int32(i64) } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "LicenseModel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LicenseModel = ptr.String(jtv) } case "MasterUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUsername = ptr.String(jtv) } case "OptionGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OptionGroupName = ptr.String(jtv) } case "PercentProgress": 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.PercentProgress = int32(i64) } case "Port": 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.Port = int32(i64) } case "ProcessorFeatures": if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(&sv.ProcessorFeatures, value); err != nil { return err } case "SnapshotCreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotCreateTime = ptr.String(jtv) } case "SnapshotType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotType = ptr.String(jtv) } case "SourceDbSnapshotIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceDbSnapshotIdentifier = ptr.String(jtv) } case "SourceRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceRegion = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "StorageType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StorageType = ptr.String(jtv) } case "TdeCredentialArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TdeCredentialArn = ptr.String(jtv) } case "Timezone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Timezone = 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_deserializeDocumentAwsRdsDbStatusInfo(v **types.AwsRdsDbStatusInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbStatusInfo if *v == nil { sv = &types.AwsRdsDbStatusInfo{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Normal": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Normal = jtv } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "StatusType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StatusType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbStatusInfos(v *[]types.AwsRdsDbStatusInfo, 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.AwsRdsDbStatusInfo if *v == nil { cv = []types.AwsRdsDbStatusInfo{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbStatusInfo destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbStatusInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroup(v **types.AwsRdsDbSubnetGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbSubnetGroup if *v == nil { sv = &types.AwsRdsDbSubnetGroup{} } else { sv = *v } for key, value := range shape { switch key { case "DbSubnetGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSubnetGroupArn = ptr.String(jtv) } case "DbSubnetGroupDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSubnetGroupDescription = ptr.String(jtv) } case "DbSubnetGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DbSubnetGroupName = ptr.String(jtv) } case "SubnetGroupStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubnetGroupStatus = ptr.String(jtv) } case "Subnets": if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnets(&sv.Subnets, value); err != nil { return err } 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_deserializeDocumentAwsRdsDbSubnetGroupSubnet(v **types.AwsRdsDbSubnetGroupSubnet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbSubnetGroupSubnet if *v == nil { sv = &types.AwsRdsDbSubnetGroupSubnet{} } else { sv = *v } for key, value := range shape { switch key { case "SubnetAvailabilityZone": if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnetAvailabilityZone(&sv.SubnetAvailabilityZone, value); err != nil { return err } case "SubnetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubnetIdentifier = ptr.String(jtv) } case "SubnetStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubnetStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnetAvailabilityZone(v **types.AwsRdsDbSubnetGroupSubnetAvailabilityZone, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsDbSubnetGroupSubnetAvailabilityZone if *v == nil { sv = &types.AwsRdsDbSubnetGroupSubnetAvailabilityZone{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnets(v *[]types.AwsRdsDbSubnetGroupSubnet, 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.AwsRdsDbSubnetGroupSubnet if *v == nil { cv = []types.AwsRdsDbSubnetGroupSubnet{} } else { cv = *v } for _, value := range shape { var col types.AwsRdsDbSubnetGroupSubnet destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnet(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRdsEventSubscriptionDetails(v **types.AwsRdsEventSubscriptionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsEventSubscriptionDetails if *v == nil { sv = &types.AwsRdsEventSubscriptionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomerAwsId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustomerAwsId = ptr.String(jtv) } case "CustSubscriptionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustSubscriptionId = ptr.String(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "EventCategoriesList": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.EventCategoriesList, value); err != nil { return err } case "EventSubscriptionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EventSubscriptionArn = ptr.String(jtv) } case "SnsTopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnsTopicArn = ptr.String(jtv) } case "SourceIdsList": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SourceIdsList, value); err != nil { return err } case "SourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceType = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "SubscriptionCreationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubscriptionCreationTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRdsPendingCloudWatchLogsExports(v **types.AwsRdsPendingCloudWatchLogsExports, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRdsPendingCloudWatchLogsExports if *v == nil { sv = &types.AwsRdsPendingCloudWatchLogsExports{} } else { sv = *v } for key, value := range shape { switch key { case "LogTypesToDisable": if err := awsRestjson1_deserializeDocumentStringList(&sv.LogTypesToDisable, value); err != nil { return err } case "LogTypesToEnable": if err := awsRestjson1_deserializeDocumentStringList(&sv.LogTypesToEnable, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNode(v **types.AwsRedshiftClusterClusterNode, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterClusterNode if *v == nil { sv = &types.AwsRedshiftClusterClusterNode{} } else { sv = *v } for key, value := range shape { switch key { case "NodeRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NodeRole = ptr.String(jtv) } case "PrivateIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PrivateIpAddress = ptr.String(jtv) } case "PublicIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PublicIpAddress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNodes(v *[]types.AwsRedshiftClusterClusterNode, 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.AwsRedshiftClusterClusterNode if *v == nil { cv = []types.AwsRedshiftClusterClusterNode{} } else { cv = *v } for _, value := range shape { var col types.AwsRedshiftClusterClusterNode destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNode(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroup(v **types.AwsRedshiftClusterClusterParameterGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterClusterParameterGroup if *v == nil { sv = &types.AwsRedshiftClusterClusterParameterGroup{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterParameterStatusList": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatusList(&sv.ClusterParameterStatusList, value); err != nil { return err } case "ParameterApplyStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParameterApplyStatus = ptr.String(jtv) } case "ParameterGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParameterGroupName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroups(v *[]types.AwsRedshiftClusterClusterParameterGroup, 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.AwsRedshiftClusterClusterParameterGroup if *v == nil { cv = []types.AwsRedshiftClusterClusterParameterGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsRedshiftClusterClusterParameterGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatus(v **types.AwsRedshiftClusterClusterParameterStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterClusterParameterStatus if *v == nil { sv = &types.AwsRedshiftClusterClusterParameterStatus{} } else { sv = *v } for key, value := range shape { switch key { case "ParameterApplyErrorDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParameterApplyErrorDescription = ptr.String(jtv) } case "ParameterApplyStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParameterApplyStatus = ptr.String(jtv) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatusList(v *[]types.AwsRedshiftClusterClusterParameterStatus, 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.AwsRedshiftClusterClusterParameterStatus if *v == nil { cv = []types.AwsRedshiftClusterClusterParameterStatus{} } else { cv = *v } for _, value := range shape { var col types.AwsRedshiftClusterClusterParameterStatus destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroup(v **types.AwsRedshiftClusterClusterSecurityGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterClusterSecurityGroup if *v == nil { sv = &types.AwsRedshiftClusterClusterSecurityGroup{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterSecurityGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterSecurityGroupName = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroups(v *[]types.AwsRedshiftClusterClusterSecurityGroup, 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.AwsRedshiftClusterClusterSecurityGroup if *v == nil { cv = []types.AwsRedshiftClusterClusterSecurityGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsRedshiftClusterClusterSecurityGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSnapshotCopyStatus(v **types.AwsRedshiftClusterClusterSnapshotCopyStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterClusterSnapshotCopyStatus if *v == nil { sv = &types.AwsRedshiftClusterClusterSnapshotCopyStatus{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationRegion = ptr.String(jtv) } case "ManualSnapshotRetentionPeriod": 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.ManualSnapshotRetentionPeriod = int32(i64) } case "RetentionPeriod": 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.RetentionPeriod = int32(i64) } case "SnapshotCopyGrantName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotCopyGrantName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindow(v **types.AwsRedshiftClusterDeferredMaintenanceWindow, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterDeferredMaintenanceWindow if *v == nil { sv = &types.AwsRedshiftClusterDeferredMaintenanceWindow{} } else { sv = *v } for key, value := range shape { switch key { case "DeferMaintenanceEndTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeferMaintenanceEndTime = ptr.String(jtv) } case "DeferMaintenanceIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeferMaintenanceIdentifier = ptr.String(jtv) } case "DeferMaintenanceStartTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeferMaintenanceStartTime = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindows(v *[]types.AwsRedshiftClusterDeferredMaintenanceWindow, 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.AwsRedshiftClusterDeferredMaintenanceWindow if *v == nil { cv = []types.AwsRedshiftClusterDeferredMaintenanceWindow{} } else { cv = *v } for _, value := range shape { var col types.AwsRedshiftClusterDeferredMaintenanceWindow destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindow(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterDetails(v **types.AwsRedshiftClusterDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterDetails if *v == nil { sv = &types.AwsRedshiftClusterDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AllowVersionUpgrade": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AllowVersionUpgrade = jtv } case "AutomatedSnapshotRetentionPeriod": 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.AutomatedSnapshotRetentionPeriod = int32(i64) } case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "ClusterAvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterAvailabilityStatus = ptr.String(jtv) } case "ClusterCreateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterCreateTime = ptr.String(jtv) } case "ClusterIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterIdentifier = ptr.String(jtv) } case "ClusterNodes": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNodes(&sv.ClusterNodes, value); err != nil { return err } case "ClusterParameterGroups": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroups(&sv.ClusterParameterGroups, value); err != nil { return err } case "ClusterPublicKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterPublicKey = ptr.String(jtv) } case "ClusterRevisionNumber": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterRevisionNumber = ptr.String(jtv) } case "ClusterSecurityGroups": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroups(&sv.ClusterSecurityGroups, value); err != nil { return err } case "ClusterSnapshotCopyStatus": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSnapshotCopyStatus(&sv.ClusterSnapshotCopyStatus, value); err != nil { return err } case "ClusterStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterStatus = ptr.String(jtv) } case "ClusterSubnetGroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterSubnetGroupName = ptr.String(jtv) } case "ClusterVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterVersion = ptr.String(jtv) } case "DBName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DBName = ptr.String(jtv) } case "DeferredMaintenanceWindows": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindows(&sv.DeferredMaintenanceWindows, value); err != nil { return err } case "ElasticIpStatus": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterElasticIpStatus(&sv.ElasticIpStatus, value); err != nil { return err } case "ElasticResizeNumberOfNodeOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ElasticResizeNumberOfNodeOptions = ptr.String(jtv) } case "Encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Encrypted = jtv } case "Endpoint": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterEndpoint(&sv.Endpoint, value); err != nil { return err } case "EnhancedVpcRouting": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnhancedVpcRouting = jtv } case "ExpectedNextSnapshotScheduleTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ExpectedNextSnapshotScheduleTime = ptr.String(jtv) } case "ExpectedNextSnapshotScheduleTimeStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ExpectedNextSnapshotScheduleTimeStatus = ptr.String(jtv) } case "HsmStatus": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterHsmStatus(&sv.HsmStatus, value); err != nil { return err } case "IamRoles": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRoles(&sv.IamRoles, value); err != nil { return err } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "LoggingStatus": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterLoggingStatus(&sv.LoggingStatus, value); err != nil { return err } case "MaintenanceTrackName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MaintenanceTrackName = ptr.String(jtv) } case "ManualSnapshotRetentionPeriod": 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.ManualSnapshotRetentionPeriod = int32(i64) } case "MasterUsername": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUsername = ptr.String(jtv) } case "NextMaintenanceWindowStartTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NextMaintenanceWindowStartTime = ptr.String(jtv) } case "NodeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NodeType = ptr.String(jtv) } case "NumberOfNodes": 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.NumberOfNodes = int32(i64) } case "PendingActions": if err := awsRestjson1_deserializeDocumentStringList(&sv.PendingActions, value); err != nil { return err } case "PendingModifiedValues": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterPendingModifiedValues(&sv.PendingModifiedValues, value); err != nil { return err } case "PreferredMaintenanceWindow": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PreferredMaintenanceWindow = ptr.String(jtv) } case "PubliclyAccessible": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PubliclyAccessible = jtv } case "ResizeInfo": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterResizeInfo(&sv.ResizeInfo, value); err != nil { return err } case "RestoreStatus": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterRestoreStatus(&sv.RestoreStatus, value); err != nil { return err } case "SnapshotScheduleIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotScheduleIdentifier = ptr.String(jtv) } case "SnapshotScheduleState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotScheduleState = 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) } case "VpcSecurityGroups": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroups(&sv.VpcSecurityGroups, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterElasticIpStatus(v **types.AwsRedshiftClusterElasticIpStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterElasticIpStatus if *v == nil { sv = &types.AwsRedshiftClusterElasticIpStatus{} } else { sv = *v } for key, value := range shape { switch key { case "ElasticIp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ElasticIp = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterEndpoint(v **types.AwsRedshiftClusterEndpoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterEndpoint if *v == nil { sv = &types.AwsRedshiftClusterEndpoint{} } else { sv = *v } for key, value := range shape { switch key { case "Address": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Address = ptr.String(jtv) } case "Port": 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.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterHsmStatus(v **types.AwsRedshiftClusterHsmStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterHsmStatus if *v == nil { sv = &types.AwsRedshiftClusterHsmStatus{} } else { sv = *v } for key, value := range shape { switch key { case "HsmClientCertificateIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HsmClientCertificateIdentifier = ptr.String(jtv) } case "HsmConfigurationIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HsmConfigurationIdentifier = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRole(v **types.AwsRedshiftClusterIamRole, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterIamRole if *v == nil { sv = &types.AwsRedshiftClusterIamRole{} } else { sv = *v } for key, value := range shape { switch key { case "ApplyStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApplyStatus = ptr.String(jtv) } case "IamRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IamRoleArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRoles(v *[]types.AwsRedshiftClusterIamRole, 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.AwsRedshiftClusterIamRole if *v == nil { cv = []types.AwsRedshiftClusterIamRole{} } else { cv = *v } for _, value := range shape { var col types.AwsRedshiftClusterIamRole destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRole(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterLoggingStatus(v **types.AwsRedshiftClusterLoggingStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterLoggingStatus if *v == nil { sv = &types.AwsRedshiftClusterLoggingStatus{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.BucketName = ptr.String(jtv) } case "LastFailureMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastFailureMessage = ptr.String(jtv) } case "LastFailureTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastFailureTime = ptr.String(jtv) } case "LastSuccessfulDeliveryTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastSuccessfulDeliveryTime = ptr.String(jtv) } case "LoggingEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.LoggingEnabled = jtv } case "S3KeyPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3KeyPrefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterPendingModifiedValues(v **types.AwsRedshiftClusterPendingModifiedValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterPendingModifiedValues if *v == nil { sv = &types.AwsRedshiftClusterPendingModifiedValues{} } else { sv = *v } for key, value := range shape { switch key { case "AutomatedSnapshotRetentionPeriod": 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.AutomatedSnapshotRetentionPeriod = int32(i64) } case "ClusterIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterIdentifier = ptr.String(jtv) } case "ClusterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterType = ptr.String(jtv) } case "ClusterVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ClusterVersion = ptr.String(jtv) } case "EncryptionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EncryptionType = ptr.String(jtv) } case "EnhancedVpcRouting": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnhancedVpcRouting = jtv } case "MaintenanceTrackName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MaintenanceTrackName = ptr.String(jtv) } case "MasterUserPassword": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterUserPassword = ptr.String(jtv) } case "NodeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NodeType = ptr.String(jtv) } case "NumberOfNodes": 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.NumberOfNodes = int32(i64) } case "PubliclyAccessible": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PubliclyAccessible = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterResizeInfo(v **types.AwsRedshiftClusterResizeInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterResizeInfo if *v == nil { sv = &types.AwsRedshiftClusterResizeInfo{} } else { sv = *v } for key, value := range shape { switch key { case "AllowCancelResize": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AllowCancelResize = jtv } case "ResizeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResizeType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterRestoreStatus(v **types.AwsRedshiftClusterRestoreStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterRestoreStatus if *v == nil { sv = &types.AwsRedshiftClusterRestoreStatus{} } else { sv = *v } for key, value := range shape { switch key { case "CurrentRestoreRateInMegaBytesPerSecond": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CurrentRestoreRateInMegaBytesPerSecond = 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.CurrentRestoreRateInMegaBytesPerSecond = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "ElapsedTimeInSeconds": 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.ElapsedTimeInSeconds = i64 } case "EstimatedTimeToCompletionInSeconds": 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.EstimatedTimeToCompletionInSeconds = i64 } case "ProgressInMegaBytes": 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.ProgressInMegaBytes = i64 } case "SnapshotSizeInMegaBytes": 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.SnapshotSizeInMegaBytes = i64 } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroup(v **types.AwsRedshiftClusterVpcSecurityGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsRedshiftClusterVpcSecurityGroup if *v == nil { sv = &types.AwsRedshiftClusterVpcSecurityGroup{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "VpcSecurityGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpcSecurityGroupId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroups(v *[]types.AwsRedshiftClusterVpcSecurityGroup, 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.AwsRedshiftClusterVpcSecurityGroup if *v == nil { cv = []types.AwsRedshiftClusterVpcSecurityGroup{} } else { cv = *v } for _, value := range shape { var col types.AwsRedshiftClusterVpcSecurityGroup destAddr := &col if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3AccountPublicAccessBlockDetails(v **types.AwsS3AccountPublicAccessBlockDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3AccountPublicAccessBlockDetails if *v == nil { sv = &types.AwsS3AccountPublicAccessBlockDetails{} } else { sv = *v } for key, value := range shape { switch key { case "BlockPublicAcls": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.BlockPublicAcls = jtv } case "BlockPublicPolicy": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.BlockPublicPolicy = jtv } case "IgnorePublicAcls": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IgnorePublicAcls = jtv } case "RestrictPublicBuckets": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RestrictPublicBuckets = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationDetails(v **types.AwsS3BucketBucketLifecycleConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Rules": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesList(&sv.Rules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DaysAfterInitiation": 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.DaysAfterInitiation = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AbortIncompleteMultipartUpload": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesAbortIncompleteMultipartUploadDetails(&sv.AbortIncompleteMultipartUpload, value); err != nil { return err } case "ExpirationDate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ExpirationDate = ptr.String(jtv) } case "ExpirationInDays": 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.ExpirationInDays = int32(i64) } case "ExpiredObjectDeleteMarker": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ExpiredObjectDeleteMarker = jtv } case "Filter": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterDetails(&sv.Filter, 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 "NoncurrentVersionExpirationInDays": 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.NoncurrentVersionExpirationInDays = int32(i64) } case "NoncurrentVersionTransitions": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsList(&sv.NoncurrentVersionTransitions, value); err != nil { return err } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "Transitions": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesTransitionsList(&sv.Transitions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesFilterDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesFilterDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesFilterDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Predicate": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateDetails(&sv.Predicate, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Operands": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsList(&sv.Operands, value); err != nil { return err } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "Tag": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateTagDetails(&sv.Tag, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "Tag": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsTagDetails(&sv.Tag, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsList(v *[]types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails, 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.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails if *v == nil { cv = []types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsTagDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsTagDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsTagDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateOperandsTagDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected 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_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateTagDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateTagDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateTagDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesFilterPredicateTagDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected 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_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesList(v *[]types.AwsS3BucketBucketLifecycleConfigurationRulesDetails, 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.AwsS3BucketBucketLifecycleConfigurationRulesDetails if *v == nil { cv = []types.AwsS3BucketBucketLifecycleConfigurationRulesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketBucketLifecycleConfigurationRulesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Days": 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.Days = int32(i64) } case "StorageClass": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StorageClass = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsList(v *[]types.AwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails, 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.AwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails if *v == nil { cv = []types.AwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesNoncurrentVersionTransitionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails(v **types.AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails if *v == nil { sv = &types.AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Date": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Date = ptr.String(jtv) } case "Days": 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.Days = int32(i64) } case "StorageClass": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StorageClass = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesTransitionsList(v *[]types.AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails, 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.AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails if *v == nil { cv = []types.AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationRulesTransitionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketBucketVersioningConfiguration(v **types.AwsS3BucketBucketVersioningConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketBucketVersioningConfiguration if *v == nil { sv = &types.AwsS3BucketBucketVersioningConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "IsMfaDeleteEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsMfaDeleteEnabled = jtv } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketDetails(v **types.AwsS3BucketDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketDetails if *v == nil { sv = &types.AwsS3BucketDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AccessControlList": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccessControlList = ptr.String(jtv) } case "BucketLifecycleConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketLifecycleConfigurationDetails(&sv.BucketLifecycleConfiguration, value); err != nil { return err } case "BucketLoggingConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3BucketLoggingConfiguration(&sv.BucketLoggingConfiguration, value); err != nil { return err } case "BucketNotificationConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfiguration(&sv.BucketNotificationConfiguration, value); err != nil { return err } case "BucketVersioningConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3BucketBucketVersioningConfiguration(&sv.BucketVersioningConfiguration, value); err != nil { return err } case "BucketWebsiteConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfiguration(&sv.BucketWebsiteConfiguration, value); err != nil { return err } case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedAt = ptr.String(jtv) } case "ObjectLockConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3BucketObjectLockConfiguration(&sv.ObjectLockConfiguration, value); err != nil { return err } case "OwnerAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerAccountId = ptr.String(jtv) } case "OwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerId = ptr.String(jtv) } case "OwnerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OwnerName = ptr.String(jtv) } case "PublicAccessBlockConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3AccountPublicAccessBlockDetails(&sv.PublicAccessBlockConfiguration, value); err != nil { return err } case "ServerSideEncryptionConfiguration": if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketLoggingConfiguration(v **types.AwsS3BucketLoggingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketLoggingConfiguration if *v == nil { sv = &types.AwsS3BucketLoggingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationBucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationBucketName = ptr.String(jtv) } case "LogFilePrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LogFilePrefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfiguration(v **types.AwsS3BucketNotificationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketNotificationConfiguration if *v == nil { sv = &types.AwsS3BucketNotificationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Configurations": if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationDetails(&sv.Configurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationDetail(v **types.AwsS3BucketNotificationConfigurationDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketNotificationConfigurationDetail if *v == nil { sv = &types.AwsS3BucketNotificationConfigurationDetail{} } else { sv = *v } for key, value := range shape { switch key { case "Destination": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Destination = ptr.String(jtv) } case "Events": if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationEvents(&sv.Events, value); err != nil { return err } case "Filter": if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationFilter(&sv.Filter, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationDetails(v *[]types.AwsS3BucketNotificationConfigurationDetail, 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.AwsS3BucketNotificationConfigurationDetail if *v == nil { cv = []types.AwsS3BucketNotificationConfigurationDetail{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketNotificationConfigurationDetail destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationEvents(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_deserializeDocumentAwsS3BucketNotificationConfigurationFilter(v **types.AwsS3BucketNotificationConfigurationFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketNotificationConfigurationFilter if *v == nil { sv = &types.AwsS3BucketNotificationConfigurationFilter{} } else { sv = *v } for key, value := range shape { switch key { case "S3KeyFilter": if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationS3KeyFilter(&sv.S3KeyFilter, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationS3KeyFilter(v **types.AwsS3BucketNotificationConfigurationS3KeyFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketNotificationConfigurationS3KeyFilter if *v == nil { sv = &types.AwsS3BucketNotificationConfigurationS3KeyFilter{} } else { sv = *v } for key, value := range shape { switch key { case "FilterRules": if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationS3KeyFilterRules(&sv.FilterRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationS3KeyFilterRule(v **types.AwsS3BucketNotificationConfigurationS3KeyFilterRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketNotificationConfigurationS3KeyFilterRule if *v == nil { sv = &types.AwsS3BucketNotificationConfigurationS3KeyFilterRule{} } 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 AwsS3BucketNotificationConfigurationS3KeyFilterRuleName to be of type string, got %T instead", value) } sv.Name = types.AwsS3BucketNotificationConfigurationS3KeyFilterRuleName(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_deserializeDocumentAwsS3BucketNotificationConfigurationS3KeyFilterRules(v *[]types.AwsS3BucketNotificationConfigurationS3KeyFilterRule, 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.AwsS3BucketNotificationConfigurationS3KeyFilterRule if *v == nil { cv = []types.AwsS3BucketNotificationConfigurationS3KeyFilterRule{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketNotificationConfigurationS3KeyFilterRule destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketNotificationConfigurationS3KeyFilterRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketObjectLockConfiguration(v **types.AwsS3BucketObjectLockConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketObjectLockConfiguration if *v == nil { sv = &types.AwsS3BucketObjectLockConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ObjectLockEnabled": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ObjectLockEnabled = ptr.String(jtv) } case "Rule": if err := awsRestjson1_deserializeDocumentAwsS3BucketObjectLockConfigurationRuleDetails(&sv.Rule, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketObjectLockConfigurationRuleDefaultRetentionDetails(v **types.AwsS3BucketObjectLockConfigurationRuleDefaultRetentionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketObjectLockConfigurationRuleDefaultRetentionDetails if *v == nil { sv = &types.AwsS3BucketObjectLockConfigurationRuleDefaultRetentionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Days": 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.Days = int32(i64) } case "Mode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Mode = ptr.String(jtv) } case "Years": 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.Years = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketObjectLockConfigurationRuleDetails(v **types.AwsS3BucketObjectLockConfigurationRuleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketObjectLockConfigurationRuleDetails if *v == nil { sv = &types.AwsS3BucketObjectLockConfigurationRuleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultRetention": if err := awsRestjson1_deserializeDocumentAwsS3BucketObjectLockConfigurationRuleDefaultRetentionDetails(&sv.DefaultRetention, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionByDefault(v **types.AwsS3BucketServerSideEncryptionByDefault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketServerSideEncryptionByDefault if *v == nil { sv = &types.AwsS3BucketServerSideEncryptionByDefault{} } else { sv = *v } for key, value := range shape { switch key { case "KMSMasterKeyID": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KMSMasterKeyID = ptr.String(jtv) } case "SSEAlgorithm": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SSEAlgorithm = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionConfiguration(v **types.AwsS3BucketServerSideEncryptionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketServerSideEncryptionConfiguration if *v == nil { sv = &types.AwsS3BucketServerSideEncryptionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Rules": if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRules(&sv.Rules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRule(v **types.AwsS3BucketServerSideEncryptionRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketServerSideEncryptionRule if *v == nil { sv = &types.AwsS3BucketServerSideEncryptionRule{} } else { sv = *v } for key, value := range shape { switch key { case "ApplyServerSideEncryptionByDefault": if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionByDefault(&sv.ApplyServerSideEncryptionByDefault, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRules(v *[]types.AwsS3BucketServerSideEncryptionRule, 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.AwsS3BucketServerSideEncryptionRule if *v == nil { cv = []types.AwsS3BucketServerSideEncryptionRule{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketServerSideEncryptionRule destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfiguration(v **types.AwsS3BucketWebsiteConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketWebsiteConfiguration if *v == nil { sv = &types.AwsS3BucketWebsiteConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorDocument": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorDocument = ptr.String(jtv) } case "IndexDocumentSuffix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.IndexDocumentSuffix = ptr.String(jtv) } case "RedirectAllRequestsTo": if err := awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRedirectTo(&sv.RedirectAllRequestsTo, value); err != nil { return err } case "RoutingRules": if err := awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRules(&sv.RoutingRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRedirectTo(v **types.AwsS3BucketWebsiteConfigurationRedirectTo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketWebsiteConfigurationRedirectTo if *v == nil { sv = &types.AwsS3BucketWebsiteConfigurationRedirectTo{} } else { sv = *v } for key, value := range shape { switch key { case "Hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRule(v **types.AwsS3BucketWebsiteConfigurationRoutingRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketWebsiteConfigurationRoutingRule if *v == nil { sv = &types.AwsS3BucketWebsiteConfigurationRoutingRule{} } else { sv = *v } for key, value := range shape { switch key { case "Condition": if err := awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRuleCondition(&sv.Condition, value); err != nil { return err } case "Redirect": if err := awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRuleRedirect(&sv.Redirect, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRuleCondition(v **types.AwsS3BucketWebsiteConfigurationRoutingRuleCondition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketWebsiteConfigurationRoutingRuleCondition if *v == nil { sv = &types.AwsS3BucketWebsiteConfigurationRoutingRuleCondition{} } else { sv = *v } for key, value := range shape { switch key { case "HttpErrorCodeReturnedEquals": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpErrorCodeReturnedEquals = ptr.String(jtv) } case "KeyPrefixEquals": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyPrefixEquals = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRuleRedirect(v **types.AwsS3BucketWebsiteConfigurationRoutingRuleRedirect, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3BucketWebsiteConfigurationRoutingRuleRedirect if *v == nil { sv = &types.AwsS3BucketWebsiteConfigurationRoutingRuleRedirect{} } else { sv = *v } for key, value := range shape { switch key { case "Hostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Hostname = ptr.String(jtv) } case "HttpRedirectCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpRedirectCode = ptr.String(jtv) } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } case "ReplaceKeyPrefixWith": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ReplaceKeyPrefixWith = ptr.String(jtv) } case "ReplaceKeyWith": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ReplaceKeyWith = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRules(v *[]types.AwsS3BucketWebsiteConfigurationRoutingRule, 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.AwsS3BucketWebsiteConfigurationRoutingRule if *v == nil { cv = []types.AwsS3BucketWebsiteConfigurationRoutingRule{} } else { cv = *v } for _, value := range shape { var col types.AwsS3BucketWebsiteConfigurationRoutingRule destAddr := &col if err := awsRestjson1_deserializeDocumentAwsS3BucketWebsiteConfigurationRoutingRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsS3ObjectDetails(v **types.AwsS3ObjectDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsS3ObjectDetails if *v == nil { sv = &types.AwsS3ObjectDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContentType = ptr.String(jtv) } case "ETag": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ETag = ptr.String(jtv) } case "LastModified": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastModified = ptr.String(jtv) } case "ServerSideEncryption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ServerSideEncryption = ptr.String(jtv) } case "SSEKMSKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SSEKMSKeyId = ptr.String(jtv) } case "VersionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VersionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSageMakerNotebookInstanceDetails(v **types.AwsSageMakerNotebookInstanceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSageMakerNotebookInstanceDetails if *v == nil { sv = &types.AwsSageMakerNotebookInstanceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AcceleratorTypes": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AcceleratorTypes, value); err != nil { return err } case "AdditionalCodeRepositories": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AdditionalCodeRepositories, value); err != nil { return err } case "DefaultCodeRepository": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultCodeRepository = ptr.String(jtv) } case "DirectInternetAccess": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DirectInternetAccess = ptr.String(jtv) } case "FailureReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FailureReason = ptr.String(jtv) } case "InstanceMetadataServiceConfiguration": if err := awsRestjson1_deserializeDocumentAwsSageMakerNotebookInstanceMetadataServiceConfigurationDetails(&sv.InstanceMetadataServiceConfiguration, value); err != nil { return err } case "InstanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "NetworkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } case "NotebookInstanceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NotebookInstanceArn = ptr.String(jtv) } case "NotebookInstanceLifecycleConfigName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NotebookInstanceLifecycleConfigName = ptr.String(jtv) } case "NotebookInstanceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NotebookInstanceName = ptr.String(jtv) } case "NotebookInstanceStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NotebookInstanceStatus = ptr.String(jtv) } case "PlatformIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PlatformIdentifier = ptr.String(jtv) } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "RootAccess": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RootAccess = ptr.String(jtv) } case "SecurityGroups": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroups, value); err != nil { return err } 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 "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) } case "VolumeSizeInGB": 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.VolumeSizeInGB = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSageMakerNotebookInstanceMetadataServiceConfigurationDetails(v **types.AwsSageMakerNotebookInstanceMetadataServiceConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSageMakerNotebookInstanceMetadataServiceConfigurationDetails if *v == nil { sv = &types.AwsSageMakerNotebookInstanceMetadataServiceConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MinimumInstanceMetadataServiceVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MinimumInstanceMetadataServiceVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSecretsManagerSecretDetails(v **types.AwsSecretsManagerSecretDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSecretsManagerSecretDetails if *v == nil { sv = &types.AwsSecretsManagerSecretDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Deleted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Deleted = jtv } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RotationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RotationEnabled = jtv } case "RotationLambdaArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RotationLambdaArn = ptr.String(jtv) } case "RotationOccurredWithinFrequency": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RotationOccurredWithinFrequency = jtv } case "RotationRules": if err := awsRestjson1_deserializeDocumentAwsSecretsManagerSecretRotationRules(&sv.RotationRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSecretsManagerSecretRotationRules(v **types.AwsSecretsManagerSecretRotationRules, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSecretsManagerSecretRotationRules if *v == nil { sv = &types.AwsSecretsManagerSecretRotationRules{} } else { sv = *v } for key, value := range shape { switch key { case "AutomaticallyAfterDays": 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.AutomaticallyAfterDays = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSecurityFinding(v **types.AwsSecurityFinding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSecurityFinding if *v == nil { sv = &types.AwsSecurityFinding{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if err := awsRestjson1_deserializeDocumentAction(&sv.Action, value); err != nil { return err } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "CompanyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CompanyName = ptr.String(jtv) } case "Compliance": if err := awsRestjson1_deserializeDocumentCompliance(&sv.Compliance, value); err != nil { return err } case "Confidence": 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.Confidence = int32(i64) } case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CreatedAt = ptr.String(jtv) } case "Criticality": 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.Criticality = int32(i64) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "FindingProviderFields": if err := awsRestjson1_deserializeDocumentFindingProviderFields(&sv.FindingProviderFields, value); err != nil { return err } case "FirstObservedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirstObservedAt = ptr.String(jtv) } case "GeneratorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GeneratorId = ptr.String(jtv) } 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 "LastObservedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastObservedAt = ptr.String(jtv) } case "Malware": if err := awsRestjson1_deserializeDocumentMalwareList(&sv.Malware, value); err != nil { return err } case "Network": if err := awsRestjson1_deserializeDocumentNetwork(&sv.Network, value); err != nil { return err } case "NetworkPath": if err := awsRestjson1_deserializeDocumentNetworkPathList(&sv.NetworkPath, value); err != nil { return err } case "Note": if err := awsRestjson1_deserializeDocumentNote(&sv.Note, value); err != nil { return err } case "PatchSummary": if err := awsRestjson1_deserializeDocumentPatchSummary(&sv.PatchSummary, value); err != nil { return err } case "Process": if err := awsRestjson1_deserializeDocumentProcessDetails(&sv.Process, value); err != nil { return err } case "ProductArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductArn = ptr.String(jtv) } case "ProductFields": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.ProductFields, value); err != nil { return err } case "ProductName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductName = ptr.String(jtv) } case "RecordState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RecordState to be of type string, got %T instead", value) } sv.RecordState = types.RecordState(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 "RelatedFindings": if err := awsRestjson1_deserializeDocumentRelatedFindingList(&sv.RelatedFindings, 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 "Sample": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Sample = jtv } case "SchemaVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SchemaVersion = ptr.String(jtv) } case "Severity": if err := awsRestjson1_deserializeDocumentSeverity(&sv.Severity, value); err != nil { return err } 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 "ThreatIntelIndicators": if err := awsRestjson1_deserializeDocumentThreatIntelIndicatorList(&sv.ThreatIntelIndicators, value); err != nil { return err } case "Threats": if err := awsRestjson1_deserializeDocumentThreatList(&sv.Threats, 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 "Types": if err := awsRestjson1_deserializeDocumentTypeList(&sv.Types, value); err != nil { return err } case "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedAt = ptr.String(jtv) } case "UserDefinedFields": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.UserDefinedFields, value); err != nil { return err } case "VerificationState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VerificationState to be of type string, got %T instead", value) } sv.VerificationState = types.VerificationState(jtv) } case "Vulnerabilities": if err := awsRestjson1_deserializeDocumentVulnerabilityList(&sv.Vulnerabilities, value); err != nil { return err } case "Workflow": if err := awsRestjson1_deserializeDocumentWorkflow(&sv.Workflow, value); err != nil { return err } case "WorkflowState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowState to be of type string, got %T instead", value) } sv.WorkflowState = types.WorkflowState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSecurityFindingFilters(v **types.AwsSecurityFindingFilters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSecurityFindingFilters if *v == nil { sv = &types.AwsSecurityFindingFilters{} } else { sv = *v } for key, value := range shape { switch key { case "AwsAccountId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.AwsAccountId, value); err != nil { return err } case "CompanyName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.CompanyName, value); err != nil { return err } case "ComplianceAssociatedStandardsId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceAssociatedStandardsId, value); err != nil { return err } case "ComplianceSecurityControlId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceSecurityControlId, value); err != nil { return err } case "ComplianceStatus": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceStatus, value); err != nil { return err } case "Confidence": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Confidence, value); err != nil { return err } case "CreatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.CreatedAt, value); err != nil { return err } case "Criticality": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Criticality, value); err != nil { return err } case "Description": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Description, value); err != nil { return err } case "FindingProviderFieldsConfidence": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.FindingProviderFieldsConfidence, value); err != nil { return err } case "FindingProviderFieldsCriticality": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.FindingProviderFieldsCriticality, value); err != nil { return err } case "FindingProviderFieldsRelatedFindingsId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingProviderFieldsRelatedFindingsId, value); err != nil { return err } case "FindingProviderFieldsRelatedFindingsProductArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingProviderFieldsRelatedFindingsProductArn, value); err != nil { return err } case "FindingProviderFieldsSeverityLabel": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingProviderFieldsSeverityLabel, value); err != nil { return err } case "FindingProviderFieldsSeverityOriginal": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingProviderFieldsSeverityOriginal, value); err != nil { return err } case "FindingProviderFieldsTypes": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.FindingProviderFieldsTypes, value); err != nil { return err } case "FirstObservedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.FirstObservedAt, value); err != nil { return err } case "GeneratorId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.GeneratorId, value); err != nil { return err } case "Id": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Id, value); err != nil { return err } case "Keyword": if err := awsRestjson1_deserializeDocumentKeywordFilterList(&sv.Keyword, value); err != nil { return err } case "LastObservedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.LastObservedAt, value); err != nil { return err } case "MalwareName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwareName, value); err != nil { return err } case "MalwarePath": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwarePath, value); err != nil { return err } case "MalwareState": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwareState, value); err != nil { return err } case "MalwareType": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwareType, value); err != nil { return err } case "NetworkDestinationDomain": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkDestinationDomain, value); err != nil { return err } case "NetworkDestinationIpV4": if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkDestinationIpV4, value); err != nil { return err } case "NetworkDestinationIpV6": if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkDestinationIpV6, value); err != nil { return err } case "NetworkDestinationPort": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.NetworkDestinationPort, value); err != nil { return err } case "NetworkDirection": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkDirection, value); err != nil { return err } case "NetworkProtocol": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkProtocol, value); err != nil { return err } case "NetworkSourceDomain": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkSourceDomain, value); err != nil { return err } case "NetworkSourceIpV4": if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkSourceIpV4, value); err != nil { return err } case "NetworkSourceIpV6": if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkSourceIpV6, value); err != nil { return err } case "NetworkSourceMac": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkSourceMac, value); err != nil { return err } case "NetworkSourcePort": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.NetworkSourcePort, value); err != nil { return err } case "NoteText": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteText, value); err != nil { return err } case "NoteUpdatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.NoteUpdatedAt, value); err != nil { return err } case "NoteUpdatedBy": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteUpdatedBy, value); err != nil { return err } case "ProcessLaunchedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ProcessLaunchedAt, value); err != nil { return err } case "ProcessName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProcessName, value); err != nil { return err } case "ProcessParentPid": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.ProcessParentPid, value); err != nil { return err } case "ProcessPath": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProcessPath, value); err != nil { return err } case "ProcessPid": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.ProcessPid, value); err != nil { return err } case "ProcessTerminatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ProcessTerminatedAt, value); err != nil { return err } case "ProductArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductArn, value); err != nil { return err } case "ProductFields": if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ProductFields, value); err != nil { return err } case "ProductName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductName, value); err != nil { return err } case "RecommendationText": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RecommendationText, value); err != nil { return err } case "RecordState": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RecordState, value); err != nil { return err } case "Region": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Region, value); err != nil { return err } case "RelatedFindingsId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsId, value); err != nil { return err } case "RelatedFindingsProductArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsProductArn, value); err != nil { return err } case "ResourceAwsEc2InstanceIamInstanceProfileArn": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceIamInstanceProfileArn, value); err != nil { return err } case "ResourceAwsEc2InstanceImageId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceImageId, value); err != nil { return err } case "ResourceAwsEc2InstanceIpV4Addresses": if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.ResourceAwsEc2InstanceIpV4Addresses, value); err != nil { return err } case "ResourceAwsEc2InstanceIpV6Addresses": if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.ResourceAwsEc2InstanceIpV6Addresses, value); err != nil { return err } case "ResourceAwsEc2InstanceKeyName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceKeyName, value); err != nil { return err } case "ResourceAwsEc2InstanceLaunchedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ResourceAwsEc2InstanceLaunchedAt, value); err != nil { return err } case "ResourceAwsEc2InstanceSubnetId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceSubnetId, value); err != nil { return err } case "ResourceAwsEc2InstanceType": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceType, value); err != nil { return err } case "ResourceAwsEc2InstanceVpcId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceVpcId, value); err != nil { return err } case "ResourceAwsIamAccessKeyCreatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ResourceAwsIamAccessKeyCreatedAt, value); err != nil { return err } case "ResourceAwsIamAccessKeyPrincipalName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsIamAccessKeyPrincipalName, value); err != nil { return err } case "ResourceAwsIamAccessKeyStatus": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsIamAccessKeyStatus, value); err != nil { return err } case "ResourceAwsIamAccessKeyUserName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsIamAccessKeyUserName, value); err != nil { return err } case "ResourceAwsIamUserUserName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsIamUserUserName, value); err != nil { return err } case "ResourceAwsS3BucketOwnerId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsS3BucketOwnerId, value); err != nil { return err } case "ResourceAwsS3BucketOwnerName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsS3BucketOwnerName, value); err != nil { return err } case "ResourceContainerImageId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceContainerImageId, value); err != nil { return err } case "ResourceContainerImageName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceContainerImageName, value); err != nil { return err } case "ResourceContainerLaunchedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ResourceContainerLaunchedAt, value); err != nil { return err } case "ResourceContainerName": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceContainerName, value); err != nil { return err } case "ResourceDetailsOther": if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ResourceDetailsOther, value); err != nil { return err } case "ResourceId": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceId, value); err != nil { return err } case "ResourcePartition": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourcePartition, value); err != nil { return err } case "ResourceRegion": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceRegion, 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 "Sample": if err := awsRestjson1_deserializeDocumentBooleanFilterList(&sv.Sample, value); err != nil { return err } case "SeverityLabel": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SeverityLabel, value); err != nil { return err } case "SeverityNormalized": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.SeverityNormalized, value); err != nil { return err } case "SeverityProduct": if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.SeverityProduct, value); err != nil { return err } case "SourceUrl": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SourceUrl, value); err != nil { return err } case "ThreatIntelIndicatorCategory": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorCategory, value); err != nil { return err } case "ThreatIntelIndicatorLastObservedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ThreatIntelIndicatorLastObservedAt, value); err != nil { return err } case "ThreatIntelIndicatorSource": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorSource, value); err != nil { return err } case "ThreatIntelIndicatorSourceUrl": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorSourceUrl, value); err != nil { return err } case "ThreatIntelIndicatorType": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorType, value); err != nil { return err } case "ThreatIntelIndicatorValue": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorValue, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Title, value); err != nil { return err } case "Type": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Type, value); err != nil { return err } case "UpdatedAt": if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.UpdatedAt, value); err != nil { return err } case "UserDefinedFields": if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.UserDefinedFields, value); err != nil { return err } case "VerificationState": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VerificationState, value); err != nil { return err } case "WorkflowState": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.WorkflowState, value); err != nil { return err } case "WorkflowStatus": if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.WorkflowStatus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifier(v **types.AwsSecurityFindingIdentifier, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSecurityFindingIdentifier if *v == nil { sv = &types.AwsSecurityFindingIdentifier{} } else { sv = *v } for key, value := range shape { switch key { 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 "ProductArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifierList(v *[]types.AwsSecurityFindingIdentifier, 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.AwsSecurityFindingIdentifier if *v == nil { cv = []types.AwsSecurityFindingIdentifier{} } else { cv = *v } for _, value := range shape { var col types.AwsSecurityFindingIdentifier destAddr := &col if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifier(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsSecurityFindingList(v *[]types.AwsSecurityFinding, 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.AwsSecurityFinding if *v == nil { cv = []types.AwsSecurityFinding{} } else { cv = *v } for _, value := range shape { var col types.AwsSecurityFinding destAddr := &col if err := awsRestjson1_deserializeDocumentAwsSecurityFinding(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsSnsTopicDetails(v **types.AwsSnsTopicDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSnsTopicDetails if *v == nil { sv = &types.AwsSnsTopicDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ApplicationSuccessFeedbackRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ApplicationSuccessFeedbackRoleArn = ptr.String(jtv) } case "FirehoseFailureFeedbackRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirehoseFailureFeedbackRoleArn = ptr.String(jtv) } case "FirehoseSuccessFeedbackRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FirehoseSuccessFeedbackRoleArn = ptr.String(jtv) } case "HttpFailureFeedbackRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpFailureFeedbackRoleArn = ptr.String(jtv) } case "HttpSuccessFeedbackRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.HttpSuccessFeedbackRoleArn = ptr.String(jtv) } case "KmsMasterKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsMasterKeyId = ptr.String(jtv) } case "Owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "SqsFailureFeedbackRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SqsFailureFeedbackRoleArn = ptr.String(jtv) } case "SqsSuccessFeedbackRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SqsSuccessFeedbackRoleArn = ptr.String(jtv) } case "Subscription": if err := awsRestjson1_deserializeDocumentAwsSnsTopicSubscriptionList(&sv.Subscription, value); err != nil { return err } case "TopicName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TopicName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSnsTopicSubscription(v **types.AwsSnsTopicSubscription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSnsTopicSubscription if *v == nil { sv = &types.AwsSnsTopicSubscription{} } else { sv = *v } for key, value := range shape { switch key { case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Endpoint = ptr.String(jtv) } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSnsTopicSubscriptionList(v *[]types.AwsSnsTopicSubscription, 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.AwsSnsTopicSubscription if *v == nil { cv = []types.AwsSnsTopicSubscription{} } else { cv = *v } for _, value := range shape { var col types.AwsSnsTopicSubscription destAddr := &col if err := awsRestjson1_deserializeDocumentAwsSnsTopicSubscription(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsSqsQueueDetails(v **types.AwsSqsQueueDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSqsQueueDetails if *v == nil { sv = &types.AwsSqsQueueDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DeadLetterTargetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeadLetterTargetArn = ptr.String(jtv) } case "KmsDataKeyReusePeriodSeconds": 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.KmsDataKeyReusePeriodSeconds = int32(i64) } case "KmsMasterKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsMasterKeyId = ptr.String(jtv) } case "QueueName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.QueueName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSsmComplianceSummary(v **types.AwsSsmComplianceSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSsmComplianceSummary if *v == nil { sv = &types.AwsSsmComplianceSummary{} } else { sv = *v } for key, value := range shape { switch key { case "ComplianceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ComplianceType = ptr.String(jtv) } case "CompliantCriticalCount": 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.CompliantCriticalCount = int32(i64) } case "CompliantHighCount": 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.CompliantHighCount = int32(i64) } case "CompliantInformationalCount": 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.CompliantInformationalCount = int32(i64) } case "CompliantLowCount": 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.CompliantLowCount = int32(i64) } case "CompliantMediumCount": 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.CompliantMediumCount = int32(i64) } case "CompliantUnspecifiedCount": 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.CompliantUnspecifiedCount = int32(i64) } case "ExecutionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ExecutionType = ptr.String(jtv) } case "NonCompliantCriticalCount": 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.NonCompliantCriticalCount = int32(i64) } case "NonCompliantHighCount": 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.NonCompliantHighCount = int32(i64) } case "NonCompliantInformationalCount": 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.NonCompliantInformationalCount = int32(i64) } case "NonCompliantLowCount": 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.NonCompliantLowCount = int32(i64) } case "NonCompliantMediumCount": 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.NonCompliantMediumCount = int32(i64) } case "NonCompliantUnspecifiedCount": 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.NonCompliantUnspecifiedCount = int32(i64) } case "OverallSeverity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OverallSeverity = ptr.String(jtv) } case "PatchBaselineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PatchBaselineId = ptr.String(jtv) } case "PatchGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PatchGroup = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSsmPatch(v **types.AwsSsmPatch, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSsmPatch if *v == nil { sv = &types.AwsSsmPatch{} } else { sv = *v } for key, value := range shape { switch key { case "ComplianceSummary": if err := awsRestjson1_deserializeDocumentAwsSsmComplianceSummary(&sv.ComplianceSummary, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsSsmPatchComplianceDetails(v **types.AwsSsmPatchComplianceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsSsmPatchComplianceDetails if *v == nil { sv = &types.AwsSsmPatchComplianceDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Patch": if err := awsRestjson1_deserializeDocumentAwsSsmPatch(&sv.Patch, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineDetails(v **types.AwsStepFunctionStateMachineDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsStepFunctionStateMachineDetails if *v == nil { sv = &types.AwsStepFunctionStateMachineDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Label": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Label = ptr.String(jtv) } case "LoggingConfiguration": if err := awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDetails(&sv.LoggingConfiguration, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "StateMachineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StateMachineArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = ptr.String(jtv) } case "TracingConfiguration": if err := awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineTracingConfigurationDetails(&sv.TracingConfiguration, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDestinationsCloudWatchLogsLogGroupDetails(v **types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsCloudWatchLogsLogGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsCloudWatchLogsLogGroupDetails if *v == nil { sv = &types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsCloudWatchLogsLogGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "LogGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LogGroupArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails(v **types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails if *v == nil { sv = &types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogsLogGroup": if err := awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDestinationsCloudWatchLogsLogGroupDetails(&sv.CloudWatchLogsLogGroup, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDestinationsList(v *[]types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails, 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.AwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails if *v == nil { cv = []types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDestinationsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDetails(v **types.AwsStepFunctionStateMachineLoggingConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsStepFunctionStateMachineLoggingConfigurationDetails if *v == nil { sv = &types.AwsStepFunctionStateMachineLoggingConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Destinations": if err := awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineLoggingConfigurationDestinationsList(&sv.Destinations, value); err != nil { return err } case "IncludeExecutionData": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeExecutionData = jtv } case "Level": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Level = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineTracingConfigurationDetails(v **types.AwsStepFunctionStateMachineTracingConfigurationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsStepFunctionStateMachineTracingConfigurationDetails if *v == nil { sv = &types.AwsStepFunctionStateMachineTracingConfigurationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleDetails(v **types.AwsWafRateBasedRuleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRateBasedRuleDetails if *v == nil { sv = &types.AwsWafRateBasedRuleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MatchPredicates": if err := awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicateList(&sv.MatchPredicates, value); err != nil { return err } case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RateKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RateKey = ptr.String(jtv) } case "RateLimit": 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.RateLimit = i64 } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(v **types.AwsWafRateBasedRuleMatchPredicate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRateBasedRuleMatchPredicate if *v == nil { sv = &types.AwsWafRateBasedRuleMatchPredicate{} } else { sv = *v } for key, value := range shape { switch key { case "DataId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DataId = ptr.String(jtv) } case "Negated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Negated = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicateList(v *[]types.AwsWafRateBasedRuleMatchPredicate, 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.AwsWafRateBasedRuleMatchPredicate if *v == nil { cv = []types.AwsWafRateBasedRuleMatchPredicate{} } else { cv = *v } for _, value := range shape { var col types.AwsWafRateBasedRuleMatchPredicate destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleDetails(v **types.AwsWafRegionalRateBasedRuleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalRateBasedRuleDetails if *v == nil { sv = &types.AwsWafRegionalRateBasedRuleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MatchPredicates": if err := awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(&sv.MatchPredicates, value); err != nil { return err } case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RateKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RateKey = ptr.String(jtv) } case "RateLimit": 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.RateLimit = i64 } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v **types.AwsWafRegionalRateBasedRuleMatchPredicate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalRateBasedRuleMatchPredicate if *v == nil { sv = &types.AwsWafRegionalRateBasedRuleMatchPredicate{} } else { sv = *v } for key, value := range shape { switch key { case "DataId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DataId = ptr.String(jtv) } case "Negated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Negated = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(v *[]types.AwsWafRegionalRateBasedRuleMatchPredicate, 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.AwsWafRegionalRateBasedRuleMatchPredicate if *v == nil { cv = []types.AwsWafRegionalRateBasedRuleMatchPredicate{} } else { cv = *v } for _, value := range shape { var col types.AwsWafRegionalRateBasedRuleMatchPredicate destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRuleDetails(v **types.AwsWafRegionalRuleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalRuleDetails if *v == nil { sv = &types.AwsWafRegionalRuleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "PredicateList": if err := awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateList(&sv.PredicateList, 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupDetails(v **types.AwsWafRegionalRuleGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalRuleGroupDetails if *v == nil { sv = &types.AwsWafRegionalRuleGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RuleGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleGroupId = ptr.String(jtv) } case "Rules": if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesList(&sv.Rules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesActionDetails(v **types.AwsWafRegionalRuleGroupRulesActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalRuleGroupRulesActionDetails if *v == nil { sv = &types.AwsWafRegionalRuleGroupRulesActionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesDetails(v **types.AwsWafRegionalRuleGroupRulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalRuleGroupRulesDetails if *v == nil { sv = &types.AwsWafRegionalRuleGroupRulesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesActionDetails(&sv.Action, value); err != nil { return err } case "Priority": 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.Priority = int32(i64) } 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 "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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesList(v *[]types.AwsWafRegionalRuleGroupRulesDetails, 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.AwsWafRegionalRuleGroupRulesDetails if *v == nil { cv = []types.AwsWafRegionalRuleGroupRulesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsWafRegionalRuleGroupRulesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateList(v *[]types.AwsWafRegionalRulePredicateListDetails, 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.AwsWafRegionalRulePredicateListDetails if *v == nil { cv = []types.AwsWafRegionalRulePredicateListDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsWafRegionalRulePredicateListDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateListDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateListDetails(v **types.AwsWafRegionalRulePredicateListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalRulePredicateListDetails if *v == nil { sv = &types.AwsWafRegionalRulePredicateListDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DataId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DataId = ptr.String(jtv) } case "Negated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Negated = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclDetails(v **types.AwsWafRegionalWebAclDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalWebAclDetails if *v == nil { sv = &types.AwsWafRegionalWebAclDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultAction = ptr.String(jtv) } case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RulesList": if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesList(&sv.RulesList, value); err != nil { return err } case "WebAclId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WebAclId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesList(v *[]types.AwsWafRegionalWebAclRulesListDetails, 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.AwsWafRegionalWebAclRulesListDetails if *v == nil { cv = []types.AwsWafRegionalWebAclRulesListDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsWafRegionalWebAclRulesListDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListActionDetails(v **types.AwsWafRegionalWebAclRulesListActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalWebAclRulesListActionDetails if *v == nil { sv = &types.AwsWafRegionalWebAclRulesListActionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListDetails(v **types.AwsWafRegionalWebAclRulesListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalWebAclRulesListDetails if *v == nil { sv = &types.AwsWafRegionalWebAclRulesListDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListActionDetails(&sv.Action, value); err != nil { return err } case "OverrideAction": if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListOverrideActionDetails(&sv.OverrideAction, value); err != nil { return err } case "Priority": 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.Priority = int32(i64) } 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 "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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListOverrideActionDetails(v **types.AwsWafRegionalWebAclRulesListOverrideActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRegionalWebAclRulesListOverrideActionDetails if *v == nil { sv = &types.AwsWafRegionalWebAclRulesListOverrideActionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRuleDetails(v **types.AwsWafRuleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRuleDetails if *v == nil { sv = &types.AwsWafRuleDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "PredicateList": if err := awsRestjson1_deserializeDocumentAwsWafRulePredicateList(&sv.PredicateList, 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRuleGroupDetails(v **types.AwsWafRuleGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRuleGroupDetails if *v == nil { sv = &types.AwsWafRuleGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RuleGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleGroupId = ptr.String(jtv) } case "Rules": if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesList(&sv.Rules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesActionDetails(v **types.AwsWafRuleGroupRulesActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRuleGroupRulesActionDetails if *v == nil { sv = &types.AwsWafRuleGroupRulesActionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesDetails(v **types.AwsWafRuleGroupRulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRuleGroupRulesDetails if *v == nil { sv = &types.AwsWafRuleGroupRulesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesActionDetails(&sv.Action, value); err != nil { return err } case "Priority": 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.Priority = int32(i64) } 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 "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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesList(v *[]types.AwsWafRuleGroupRulesDetails, 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.AwsWafRuleGroupRulesDetails if *v == nil { cv = []types.AwsWafRuleGroupRulesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsWafRuleGroupRulesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafRulePredicateList(v *[]types.AwsWafRulePredicateListDetails, 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.AwsWafRulePredicateListDetails if *v == nil { cv = []types.AwsWafRulePredicateListDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsWafRulePredicateListDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafRulePredicateListDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafRulePredicateListDetails(v **types.AwsWafRulePredicateListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafRulePredicateListDetails if *v == nil { sv = &types.AwsWafRulePredicateListDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DataId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DataId = ptr.String(jtv) } case "Negated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Negated = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2ActionAllowDetails(v **types.AwsWafv2ActionAllowDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2ActionAllowDetails if *v == nil { sv = &types.AwsWafv2ActionAllowDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomRequestHandling": if err := awsRestjson1_deserializeDocumentAwsWafv2CustomRequestHandlingDetails(&sv.CustomRequestHandling, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2ActionBlockDetails(v **types.AwsWafv2ActionBlockDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2ActionBlockDetails if *v == nil { sv = &types.AwsWafv2ActionBlockDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomResponse": if err := awsRestjson1_deserializeDocumentAwsWafv2CustomResponseDetails(&sv.CustomResponse, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2CustomHttpHeader(v **types.AwsWafv2CustomHttpHeader, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2CustomHttpHeader if *v == nil { sv = &types.AwsWafv2CustomHttpHeader{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2CustomRequestHandlingDetails(v **types.AwsWafv2CustomRequestHandlingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2CustomRequestHandlingDetails if *v == nil { sv = &types.AwsWafv2CustomRequestHandlingDetails{} } else { sv = *v } for key, value := range shape { switch key { case "InsertHeaders": if err := awsRestjson1_deserializeDocumentAwsWafv2InsertHeadersList(&sv.InsertHeaders, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2CustomResponseDetails(v **types.AwsWafv2CustomResponseDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2CustomResponseDetails if *v == nil { sv = &types.AwsWafv2CustomResponseDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomResponseBodyKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustomResponseBodyKey = ptr.String(jtv) } case "ResponseCode": 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.ResponseCode = int32(i64) } case "ResponseHeaders": if err := awsRestjson1_deserializeDocumentAwsWafv2InsertHeadersList(&sv.ResponseHeaders, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2InsertHeadersList(v *[]types.AwsWafv2CustomHttpHeader, 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.AwsWafv2CustomHttpHeader if *v == nil { cv = []types.AwsWafv2CustomHttpHeader{} } else { cv = *v } for _, value := range shape { var col types.AwsWafv2CustomHttpHeader destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafv2CustomHttpHeader(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafv2RuleGroupDetails(v **types.AwsWafv2RuleGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2RuleGroupDetails if *v == nil { sv = &types.AwsWafv2RuleGroupDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Capacity": 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.Capacity = i64 } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } 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 "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Rules": if err := awsRestjson1_deserializeDocumentAwsWafv2RulesList(&sv.Rules, value); err != nil { return err } case "Scope": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Scope = ptr.String(jtv) } case "VisibilityConfig": if err := awsRestjson1_deserializeDocumentAwsWafv2VisibilityConfigDetails(&sv.VisibilityConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2RulesActionCaptchaDetails(v **types.AwsWafv2RulesActionCaptchaDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2RulesActionCaptchaDetails if *v == nil { sv = &types.AwsWafv2RulesActionCaptchaDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomRequestHandling": if err := awsRestjson1_deserializeDocumentAwsWafv2CustomRequestHandlingDetails(&sv.CustomRequestHandling, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2RulesActionCountDetails(v **types.AwsWafv2RulesActionCountDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2RulesActionCountDetails if *v == nil { sv = &types.AwsWafv2RulesActionCountDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomRequestHandling": if err := awsRestjson1_deserializeDocumentAwsWafv2CustomRequestHandlingDetails(&sv.CustomRequestHandling, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2RulesActionDetails(v **types.AwsWafv2RulesActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2RulesActionDetails if *v == nil { sv = &types.AwsWafv2RulesActionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Allow": if err := awsRestjson1_deserializeDocumentAwsWafv2ActionAllowDetails(&sv.Allow, value); err != nil { return err } case "Block": if err := awsRestjson1_deserializeDocumentAwsWafv2ActionBlockDetails(&sv.Block, value); err != nil { return err } case "Captcha": if err := awsRestjson1_deserializeDocumentAwsWafv2RulesActionCaptchaDetails(&sv.Captcha, value); err != nil { return err } case "Count": if err := awsRestjson1_deserializeDocumentAwsWafv2RulesActionCountDetails(&sv.Count, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2RulesDetails(v **types.AwsWafv2RulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2RulesDetails if *v == nil { sv = &types.AwsWafv2RulesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if err := awsRestjson1_deserializeDocumentAwsWafv2RulesActionDetails(&sv.Action, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OverrideAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OverrideAction = ptr.String(jtv) } case "Priority": 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.Priority = int32(i64) } case "VisibilityConfig": if err := awsRestjson1_deserializeDocumentAwsWafv2VisibilityConfigDetails(&sv.VisibilityConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2RulesList(v *[]types.AwsWafv2RulesDetails, 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.AwsWafv2RulesDetails if *v == nil { cv = []types.AwsWafv2RulesDetails{} } else { cv = *v } for _, value := range shape { var col types.AwsWafv2RulesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafv2RulesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsWafv2VisibilityConfigDetails(v **types.AwsWafv2VisibilityConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2VisibilityConfigDetails if *v == nil { sv = &types.AwsWafv2VisibilityConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchMetricsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CloudWatchMetricsEnabled = jtv } case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } case "SampledRequestsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.SampledRequestsEnabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2WebAclActionDetails(v **types.AwsWafv2WebAclActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2WebAclActionDetails if *v == nil { sv = &types.AwsWafv2WebAclActionDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Allow": if err := awsRestjson1_deserializeDocumentAwsWafv2ActionAllowDetails(&sv.Allow, value); err != nil { return err } case "Block": if err := awsRestjson1_deserializeDocumentAwsWafv2ActionBlockDetails(&sv.Block, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2WebAclCaptchaConfigDetails(v **types.AwsWafv2WebAclCaptchaConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2WebAclCaptchaConfigDetails if *v == nil { sv = &types.AwsWafv2WebAclCaptchaConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ImmunityTimeProperty": if err := awsRestjson1_deserializeDocumentAwsWafv2WebAclCaptchaConfigImmunityTimePropertyDetails(&sv.ImmunityTimeProperty, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2WebAclCaptchaConfigImmunityTimePropertyDetails(v **types.AwsWafv2WebAclCaptchaConfigImmunityTimePropertyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2WebAclCaptchaConfigImmunityTimePropertyDetails if *v == nil { sv = &types.AwsWafv2WebAclCaptchaConfigImmunityTimePropertyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ImmunityTime": 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.ImmunityTime = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafv2WebAclDetails(v **types.AwsWafv2WebAclDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafv2WebAclDetails if *v == nil { sv = &types.AwsWafv2WebAclDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Capacity": 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.Capacity = i64 } case "CaptchaConfig": if err := awsRestjson1_deserializeDocumentAwsWafv2WebAclCaptchaConfigDetails(&sv.CaptchaConfig, value); err != nil { return err } case "DefaultAction": if err := awsRestjson1_deserializeDocumentAwsWafv2WebAclActionDetails(&sv.DefaultAction, value); err != nil { return err } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } 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 "ManagedbyFirewallManager": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ManagedbyFirewallManager = jtv } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Rules": if err := awsRestjson1_deserializeDocumentAwsWafv2RulesList(&sv.Rules, value); err != nil { return err } case "VisibilityConfig": if err := awsRestjson1_deserializeDocumentAwsWafv2VisibilityConfigDetails(&sv.VisibilityConfig, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafWebAclDetails(v **types.AwsWafWebAclDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafWebAclDetails if *v == nil { sv = &types.AwsWafWebAclDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DefaultAction = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Rules": if err := awsRestjson1_deserializeDocumentAwsWafWebAclRuleList(&sv.Rules, value); err != nil { return err } case "WebAclId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WebAclId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafWebAclRule(v **types.AwsWafWebAclRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsWafWebAclRule if *v == nil { sv = &types.AwsWafWebAclRule{} } else { sv = *v } for key, value := range shape { switch key { case "Action": if err := awsRestjson1_deserializeDocumentWafAction(&sv.Action, value); err != nil { return err } case "ExcludedRules": if err := awsRestjson1_deserializeDocumentWafExcludedRuleList(&sv.ExcludedRules, value); err != nil { return err } case "OverrideAction": if err := awsRestjson1_deserializeDocumentWafOverrideAction(&sv.OverrideAction, value); err != nil { return err } case "Priority": 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.Priority = int32(i64) } 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 "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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAwsWafWebAclRuleList(v *[]types.AwsWafWebAclRule, 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.AwsWafWebAclRule if *v == nil { cv = []types.AwsWafWebAclRule{} } else { cv = *v } for _, value := range shape { var col types.AwsWafWebAclRule destAddr := &col if err := awsRestjson1_deserializeDocumentAwsWafWebAclRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsXrayEncryptionConfigDetails(v **types.AwsXrayEncryptionConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AwsXrayEncryptionConfigDetails if *v == nil { sv = &types.AwsXrayEncryptionConfigDetails{} } else { sv = *v } for key, value := range shape { switch key { case "KeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Status = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFinding(v **types.BatchUpdateFindingsUnprocessedFinding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BatchUpdateFindingsUnprocessedFinding if *v == nil { sv = &types.BatchUpdateFindingsUnprocessedFinding{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "FindingIdentifier": if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifier(&sv.FindingIdentifier, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFindingsList(v *[]types.BatchUpdateFindingsUnprocessedFinding, 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.BatchUpdateFindingsUnprocessedFinding if *v == nil { cv = []types.BatchUpdateFindingsUnprocessedFinding{} } else { cv = *v } for _, value := range shape { var col types.BatchUpdateFindingsUnprocessedFinding destAddr := &col if err := awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFinding(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBooleanFilter(v **types.BooleanFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BooleanFilter if *v == nil { sv = &types.BooleanFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Value": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Value = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBooleanFilterList(v *[]types.BooleanFilter, 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.BooleanFilter if *v == nil { cv = []types.BooleanFilter{} } else { cv = *v } for _, value := range shape { var col types.BooleanFilter destAddr := &col if err := awsRestjson1_deserializeDocumentBooleanFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCategoryList(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_deserializeDocumentCell(v **types.Cell, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Cell if *v == nil { sv = &types.Cell{} } else { sv = *v } for key, value := range shape { switch key { case "CellReference": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CellReference = ptr.String(jtv) } case "Column": 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.Column = i64 } case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "Row": 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.Row = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCells(v *[]types.Cell, 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.Cell if *v == nil { cv = []types.Cell{} } else { cv = *v } for _, value := range shape { var col types.Cell destAddr := &col if err := awsRestjson1_deserializeDocumentCell(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCidrBlockAssociation(v **types.CidrBlockAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CidrBlockAssociation if *v == nil { sv = &types.CidrBlockAssociation{} } else { sv = *v } for key, value := range shape { switch key { case "AssociationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AssociationId = ptr.String(jtv) } case "CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrBlock = ptr.String(jtv) } case "CidrBlockState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrBlockState = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCidrBlockAssociationList(v *[]types.CidrBlockAssociation, 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.CidrBlockAssociation if *v == nil { cv = []types.CidrBlockAssociation{} } else { cv = *v } for _, value := range shape { var col types.CidrBlockAssociation destAddr := &col if err := awsRestjson1_deserializeDocumentCidrBlockAssociation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCity(v **types.City, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.City if *v == nil { sv = &types.City{} } else { sv = *v } for key, value := range shape { switch key { case "CityName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CityName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClassificationResult(v **types.ClassificationResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ClassificationResult if *v == nil { sv = &types.ClassificationResult{} } else { sv = *v } for key, value := range shape { switch key { case "AdditionalOccurrences": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AdditionalOccurrences = jtv } case "CustomDataIdentifiers": if err := awsRestjson1_deserializeDocumentCustomDataIdentifiersResult(&sv.CustomDataIdentifiers, value); err != nil { return err } case "MimeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MimeType = ptr.String(jtv) } case "SensitiveData": if err := awsRestjson1_deserializeDocumentSensitiveDataResultList(&sv.SensitiveData, value); err != nil { return err } case "SizeClassified": 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.SizeClassified = i64 } case "Status": if err := awsRestjson1_deserializeDocumentClassificationStatus(&sv.Status, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClassificationStatus(v **types.ClassificationStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ClassificationStatus if *v == nil { sv = &types.ClassificationStatus{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentCompliance(v **types.Compliance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Compliance if *v == nil { sv = &types.Compliance{} } else { sv = *v } for key, value := range shape { switch key { case "AssociatedStandards": if err := awsRestjson1_deserializeDocumentAssociatedStandardsList(&sv.AssociatedStandards, value); err != nil { return err } case "RelatedRequirements": if err := awsRestjson1_deserializeDocumentRelatedRequirementsList(&sv.RelatedRequirements, value); err != nil { return err } case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComplianceStatus to be of type string, got %T instead", value) } sv.Status = types.ComplianceStatus(jtv) } case "StatusReasons": if err := awsRestjson1_deserializeDocumentStatusReasonsList(&sv.StatusReasons, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContainerDetails(v **types.ContainerDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ContainerDetails if *v == nil { sv = &types.ContainerDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ContainerRuntime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ContainerRuntime = 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 "ImageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ImageName = ptr.String(jtv) } case "LaunchedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchedAt = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Privileged": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Privileged = jtv } case "VolumeMounts": if err := awsRestjson1_deserializeDocumentVolumeMountList(&sv.VolumeMounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCountry(v **types.Country, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Country if *v == nil { sv = &types.Country{} } else { sv = *v } for key, value := range shape { switch key { case "CountryCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CountryCode = ptr.String(jtv) } case "CountryName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CountryName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomDataIdentifiersDetections(v **types.CustomDataIdentifiersDetections, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CustomDataIdentifiersDetections if *v == nil { sv = &types.CustomDataIdentifiersDetections{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Count": 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.Count = i64 } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Occurrences": if err := awsRestjson1_deserializeDocumentOccurrences(&sv.Occurrences, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomDataIdentifiersDetectionsList(v *[]types.CustomDataIdentifiersDetections, 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.CustomDataIdentifiersDetections if *v == nil { cv = []types.CustomDataIdentifiersDetections{} } else { cv = *v } for _, value := range shape { var col types.CustomDataIdentifiersDetections destAddr := &col if err := awsRestjson1_deserializeDocumentCustomDataIdentifiersDetections(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCustomDataIdentifiersResult(v **types.CustomDataIdentifiersResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CustomDataIdentifiersResult if *v == nil { sv = &types.CustomDataIdentifiersResult{} } else { sv = *v } for key, value := range shape { switch key { case "Detections": if err := awsRestjson1_deserializeDocumentCustomDataIdentifiersDetectionsList(&sv.Detections, value); err != nil { return err } case "TotalCount": 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.TotalCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCvss(v **types.Cvss, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Cvss if *v == nil { sv = &types.Cvss{} } else { sv = *v } for key, value := range shape { switch key { case "Adjustments": if err := awsRestjson1_deserializeDocumentAdjustmentList(&sv.Adjustments, value); err != nil { return err } 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 Double to be a JSON Number, got %T instead", value) } } case "BaseVector": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BaseVector = 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_deserializeDocumentCvssList(v *[]types.Cvss, 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.Cvss if *v == nil { cv = []types.Cvss{} } else { cv = *v } for _, value := range shape { var col types.Cvss destAddr := &col if err := awsRestjson1_deserializeDocumentCvss(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataClassificationDetails(v **types.DataClassificationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataClassificationDetails if *v == nil { sv = &types.DataClassificationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DetailedResultsLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DetailedResultsLocation = ptr.String(jtv) } case "Result": if err := awsRestjson1_deserializeDocumentClassificationResult(&sv.Result, value); err != nil { return err } default: _, _ = key, value } } *v = sv 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 "DateRange": if err := awsRestjson1_deserializeDocumentDateRange(&sv.DateRange, value); err != nil { return err } case "End": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.End = ptr.String(jtv) } case "Start": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Start = ptr.String(jtv) } 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_deserializeDocumentDateRange(v **types.DateRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DateRange if *v == nil { sv = &types.DateRange{} } else { sv = *v } for key, value := range shape { switch key { case "Unit": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateRangeUnit to be of type string, got %T instead", value) } sv.Unit = types.DateRangeUnit(jtv) } case "Value": 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.Value = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDnsRequestAction(v **types.DnsRequestAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DnsRequestAction if *v == nil { sv = &types.DnsRequestAction{} } else { sv = *v } for key, value := range shape { switch key { case "Blocked": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Blocked = jtv } case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentFilePathList(v *[]types.FilePaths, 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.FilePaths if *v == nil { cv = []types.FilePaths{} } else { cv = *v } for _, value := range shape { var col types.FilePaths destAddr := &col if err := awsRestjson1_deserializeDocumentFilePaths(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilePaths(v **types.FilePaths, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FilePaths if *v == nil { sv = &types.FilePaths{} } else { sv = *v } for key, value := range shape { switch key { 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 "Hash": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Hash = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFindingAggregator(v **types.FindingAggregator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FindingAggregator if *v == nil { sv = &types.FindingAggregator{} } else { sv = *v } for key, value := range shape { switch key { case "FindingAggregatorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FindingAggregatorArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFindingAggregatorList(v *[]types.FindingAggregator, 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.FindingAggregator if *v == nil { cv = []types.FindingAggregator{} } else { cv = *v } for _, value := range shape { var col types.FindingAggregator destAddr := &col if err := awsRestjson1_deserializeDocumentFindingAggregator(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFindingHistoryRecord(v **types.FindingHistoryRecord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FindingHistoryRecord if *v == nil { sv = &types.FindingHistoryRecord{} } else { sv = *v } for key, value := range shape { switch key { case "FindingCreated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.FindingCreated = jtv } case "FindingIdentifier": if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifier(&sv.FindingIdentifier, 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 "Updates": if err := awsRestjson1_deserializeDocumentFindingHistoryUpdatesList(&sv.Updates, value); err != nil { return err } case "UpdateSource": if err := awsRestjson1_deserializeDocumentFindingHistoryUpdateSource(&sv.UpdateSource, value); err != nil { return err } case "UpdateTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdateTime = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFindingHistoryRecordList(v *[]types.FindingHistoryRecord, 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.FindingHistoryRecord if *v == nil { cv = []types.FindingHistoryRecord{} } else { cv = *v } for _, value := range shape { var col types.FindingHistoryRecord destAddr := &col if err := awsRestjson1_deserializeDocumentFindingHistoryRecord(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFindingHistoryUpdate(v **types.FindingHistoryUpdate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FindingHistoryUpdate if *v == nil { sv = &types.FindingHistoryUpdate{} } else { sv = *v } for key, value := range shape { switch key { case "NewValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NewValue = ptr.String(jtv) } case "OldValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OldValue = ptr.String(jtv) } case "UpdatedField": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedField = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFindingHistoryUpdatesList(v *[]types.FindingHistoryUpdate, 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.FindingHistoryUpdate if *v == nil { cv = []types.FindingHistoryUpdate{} } else { cv = *v } for _, value := range shape { var col types.FindingHistoryUpdate destAddr := &col if err := awsRestjson1_deserializeDocumentFindingHistoryUpdate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFindingHistoryUpdateSource(v **types.FindingHistoryUpdateSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FindingHistoryUpdateSource if *v == nil { sv = &types.FindingHistoryUpdateSource{} } else { sv = *v } for key, value := range shape { switch key { case "Identity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Identity = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FindingHistoryUpdateSourceType to be of type string, got %T instead", value) } sv.Type = types.FindingHistoryUpdateSourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFindingProviderFields(v **types.FindingProviderFields, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FindingProviderFields if *v == nil { sv = &types.FindingProviderFields{} } else { sv = *v } for key, value := range shape { switch key { case "Confidence": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Confidence = int32(i64) } case "Criticality": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Criticality = int32(i64) } case "RelatedFindings": if err := awsRestjson1_deserializeDocumentRelatedFindingList(&sv.RelatedFindings, value); err != nil { return err } case "Severity": if err := awsRestjson1_deserializeDocumentFindingProviderSeverity(&sv.Severity, value); err != nil { return err } case "Types": if err := awsRestjson1_deserializeDocumentTypeList(&sv.Types, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFindingProviderSeverity(v **types.FindingProviderSeverity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FindingProviderSeverity if *v == nil { sv = &types.FindingProviderSeverity{} } else { sv = *v } for key, value := range shape { switch key { case "Label": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SeverityLabel to be of type string, got %T instead", value) } sv.Label = types.SeverityLabel(jtv) } case "Original": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Original = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFirewallPolicyDetails(v **types.FirewallPolicyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FirewallPolicyDetails if *v == nil { sv = &types.FirewallPolicyDetails{} } else { sv = *v } for key, value := range shape { switch key { case "StatefulRuleGroupReferences": if err := awsRestjson1_deserializeDocumentFirewallPolicyStatefulRuleGroupReferencesList(&sv.StatefulRuleGroupReferences, value); err != nil { return err } case "StatelessCustomActions": if err := awsRestjson1_deserializeDocumentFirewallPolicyStatelessCustomActionsList(&sv.StatelessCustomActions, value); err != nil { return err } case "StatelessDefaultActions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.StatelessDefaultActions, value); err != nil { return err } case "StatelessFragmentDefaultActions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.StatelessFragmentDefaultActions, value); err != nil { return err } case "StatelessRuleGroupReferences": if err := awsRestjson1_deserializeDocumentFirewallPolicyStatelessRuleGroupReferencesList(&sv.StatelessRuleGroupReferences, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFirewallPolicyStatefulRuleGroupReferencesDetails(v **types.FirewallPolicyStatefulRuleGroupReferencesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FirewallPolicyStatefulRuleGroupReferencesDetails if *v == nil { sv = &types.FirewallPolicyStatefulRuleGroupReferencesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ResourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFirewallPolicyStatefulRuleGroupReferencesList(v *[]types.FirewallPolicyStatefulRuleGroupReferencesDetails, 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.FirewallPolicyStatefulRuleGroupReferencesDetails if *v == nil { cv = []types.FirewallPolicyStatefulRuleGroupReferencesDetails{} } else { cv = *v } for _, value := range shape { var col types.FirewallPolicyStatefulRuleGroupReferencesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentFirewallPolicyStatefulRuleGroupReferencesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFirewallPolicyStatelessCustomActionsDetails(v **types.FirewallPolicyStatelessCustomActionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FirewallPolicyStatelessCustomActionsDetails if *v == nil { sv = &types.FirewallPolicyStatelessCustomActionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ActionDefinition": if err := awsRestjson1_deserializeDocumentStatelessCustomActionDefinition(&sv.ActionDefinition, value); err != nil { return err } case "ActionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFirewallPolicyStatelessCustomActionsList(v *[]types.FirewallPolicyStatelessCustomActionsDetails, 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.FirewallPolicyStatelessCustomActionsDetails if *v == nil { cv = []types.FirewallPolicyStatelessCustomActionsDetails{} } else { cv = *v } for _, value := range shape { var col types.FirewallPolicyStatelessCustomActionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentFirewallPolicyStatelessCustomActionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFirewallPolicyStatelessRuleGroupReferencesDetails(v **types.FirewallPolicyStatelessRuleGroupReferencesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FirewallPolicyStatelessRuleGroupReferencesDetails if *v == nil { sv = &types.FirewallPolicyStatelessRuleGroupReferencesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Priority": 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.Priority = int32(i64) } case "ResourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFirewallPolicyStatelessRuleGroupReferencesList(v *[]types.FirewallPolicyStatelessRuleGroupReferencesDetails, 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.FirewallPolicyStatelessRuleGroupReferencesDetails if *v == nil { cv = []types.FirewallPolicyStatelessRuleGroupReferencesDetails{} } else { cv = *v } for _, value := range shape { var col types.FirewallPolicyStatelessRuleGroupReferencesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentFirewallPolicyStatelessRuleGroupReferencesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentGeoLocation(v **types.GeoLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.GeoLocation if *v == nil { sv = &types.GeoLocation{} } else { sv = *v } for key, value := range shape { switch key { case "Lat": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Lat = 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.Lat = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Lon": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Lon = 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.Lon = 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_deserializeDocumentIcmpTypeCode(v **types.IcmpTypeCode, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IcmpTypeCode if *v == nil { sv = &types.IcmpTypeCode{} } else { sv = *v } for key, value := range shape { switch key { case "Code": 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.Code = int32(i64) } case "Type": 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.Type = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportFindingsError(v **types.ImportFindingsError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ImportFindingsError if *v == nil { sv = &types.ImportFindingsError{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImportFindingsErrorList(v *[]types.ImportFindingsError, 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.ImportFindingsError if *v == nil { cv = []types.ImportFindingsError{} } else { cv = *v } for _, value := range shape { var col types.ImportFindingsError destAddr := &col if err := awsRestjson1_deserializeDocumentImportFindingsError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInsight(v **types.Insight, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Insight if *v == nil { sv = &types.Insight{} } else { sv = *v } for key, value := range shape { switch key { case "Filters": if err := awsRestjson1_deserializeDocumentAwsSecurityFindingFilters(&sv.Filters, value); err != nil { return err } case "GroupByAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupByAttribute = ptr.String(jtv) } case "InsightArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InsightArn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInsightList(v *[]types.Insight, 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.Insight if *v == nil { cv = []types.Insight{} } else { cv = *v } for _, value := range shape { var col types.Insight destAddr := &col if err := awsRestjson1_deserializeDocumentInsight(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInsightResults(v **types.InsightResults, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InsightResults if *v == nil { sv = &types.InsightResults{} } else { sv = *v } for key, value := range shape { switch key { case "GroupByAttribute": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupByAttribute = ptr.String(jtv) } case "InsightArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InsightArn = ptr.String(jtv) } case "ResultValues": if err := awsRestjson1_deserializeDocumentInsightResultValueList(&sv.ResultValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInsightResultValue(v **types.InsightResultValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InsightResultValue if *v == nil { sv = &types.InsightResultValue{} } 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 Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = int32(i64) } case "GroupByAttributeValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GroupByAttributeValue = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInsightResultValueList(v *[]types.InsightResultValue, 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.InsightResultValue if *v == nil { cv = []types.InsightResultValue{} } else { cv = *v } for _, value := range shape { var col types.InsightResultValue destAddr := &col if err := awsRestjson1_deserializeDocumentInsightResultValue(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIntegerList(v *[]int32, 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 []int32 if *v == nil { cv = []int32{} } else { cv = *v } for _, value := range shape { var col int32 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 } col = int32(i64) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIntegrationTypeList(v *[]types.IntegrationType, 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.IntegrationType if *v == nil { cv = []types.IntegrationType{} } else { cv = *v } for _, value := range shape { var col types.IntegrationType if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IntegrationType to be of type string, got %T instead", value) } col = types.IntegrationType(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalException if *v == nil { sv = &types.InternalException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidAccessException(v **types.InvalidAccessException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidAccessException if *v == nil { sv = &types.InvalidAccessException{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidInputException if *v == nil { sv = &types.InvalidInputException{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvitation(v **types.Invitation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Invitation if *v == nil { sv = &types.Invitation{} } 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 "InvitationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InvitationId = ptr.String(jtv) } case "InvitedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.InvitedAt = ptr.Time(t) } case "MemberStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MemberStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvitationList(v *[]types.Invitation, 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.Invitation if *v == nil { cv = []types.Invitation{} } else { cv = *v } for _, value := range shape { var col types.Invitation destAddr := &col if err := awsRestjson1_deserializeDocumentInvitation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIpFilter(v **types.IpFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IpFilter if *v == nil { sv = &types.IpFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Cidr": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Cidr = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIpFilterList(v *[]types.IpFilter, 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.IpFilter if *v == nil { cv = []types.IpFilter{} } else { cv = *v } for _, value := range shape { var col types.IpFilter destAddr := &col if err := awsRestjson1_deserializeDocumentIpFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIpOrganizationDetails(v **types.IpOrganizationDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IpOrganizationDetails if *v == nil { sv = &types.IpOrganizationDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Asn": 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.Asn = int32(i64) } case "AsnOrg": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AsnOrg = ptr.String(jtv) } case "Isp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Isp = ptr.String(jtv) } case "Org": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Org = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIpv6CidrBlockAssociation(v **types.Ipv6CidrBlockAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Ipv6CidrBlockAssociation if *v == nil { sv = &types.Ipv6CidrBlockAssociation{} } else { sv = *v } for key, value := range shape { switch key { case "AssociationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AssociationId = ptr.String(jtv) } case "CidrBlockState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrBlockState = ptr.String(jtv) } case "Ipv6CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ipv6CidrBlock = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIpv6CidrBlockAssociationList(v *[]types.Ipv6CidrBlockAssociation, 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.Ipv6CidrBlockAssociation if *v == nil { cv = []types.Ipv6CidrBlockAssociation{} } else { cv = *v } for _, value := range shape { var col types.Ipv6CidrBlockAssociation destAddr := &col if err := awsRestjson1_deserializeDocumentIpv6CidrBlockAssociation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentKeywordFilter(v **types.KeywordFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.KeywordFilter if *v == nil { sv = &types.KeywordFilter{} } else { sv = *v } for key, value := range shape { switch key { 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_deserializeDocumentKeywordFilterList(v *[]types.KeywordFilter, 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.KeywordFilter if *v == nil { cv = []types.KeywordFilter{} } else { cv = *v } for _, value := range shape { var col types.KeywordFilter destAddr := &col if err := awsRestjson1_deserializeDocumentKeywordFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLoadBalancerState(v **types.LoadBalancerState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LoadBalancerState if *v == nil { sv = &types.LoadBalancerState{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Code = 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_deserializeDocumentMalware(v **types.Malware, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Malware if *v == nil { sv = &types.Malware{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MalwareState to be of type string, got %T instead", value) } sv.State = types.MalwareState(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MalwareType to be of type string, got %T instead", value) } sv.Type = types.MalwareType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMalwareList(v *[]types.Malware, 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.Malware if *v == nil { cv = []types.Malware{} } else { cv = *v } for _, value := range shape { var col types.Malware destAddr := &col if err := awsRestjson1_deserializeDocumentMalware(&destAddr, value); err != nil { return err } col = *destAddr 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 MapFilterComparison to be of type string, got %T instead", value) } sv.Comparison = types.MapFilterComparison(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_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 "AdministratorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AdministratorId = ptr.String(jtv) } case "Email": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Email = ptr.String(jtv) } case "InvitedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.InvitedAt = ptr.Time(t) } case "MasterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MasterId = ptr.String(jtv) } case "MemberStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MemberStatus = ptr.String(jtv) } case "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } default: _, _ = key, value } } *v = sv 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_deserializeDocumentNetwork(v **types.Network, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Network if *v == nil { sv = &types.Network{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationDomain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationDomain = ptr.String(jtv) } case "DestinationIpV4": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationIpV4 = ptr.String(jtv) } case "DestinationIpV6": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationIpV6 = ptr.String(jtv) } case "DestinationPort": 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.DestinationPort = int32(i64) } case "Direction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkDirection to be of type string, got %T instead", value) } sv.Direction = types.NetworkDirection(jtv) } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } case "SourceDomain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceDomain = ptr.String(jtv) } case "SourceIpV4": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceIpV4 = ptr.String(jtv) } case "SourceIpV6": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceIpV6 = ptr.String(jtv) } case "SourceMac": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceMac = ptr.String(jtv) } case "SourcePort": 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.SourcePort = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkConnectionAction(v **types.NetworkConnectionAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkConnectionAction if *v == nil { sv = &types.NetworkConnectionAction{} } else { sv = *v } for key, value := range shape { switch key { case "Blocked": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Blocked = jtv } case "ConnectionDirection": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ConnectionDirection = ptr.String(jtv) } case "LocalPortDetails": if err := awsRestjson1_deserializeDocumentActionLocalPortDetails(&sv.LocalPortDetails, value); err != nil { return err } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } case "RemoteIpDetails": if err := awsRestjson1_deserializeDocumentActionRemoteIpDetails(&sv.RemoteIpDetails, value); err != nil { return err } case "RemotePortDetails": if err := awsRestjson1_deserializeDocumentActionRemotePortDetails(&sv.RemotePortDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkHeader(v **types.NetworkHeader, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkHeader if *v == nil { sv = &types.NetworkHeader{} } else { sv = *v } for key, value := range shape { switch key { case "Destination": if err := awsRestjson1_deserializeDocumentNetworkPathComponentDetails(&sv.Destination, value); err != nil { return err } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = ptr.String(jtv) } case "Source": if err := awsRestjson1_deserializeDocumentNetworkPathComponentDetails(&sv.Source, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkPathComponent(v **types.NetworkPathComponent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkPathComponent if *v == nil { sv = &types.NetworkPathComponent{} } 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 NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.ComponentType = ptr.String(jtv) } case "Egress": if err := awsRestjson1_deserializeDocumentNetworkHeader(&sv.Egress, value); err != nil { return err } case "Ingress": if err := awsRestjson1_deserializeDocumentNetworkHeader(&sv.Ingress, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkPathComponentDetails(v **types.NetworkPathComponentDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NetworkPathComponentDetails if *v == nil { sv = &types.NetworkPathComponentDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Address": if err := awsRestjson1_deserializeDocumentStringList(&sv.Address, value); err != nil { return err } case "PortRanges": if err := awsRestjson1_deserializeDocumentPortRangeList(&sv.PortRanges, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkPathList(v *[]types.NetworkPathComponent, 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.NetworkPathComponent if *v == nil { cv = []types.NetworkPathComponent{} } else { cv = *v } for _, value := range shape { var col types.NetworkPathComponent destAddr := &col if err := awsRestjson1_deserializeDocumentNetworkPathComponent(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv 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_deserializeDocumentNote(v **types.Note, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Note if *v == nil { sv = &types.Note{} } 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 "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedAt = ptr.String(jtv) } case "UpdatedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedBy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNoteUpdate(v **types.NoteUpdate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NoteUpdate if *v == nil { sv = &types.NoteUpdate{} } 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 "UpdatedBy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedBy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv 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 "Eq": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Eq = 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.Eq = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Gte": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Gte = 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.Gte = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Lte": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Lte = 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.Lte = 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_deserializeDocumentOccurrences(v **types.Occurrences, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Occurrences if *v == nil { sv = &types.Occurrences{} } else { sv = *v } for key, value := range shape { switch key { case "Cells": if err := awsRestjson1_deserializeDocumentCells(&sv.Cells, value); err != nil { return err } case "LineRanges": if err := awsRestjson1_deserializeDocumentRanges(&sv.LineRanges, value); err != nil { return err } case "OffsetRanges": if err := awsRestjson1_deserializeDocumentRanges(&sv.OffsetRanges, value); err != nil { return err } case "Pages": if err := awsRestjson1_deserializeDocumentPages(&sv.Pages, value); err != nil { return err } case "Records": if err := awsRestjson1_deserializeDocumentRecords(&sv.Records, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPage(v **types.Page, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Page if *v == nil { sv = &types.Page{} } else { sv = *v } for key, value := range shape { switch key { case "LineRange": if err := awsRestjson1_deserializeDocumentRange(&sv.LineRange, value); err != nil { return err } case "OffsetRange": if err := awsRestjson1_deserializeDocumentRange(&sv.OffsetRange, value); err != nil { return err } case "PageNumber": 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.PageNumber = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPages(v *[]types.Page, 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.Page if *v == nil { cv = []types.Page{} } else { cv = *v } for _, value := range shape { var col types.Page destAddr := &col if err := awsRestjson1_deserializeDocumentPage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPatchSummary(v **types.PatchSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PatchSummary if *v == nil { sv = &types.PatchSummary{} } else { sv = *v } for key, value := range shape { switch key { case "FailedCount": 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.FailedCount = int32(i64) } 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 "InstalledCount": 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.InstalledCount = int32(i64) } case "InstalledOtherCount": 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.InstalledOtherCount = int32(i64) } case "InstalledPendingReboot": 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.InstalledPendingReboot = int32(i64) } case "InstalledRejectedCount": 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.InstalledRejectedCount = int32(i64) } case "MissingCount": 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.MissingCount = int32(i64) } case "Operation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Operation = ptr.String(jtv) } case "OperationEndTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OperationEndTime = ptr.String(jtv) } case "OperationStartTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OperationStartTime = ptr.String(jtv) } case "RebootOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RebootOption = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortProbeAction(v **types.PortProbeAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PortProbeAction if *v == nil { sv = &types.PortProbeAction{} } else { sv = *v } for key, value := range shape { switch key { case "Blocked": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Blocked = jtv } case "PortProbeDetails": if err := awsRestjson1_deserializeDocumentPortProbeDetailList(&sv.PortProbeDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortProbeDetail(v **types.PortProbeDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PortProbeDetail if *v == nil { sv = &types.PortProbeDetail{} } else { sv = *v } for key, value := range shape { switch key { case "LocalIpDetails": if err := awsRestjson1_deserializeDocumentActionLocalIpDetails(&sv.LocalIpDetails, value); err != nil { return err } case "LocalPortDetails": if err := awsRestjson1_deserializeDocumentActionLocalPortDetails(&sv.LocalPortDetails, value); err != nil { return err } case "RemoteIpDetails": if err := awsRestjson1_deserializeDocumentActionRemoteIpDetails(&sv.RemoteIpDetails, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortProbeDetailList(v *[]types.PortProbeDetail, 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.PortProbeDetail if *v == nil { cv = []types.PortProbeDetail{} } else { cv = *v } for _, value := range shape { var col types.PortProbeDetail destAddr := &col if err := awsRestjson1_deserializeDocumentPortProbeDetail(&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 Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Begin = int32(i64) } case "End": 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.End = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortRangeFromTo(v **types.PortRangeFromTo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PortRangeFromTo if *v == nil { sv = &types.PortRangeFromTo{} } else { sv = *v } for key, value := range shape { switch key { case "From": 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.From = int32(i64) } case "To": 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.To = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortRangeList(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.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.PortRange if *v == nil { cv = []types.PortRange{} } else { cv = *v } for _, value := range shape { var col types.PortRange destAddr := &col if err := awsRestjson1_deserializeDocumentPortRange(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentProcessDetails(v **types.ProcessDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ProcessDetails if *v == nil { sv = &types.ProcessDetails{} } else { sv = *v } for key, value := range shape { switch key { case "LaunchedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchedAt = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ParentPid": 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.ParentPid = int32(i64) } case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } case "Pid": 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.Pid = int32(i64) } case "TerminatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TerminatedAt = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProduct(v **types.Product, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Product if *v == nil { sv = &types.Product{} } else { sv = *v } for key, value := range shape { switch key { case "ActivationUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActivationUrl = ptr.String(jtv) } case "Categories": if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { return err } case "CompanyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CompanyName = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "IntegrationTypes": if err := awsRestjson1_deserializeDocumentIntegrationTypeList(&sv.IntegrationTypes, value); err != nil { return err } case "MarketplaceUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MarketplaceUrl = ptr.String(jtv) } case "ProductArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductArn = ptr.String(jtv) } case "ProductName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductName = ptr.String(jtv) } case "ProductSubscriptionResourcePolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductSubscriptionResourcePolicy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProductsList(v *[]types.Product, 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.Product if *v == nil { cv = []types.Product{} } else { cv = *v } for _, value := range shape { var col types.Product destAddr := &col if err := awsRestjson1_deserializeDocumentProduct(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentProductSubscriptionArnList(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_deserializeDocumentPropagatingVgwSetDetails(v **types.PropagatingVgwSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PropagatingVgwSetDetails if *v == nil { sv = &types.PropagatingVgwSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "GatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GatewayId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPropagatingVgwSetList(v *[]types.PropagatingVgwSetDetails, 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.PropagatingVgwSetDetails if *v == nil { cv = []types.PropagatingVgwSetDetails{} } else { cv = *v } for _, value := range shape { var col types.PropagatingVgwSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentPropagatingVgwSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRange(v **types.Range, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Range if *v == nil { sv = &types.Range{} } else { sv = *v } for key, value := range shape { switch key { case "End": 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.End = i64 } case "Start": 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.Start = i64 } case "StartColumn": 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.StartColumn = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRanges(v *[]types.Range, 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.Range if *v == nil { cv = []types.Range{} } else { cv = *v } for _, value := range shape { var col types.Range destAddr := &col if err := awsRestjson1_deserializeDocumentRange(&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_deserializeDocumentRecord(v **types.Record, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Record if *v == nil { sv = &types.Record{} } else { sv = *v } for key, value := range shape { switch key { case "JsonPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.JsonPath = ptr.String(jtv) } case "RecordIndex": 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.RecordIndex = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRecords(v *[]types.Record, 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.Record if *v == nil { cv = []types.Record{} } else { cv = *v } for _, value := range shape { var col types.Record destAddr := &col if err := awsRestjson1_deserializeDocumentRecord(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRelatedFinding(v **types.RelatedFinding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RelatedFinding if *v == nil { sv = &types.RelatedFinding{} } else { sv = *v } for key, value := range shape { switch key { 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 "ProductArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProductArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRelatedFindingList(v *[]types.RelatedFinding, 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.RelatedFinding if *v == nil { cv = []types.RelatedFinding{} } else { cv = *v } for _, value := range shape { var col types.RelatedFinding destAddr := &col if err := awsRestjson1_deserializeDocumentRelatedFinding(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRelatedRequirementsList(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_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_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 "DataClassification": if err := awsRestjson1_deserializeDocumentDataClassificationDetails(&sv.DataClassification, value); err != nil { return err } 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 Partition to be of type string, got %T instead", value) } sv.Partition = types.Partition(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 "ResourceRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ResourceRole = ptr.String(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Tags, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceConflictException(v **types.ResourceConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceConflictException if *v == nil { sv = &types.ResourceConflictException{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(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 "AwsAmazonMqBroker": if err := awsRestjson1_deserializeDocumentAwsAmazonMqBrokerDetails(&sv.AwsAmazonMqBroker, value); err != nil { return err } case "AwsApiGatewayRestApi": if err := awsRestjson1_deserializeDocumentAwsApiGatewayRestApiDetails(&sv.AwsApiGatewayRestApi, value); err != nil { return err } case "AwsApiGatewayStage": if err := awsRestjson1_deserializeDocumentAwsApiGatewayStageDetails(&sv.AwsApiGatewayStage, value); err != nil { return err } case "AwsApiGatewayV2Api": if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2ApiDetails(&sv.AwsApiGatewayV2Api, value); err != nil { return err } case "AwsApiGatewayV2Stage": if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2StageDetails(&sv.AwsApiGatewayV2Stage, value); err != nil { return err } case "AwsAppSyncGraphQlApi": if err := awsRestjson1_deserializeDocumentAwsAppSyncGraphQlApiDetails(&sv.AwsAppSyncGraphQlApi, value); err != nil { return err } case "AwsAthenaWorkGroup": if err := awsRestjson1_deserializeDocumentAwsAthenaWorkGroupDetails(&sv.AwsAthenaWorkGroup, value); err != nil { return err } case "AwsAutoScalingAutoScalingGroup": if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupDetails(&sv.AwsAutoScalingAutoScalingGroup, value); err != nil { return err } case "AwsAutoScalingLaunchConfiguration": if err := awsRestjson1_deserializeDocumentAwsAutoScalingLaunchConfigurationDetails(&sv.AwsAutoScalingLaunchConfiguration, value); err != nil { return err } case "AwsBackupBackupPlan": if err := awsRestjson1_deserializeDocumentAwsBackupBackupPlanDetails(&sv.AwsBackupBackupPlan, value); err != nil { return err } case "AwsBackupBackupVault": if err := awsRestjson1_deserializeDocumentAwsBackupBackupVaultDetails(&sv.AwsBackupBackupVault, value); err != nil { return err } case "AwsBackupRecoveryPoint": if err := awsRestjson1_deserializeDocumentAwsBackupRecoveryPointDetails(&sv.AwsBackupRecoveryPoint, value); err != nil { return err } case "AwsCertificateManagerCertificate": if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDetails(&sv.AwsCertificateManagerCertificate, value); err != nil { return err } case "AwsCloudFormationStack": if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackDetails(&sv.AwsCloudFormationStack, value); err != nil { return err } case "AwsCloudFrontDistribution": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDetails(&sv.AwsCloudFrontDistribution, value); err != nil { return err } case "AwsCloudTrailTrail": if err := awsRestjson1_deserializeDocumentAwsCloudTrailTrailDetails(&sv.AwsCloudTrailTrail, value); err != nil { return err } case "AwsCloudWatchAlarm": if err := awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDetails(&sv.AwsCloudWatchAlarm, value); err != nil { return err } case "AwsCodeBuildProject": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectDetails(&sv.AwsCodeBuildProject, value); err != nil { return err } case "AwsDynamoDbTable": if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableDetails(&sv.AwsDynamoDbTable, value); err != nil { return err } case "AwsEc2Eip": if err := awsRestjson1_deserializeDocumentAwsEc2EipDetails(&sv.AwsEc2Eip, value); err != nil { return err } case "AwsEc2Instance": if err := awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(&sv.AwsEc2Instance, value); err != nil { return err } case "AwsEc2LaunchTemplate": if err := awsRestjson1_deserializeDocumentAwsEc2LaunchTemplateDetails(&sv.AwsEc2LaunchTemplate, value); err != nil { return err } case "AwsEc2NetworkAcl": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkAclDetails(&sv.AwsEc2NetworkAcl, value); err != nil { return err } case "AwsEc2NetworkInterface": if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceDetails(&sv.AwsEc2NetworkInterface, value); err != nil { return err } case "AwsEc2RouteTable": if err := awsRestjson1_deserializeDocumentAwsEc2RouteTableDetails(&sv.AwsEc2RouteTable, value); err != nil { return err } case "AwsEc2SecurityGroup": if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupDetails(&sv.AwsEc2SecurityGroup, value); err != nil { return err } case "AwsEc2Subnet": if err := awsRestjson1_deserializeDocumentAwsEc2SubnetDetails(&sv.AwsEc2Subnet, value); err != nil { return err } case "AwsEc2TransitGateway": if err := awsRestjson1_deserializeDocumentAwsEc2TransitGatewayDetails(&sv.AwsEc2TransitGateway, value); err != nil { return err } case "AwsEc2Volume": if err := awsRestjson1_deserializeDocumentAwsEc2VolumeDetails(&sv.AwsEc2Volume, value); err != nil { return err } case "AwsEc2Vpc": if err := awsRestjson1_deserializeDocumentAwsEc2VpcDetails(&sv.AwsEc2Vpc, value); err != nil { return err } case "AwsEc2VpcEndpointService": if err := awsRestjson1_deserializeDocumentAwsEc2VpcEndpointServiceDetails(&sv.AwsEc2VpcEndpointService, value); err != nil { return err } case "AwsEc2VpcPeeringConnection": if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionDetails(&sv.AwsEc2VpcPeeringConnection, value); err != nil { return err } case "AwsEc2VpnConnection": if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionDetails(&sv.AwsEc2VpnConnection, value); err != nil { return err } case "AwsEcrContainerImage": if err := awsRestjson1_deserializeDocumentAwsEcrContainerImageDetails(&sv.AwsEcrContainerImage, value); err != nil { return err } case "AwsEcrRepository": if err := awsRestjson1_deserializeDocumentAwsEcrRepositoryDetails(&sv.AwsEcrRepository, value); err != nil { return err } case "AwsEcsCluster": if err := awsRestjson1_deserializeDocumentAwsEcsClusterDetails(&sv.AwsEcsCluster, value); err != nil { return err } case "AwsEcsContainer": if err := awsRestjson1_deserializeDocumentAwsEcsContainerDetails(&sv.AwsEcsContainer, value); err != nil { return err } case "AwsEcsService": if err := awsRestjson1_deserializeDocumentAwsEcsServiceDetails(&sv.AwsEcsService, value); err != nil { return err } case "AwsEcsTask": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDetails(&sv.AwsEcsTask, value); err != nil { return err } case "AwsEcsTaskDefinition": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionDetails(&sv.AwsEcsTaskDefinition, value); err != nil { return err } case "AwsEfsAccessPoint": if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointDetails(&sv.AwsEfsAccessPoint, value); err != nil { return err } case "AwsEksCluster": if err := awsRestjson1_deserializeDocumentAwsEksClusterDetails(&sv.AwsEksCluster, value); err != nil { return err } case "AwsElasticBeanstalkEnvironment": if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentDetails(&sv.AwsElasticBeanstalkEnvironment, value); err != nil { return err } case "AwsElasticsearchDomain": if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainDetails(&sv.AwsElasticsearchDomain, value); err != nil { return err } case "AwsElbLoadBalancer": if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerDetails(&sv.AwsElbLoadBalancer, value); err != nil { return err } case "AwsElbv2LoadBalancer": if err := awsRestjson1_deserializeDocumentAwsElbv2LoadBalancerDetails(&sv.AwsElbv2LoadBalancer, value); err != nil { return err } case "AwsEventSchemasRegistry": if err := awsRestjson1_deserializeDocumentAwsEventSchemasRegistryDetails(&sv.AwsEventSchemasRegistry, value); err != nil { return err } case "AwsGuardDutyDetector": if err := awsRestjson1_deserializeDocumentAwsGuardDutyDetectorDetails(&sv.AwsGuardDutyDetector, value); err != nil { return err } case "AwsIamAccessKey": if err := awsRestjson1_deserializeDocumentAwsIamAccessKeyDetails(&sv.AwsIamAccessKey, value); err != nil { return err } case "AwsIamGroup": if err := awsRestjson1_deserializeDocumentAwsIamGroupDetails(&sv.AwsIamGroup, value); err != nil { return err } case "AwsIamPolicy": if err := awsRestjson1_deserializeDocumentAwsIamPolicyDetails(&sv.AwsIamPolicy, value); err != nil { return err } case "AwsIamRole": if err := awsRestjson1_deserializeDocumentAwsIamRoleDetails(&sv.AwsIamRole, value); err != nil { return err } case "AwsIamUser": if err := awsRestjson1_deserializeDocumentAwsIamUserDetails(&sv.AwsIamUser, value); err != nil { return err } case "AwsKinesisStream": if err := awsRestjson1_deserializeDocumentAwsKinesisStreamDetails(&sv.AwsKinesisStream, value); err != nil { return err } case "AwsKmsKey": if err := awsRestjson1_deserializeDocumentAwsKmsKeyDetails(&sv.AwsKmsKey, value); err != nil { return err } case "AwsLambdaFunction": if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(&sv.AwsLambdaFunction, value); err != nil { return err } case "AwsLambdaLayerVersion": if err := awsRestjson1_deserializeDocumentAwsLambdaLayerVersionDetails(&sv.AwsLambdaLayerVersion, value); err != nil { return err } case "AwsNetworkFirewallFirewall": if err := awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallDetails(&sv.AwsNetworkFirewallFirewall, value); err != nil { return err } case "AwsNetworkFirewallFirewallPolicy": if err := awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallPolicyDetails(&sv.AwsNetworkFirewallFirewallPolicy, value); err != nil { return err } case "AwsNetworkFirewallRuleGroup": if err := awsRestjson1_deserializeDocumentAwsNetworkFirewallRuleGroupDetails(&sv.AwsNetworkFirewallRuleGroup, value); err != nil { return err } case "AwsOpenSearchServiceDomain": if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainDetails(&sv.AwsOpenSearchServiceDomain, value); err != nil { return err } case "AwsRdsDbCluster": if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterDetails(&sv.AwsRdsDbCluster, value); err != nil { return err } case "AwsRdsDbClusterSnapshot": if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDetails(&sv.AwsRdsDbClusterSnapshot, value); err != nil { return err } case "AwsRdsDbInstance": if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceDetails(&sv.AwsRdsDbInstance, value); err != nil { return err } case "AwsRdsDbSecurityGroup": if err := awsRestjson1_deserializeDocumentAwsRdsDbSecurityGroupDetails(&sv.AwsRdsDbSecurityGroup, value); err != nil { return err } case "AwsRdsDbSnapshot": if err := awsRestjson1_deserializeDocumentAwsRdsDbSnapshotDetails(&sv.AwsRdsDbSnapshot, value); err != nil { return err } case "AwsRdsEventSubscription": if err := awsRestjson1_deserializeDocumentAwsRdsEventSubscriptionDetails(&sv.AwsRdsEventSubscription, value); err != nil { return err } case "AwsRedshiftCluster": if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterDetails(&sv.AwsRedshiftCluster, value); err != nil { return err } case "AwsS3AccountPublicAccessBlock": if err := awsRestjson1_deserializeDocumentAwsS3AccountPublicAccessBlockDetails(&sv.AwsS3AccountPublicAccessBlock, value); err != nil { return err } case "AwsS3Bucket": if err := awsRestjson1_deserializeDocumentAwsS3BucketDetails(&sv.AwsS3Bucket, value); err != nil { return err } case "AwsS3Object": if err := awsRestjson1_deserializeDocumentAwsS3ObjectDetails(&sv.AwsS3Object, value); err != nil { return err } case "AwsSageMakerNotebookInstance": if err := awsRestjson1_deserializeDocumentAwsSageMakerNotebookInstanceDetails(&sv.AwsSageMakerNotebookInstance, value); err != nil { return err } case "AwsSecretsManagerSecret": if err := awsRestjson1_deserializeDocumentAwsSecretsManagerSecretDetails(&sv.AwsSecretsManagerSecret, value); err != nil { return err } case "AwsSnsTopic": if err := awsRestjson1_deserializeDocumentAwsSnsTopicDetails(&sv.AwsSnsTopic, value); err != nil { return err } case "AwsSqsQueue": if err := awsRestjson1_deserializeDocumentAwsSqsQueueDetails(&sv.AwsSqsQueue, value); err != nil { return err } case "AwsSsmPatchCompliance": if err := awsRestjson1_deserializeDocumentAwsSsmPatchComplianceDetails(&sv.AwsSsmPatchCompliance, value); err != nil { return err } case "AwsStepFunctionStateMachine": if err := awsRestjson1_deserializeDocumentAwsStepFunctionStateMachineDetails(&sv.AwsStepFunctionStateMachine, value); err != nil { return err } case "AwsWafRateBasedRule": if err := awsRestjson1_deserializeDocumentAwsWafRateBasedRuleDetails(&sv.AwsWafRateBasedRule, value); err != nil { return err } case "AwsWafRegionalRateBasedRule": if err := awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleDetails(&sv.AwsWafRegionalRateBasedRule, value); err != nil { return err } case "AwsWafRegionalRule": if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleDetails(&sv.AwsWafRegionalRule, value); err != nil { return err } case "AwsWafRegionalRuleGroup": if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupDetails(&sv.AwsWafRegionalRuleGroup, value); err != nil { return err } case "AwsWafRegionalWebAcl": if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclDetails(&sv.AwsWafRegionalWebAcl, value); err != nil { return err } case "AwsWafRule": if err := awsRestjson1_deserializeDocumentAwsWafRuleDetails(&sv.AwsWafRule, value); err != nil { return err } case "AwsWafRuleGroup": if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupDetails(&sv.AwsWafRuleGroup, value); err != nil { return err } case "AwsWafv2RuleGroup": if err := awsRestjson1_deserializeDocumentAwsWafv2RuleGroupDetails(&sv.AwsWafv2RuleGroup, value); err != nil { return err } case "AwsWafv2WebAcl": if err := awsRestjson1_deserializeDocumentAwsWafv2WebAclDetails(&sv.AwsWafv2WebAcl, value); err != nil { return err } case "AwsWafWebAcl": if err := awsRestjson1_deserializeDocumentAwsWafWebAclDetails(&sv.AwsWafWebAcl, value); err != nil { return err } case "AwsXrayEncryptionConfig": if err := awsRestjson1_deserializeDocumentAwsXrayEncryptionConfigDetails(&sv.AwsXrayEncryptionConfig, value); err != nil { return err } case "Container": if err := awsRestjson1_deserializeDocumentContainerDetails(&sv.Container, value); err != nil { return err } case "Other": if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Other, 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_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResult(v **types.Result, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Result if *v == nil { sv = &types.Result{} } 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 "ProcessingResult": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ProcessingResult = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResultList(v *[]types.Result, 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.Result if *v == nil { cv = []types.Result{} } else { cv = *v } for _, value := range shape { var col types.Result destAddr := &col if err := awsRestjson1_deserializeDocumentResult(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRouteSetDetails(v **types.RouteSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RouteSetDetails if *v == nil { sv = &types.RouteSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CarrierGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CarrierGatewayId = ptr.String(jtv) } case "CoreNetworkArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CoreNetworkArn = ptr.String(jtv) } case "DestinationCidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationCidrBlock = ptr.String(jtv) } case "DestinationIpv6CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationIpv6CidrBlock = ptr.String(jtv) } case "DestinationPrefixListId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationPrefixListId = ptr.String(jtv) } case "EgressOnlyInternetGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.EgressOnlyInternetGatewayId = ptr.String(jtv) } case "GatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GatewayId = 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 "InstanceOwnerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.InstanceOwnerId = ptr.String(jtv) } case "LocalGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LocalGatewayId = ptr.String(jtv) } case "NatGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NatGatewayId = ptr.String(jtv) } case "NetworkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } case "Origin": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Origin = ptr.String(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.State = ptr.String(jtv) } case "TransitGatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.TransitGatewayId = ptr.String(jtv) } case "VpcPeeringConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VpcPeeringConnectionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRouteSetList(v *[]types.RouteSetDetails, 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.RouteSetDetails if *v == nil { cv = []types.RouteSetDetails{} } else { cv = *v } for _, value := range shape { var col types.RouteSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentRouteSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupDetails(v **types.RuleGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupDetails if *v == nil { sv = &types.RuleGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { case "RulesSource": if err := awsRestjson1_deserializeDocumentRuleGroupSource(&sv.RulesSource, value); err != nil { return err } case "RuleVariables": if err := awsRestjson1_deserializeDocumentRuleGroupVariables(&sv.RuleVariables, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSource(v **types.RuleGroupSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSource if *v == nil { sv = &types.RuleGroupSource{} } else { sv = *v } for key, value := range shape { switch key { case "RulesSourceList": if err := awsRestjson1_deserializeDocumentRuleGroupSourceListDetails(&sv.RulesSourceList, value); err != nil { return err } case "RulesString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RulesString = ptr.String(jtv) } case "StatefulRules": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesList(&sv.StatefulRules, value); err != nil { return err } case "StatelessRulesAndCustomActions": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRulesAndCustomActionsDetails(&sv.StatelessRulesAndCustomActions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceCustomActionsDetails(v **types.RuleGroupSourceCustomActionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceCustomActionsDetails if *v == nil { sv = &types.RuleGroupSourceCustomActionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "ActionDefinition": if err := awsRestjson1_deserializeDocumentStatelessCustomActionDefinition(&sv.ActionDefinition, value); err != nil { return err } case "ActionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceCustomActionsList(v *[]types.RuleGroupSourceCustomActionsDetails, 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.RuleGroupSourceCustomActionsDetails if *v == nil { cv = []types.RuleGroupSourceCustomActionsDetails{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceCustomActionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceCustomActionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceListDetails(v **types.RuleGroupSourceListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceListDetails if *v == nil { sv = &types.RuleGroupSourceListDetails{} } else { sv = *v } for key, value := range shape { switch key { case "GeneratedRulesType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.GeneratedRulesType = ptr.String(jtv) } case "Targets": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Targets, value); err != nil { return err } case "TargetTypes": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.TargetTypes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesDetails(v **types.RuleGroupSourceStatefulRulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatefulRulesDetails if *v == nil { sv = &types.RuleGroupSourceStatefulRulesDetails{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Action = ptr.String(jtv) } case "Header": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesHeaderDetails(&sv.Header, value); err != nil { return err } case "RuleOptions": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesOptionsList(&sv.RuleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesHeaderDetails(v **types.RuleGroupSourceStatefulRulesHeaderDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatefulRulesHeaderDetails if *v == nil { sv = &types.RuleGroupSourceStatefulRulesHeaderDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Destination": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Destination = ptr.String(jtv) } case "DestinationPort": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DestinationPort = ptr.String(jtv) } case "Direction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Direction = ptr.String(jtv) } case "Protocol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Protocol = 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 "SourcePort": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourcePort = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesList(v *[]types.RuleGroupSourceStatefulRulesDetails, 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.RuleGroupSourceStatefulRulesDetails if *v == nil { cv = []types.RuleGroupSourceStatefulRulesDetails{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatefulRulesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesOptionsDetails(v **types.RuleGroupSourceStatefulRulesOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatefulRulesOptionsDetails if *v == nil { sv = &types.RuleGroupSourceStatefulRulesOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Keyword": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Keyword = ptr.String(jtv) } case "Settings": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesRuleOptionsSettingsList(&sv.Settings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesOptionsList(v *[]types.RuleGroupSourceStatefulRulesOptionsDetails, 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.RuleGroupSourceStatefulRulesOptionsDetails if *v == nil { cv = []types.RuleGroupSourceStatefulRulesOptionsDetails{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatefulRulesOptionsDetails destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesOptionsDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatefulRulesRuleOptionsSettingsList(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_deserializeDocumentRuleGroupSourceStatelessRuleDefinition(v **types.RuleGroupSourceStatelessRuleDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRuleDefinition if *v == nil { sv = &types.RuleGroupSourceStatelessRuleDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Actions, value); err != nil { return err } case "MatchAttributes": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributes(&sv.MatchAttributes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributes(v **types.RuleGroupSourceStatelessRuleMatchAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRuleMatchAttributes if *v == nil { sv = &types.RuleGroupSourceStatelessRuleMatchAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationPorts": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinationPortsList(&sv.DestinationPorts, value); err != nil { return err } case "Destinations": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinationsList(&sv.Destinations, value); err != nil { return err } case "Protocols": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesProtocolsList(&sv.Protocols, value); err != nil { return err } case "SourcePorts": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSourcePortsList(&sv.SourcePorts, value); err != nil { return err } case "Sources": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSourcesList(&sv.Sources, value); err != nil { return err } case "TcpFlags": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesTcpFlagsList(&sv.TcpFlags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinationPorts(v **types.RuleGroupSourceStatelessRuleMatchAttributesDestinationPorts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRuleMatchAttributesDestinationPorts if *v == nil { sv = &types.RuleGroupSourceStatelessRuleMatchAttributesDestinationPorts{} } else { sv = *v } for key, value := range shape { switch key { case "FromPort": 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.FromPort = int32(i64) } case "ToPort": 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.ToPort = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinationPortsList(v *[]types.RuleGroupSourceStatelessRuleMatchAttributesDestinationPorts, 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.RuleGroupSourceStatelessRuleMatchAttributesDestinationPorts if *v == nil { cv = []types.RuleGroupSourceStatelessRuleMatchAttributesDestinationPorts{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatelessRuleMatchAttributesDestinationPorts destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinationPorts(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinations(v **types.RuleGroupSourceStatelessRuleMatchAttributesDestinations, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRuleMatchAttributesDestinations if *v == nil { sv = &types.RuleGroupSourceStatelessRuleMatchAttributesDestinations{} } else { sv = *v } for key, value := range shape { switch key { case "AddressDefinition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AddressDefinition = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinationsList(v *[]types.RuleGroupSourceStatelessRuleMatchAttributesDestinations, 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.RuleGroupSourceStatelessRuleMatchAttributesDestinations if *v == nil { cv = []types.RuleGroupSourceStatelessRuleMatchAttributesDestinations{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatelessRuleMatchAttributesDestinations destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesDestinations(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesProtocolsList(v *[]int32, 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 []int32 if *v == nil { cv = []int32{} } else { cv = *v } for _, value := range shape { var col int32 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 } col = int32(i64) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSourcePorts(v **types.RuleGroupSourceStatelessRuleMatchAttributesSourcePorts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRuleMatchAttributesSourcePorts if *v == nil { sv = &types.RuleGroupSourceStatelessRuleMatchAttributesSourcePorts{} } else { sv = *v } for key, value := range shape { switch key { case "FromPort": 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.FromPort = int32(i64) } case "ToPort": 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.ToPort = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSourcePortsList(v *[]types.RuleGroupSourceStatelessRuleMatchAttributesSourcePorts, 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.RuleGroupSourceStatelessRuleMatchAttributesSourcePorts if *v == nil { cv = []types.RuleGroupSourceStatelessRuleMatchAttributesSourcePorts{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatelessRuleMatchAttributesSourcePorts destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSourcePorts(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSources(v **types.RuleGroupSourceStatelessRuleMatchAttributesSources, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRuleMatchAttributesSources if *v == nil { sv = &types.RuleGroupSourceStatelessRuleMatchAttributesSources{} } else { sv = *v } for key, value := range shape { switch key { case "AddressDefinition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AddressDefinition = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSourcesList(v *[]types.RuleGroupSourceStatelessRuleMatchAttributesSources, 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.RuleGroupSourceStatelessRuleMatchAttributesSources if *v == nil { cv = []types.RuleGroupSourceStatelessRuleMatchAttributesSources{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatelessRuleMatchAttributesSources destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesSources(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesTcpFlags(v **types.RuleGroupSourceStatelessRuleMatchAttributesTcpFlags, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRuleMatchAttributesTcpFlags if *v == nil { sv = &types.RuleGroupSourceStatelessRuleMatchAttributesTcpFlags{} } else { sv = *v } for key, value := range shape { switch key { case "Flags": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Flags, value); err != nil { return err } case "Masks": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Masks, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesTcpFlagsList(v *[]types.RuleGroupSourceStatelessRuleMatchAttributesTcpFlags, 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.RuleGroupSourceStatelessRuleMatchAttributesTcpFlags if *v == nil { cv = []types.RuleGroupSourceStatelessRuleMatchAttributesTcpFlags{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatelessRuleMatchAttributesTcpFlags destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleMatchAttributesTcpFlags(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRulesAndCustomActionsDetails(v **types.RuleGroupSourceStatelessRulesAndCustomActionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRulesAndCustomActionsDetails if *v == nil { sv = &types.RuleGroupSourceStatelessRulesAndCustomActionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CustomActions": if err := awsRestjson1_deserializeDocumentRuleGroupSourceCustomActionsList(&sv.CustomActions, value); err != nil { return err } case "StatelessRules": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRulesList(&sv.StatelessRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRulesDetails(v **types.RuleGroupSourceStatelessRulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupSourceStatelessRulesDetails if *v == nil { sv = &types.RuleGroupSourceStatelessRulesDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Priority": 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.Priority = int32(i64) } case "RuleDefinition": if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRuleDefinition(&sv.RuleDefinition, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRulesList(v *[]types.RuleGroupSourceStatelessRulesDetails, 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.RuleGroupSourceStatelessRulesDetails if *v == nil { cv = []types.RuleGroupSourceStatelessRulesDetails{} } else { cv = *v } for _, value := range shape { var col types.RuleGroupSourceStatelessRulesDetails destAddr := &col if err := awsRestjson1_deserializeDocumentRuleGroupSourceStatelessRulesDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRuleGroupVariables(v **types.RuleGroupVariables, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupVariables if *v == nil { sv = &types.RuleGroupVariables{} } else { sv = *v } for key, value := range shape { switch key { case "IpSets": if err := awsRestjson1_deserializeDocumentRuleGroupVariablesIpSetsDetails(&sv.IpSets, value); err != nil { return err } case "PortSets": if err := awsRestjson1_deserializeDocumentRuleGroupVariablesPortSetsDetails(&sv.PortSets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupVariablesIpSetsDetails(v **types.RuleGroupVariablesIpSetsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupVariablesIpSetsDetails if *v == nil { sv = &types.RuleGroupVariablesIpSetsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Definition": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Definition, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRuleGroupVariablesPortSetsDetails(v **types.RuleGroupVariablesPortSetsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RuleGroupVariablesPortSetsDetails if *v == nil { sv = &types.RuleGroupVariablesPortSetsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Definition": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Definition, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityControl(v **types.SecurityControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SecurityControl if *v == nil { sv = &types.SecurityControl{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "RemediationUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RemediationUrl = ptr.String(jtv) } case "SecurityControlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlArn = ptr.String(jtv) } case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } case "SecurityControlStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ControlStatus to be of type string, got %T instead", value) } sv.SecurityControlStatus = types.ControlStatus(jtv) } case "SeverityRating": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SeverityRating to be of type string, got %T instead", value) } sv.SeverityRating = types.SeverityRating(jtv) } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityControlDefinition(v **types.SecurityControlDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SecurityControlDefinition if *v == nil { sv = &types.SecurityControlDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "CurrentRegionAvailability": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RegionAvailabilityStatus to be of type string, got %T instead", value) } sv.CurrentRegionAvailability = types.RegionAvailabilityStatus(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "RemediationUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RemediationUrl = ptr.String(jtv) } case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } case "SeverityRating": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SeverityRating to be of type string, got %T instead", value) } sv.SeverityRating = types.SeverityRating(jtv) } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityControlDefinitions(v *[]types.SecurityControlDefinition, 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.SecurityControlDefinition if *v == nil { cv = []types.SecurityControlDefinition{} } else { cv = *v } for _, value := range shape { var col types.SecurityControlDefinition destAddr := &col if err := awsRestjson1_deserializeDocumentSecurityControlDefinition(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSecurityControls(v *[]types.SecurityControl, 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.SecurityControl if *v == nil { cv = []types.SecurityControl{} } else { cv = *v } for _, value := range shape { var col types.SecurityControl destAddr := &col if err := awsRestjson1_deserializeDocumentSecurityControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSecurityGroups(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSensitiveDataDetections(v **types.SensitiveDataDetections, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SensitiveDataDetections if *v == nil { sv = &types.SensitiveDataDetections{} } 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 Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Count = i64 } case "Occurrences": if err := awsRestjson1_deserializeDocumentOccurrences(&sv.Occurrences, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSensitiveDataDetectionsList(v *[]types.SensitiveDataDetections, 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.SensitiveDataDetections if *v == nil { cv = []types.SensitiveDataDetections{} } else { cv = *v } for _, value := range shape { var col types.SensitiveDataDetections destAddr := &col if err := awsRestjson1_deserializeDocumentSensitiveDataDetections(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSensitiveDataResult(v **types.SensitiveDataResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SensitiveDataResult if *v == nil { sv = &types.SensitiveDataResult{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Category = ptr.String(jtv) } case "Detections": if err := awsRestjson1_deserializeDocumentSensitiveDataDetectionsList(&sv.Detections, value); err != nil { return err } case "TotalCount": 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.TotalCount = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSensitiveDataResultList(v *[]types.SensitiveDataResult, 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.SensitiveDataResult if *v == nil { cv = []types.SensitiveDataResult{} } else { cv = *v } for _, value := range shape { var col types.SensitiveDataResult destAddr := &col if err := awsRestjson1_deserializeDocumentSensitiveDataResult(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSeverity(v **types.Severity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Severity if *v == nil { sv = &types.Severity{} } else { sv = *v } for key, value := range shape { switch key { case "Label": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SeverityLabel to be of type string, got %T instead", value) } sv.Label = types.SeverityLabel(jtv) } case "Normalized": 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.Normalized = int32(i64) } case "Original": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Original = ptr.String(jtv) } case "Product": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Product = 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.Product = 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_deserializeDocumentSeverityUpdate(v **types.SeverityUpdate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SeverityUpdate if *v == nil { sv = &types.SeverityUpdate{} } else { sv = *v } for key, value := range shape { switch key { case "Label": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SeverityLabel to be of type string, got %T instead", value) } sv.Label = types.SeverityLabel(jtv) } case "Normalized": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected RatioScale to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Normalized = int32(i64) } case "Product": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Product = 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.Product = 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_deserializeDocumentSoftwarePackage(v **types.SoftwarePackage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SoftwarePackage if *v == nil { sv = &types.SoftwarePackage{} } 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 "Epoch": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Epoch = 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 "FixedInVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.PackageManager = ptr.String(jtv) } case "Release": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Remediation = ptr.String(jtv) } case "SourceLayerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SourceLayerArn = ptr.String(jtv) } case "SourceLayerHash": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSoftwarePackageList(v *[]types.SoftwarePackage, 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.SoftwarePackage if *v == nil { cv = []types.SoftwarePackage{} } else { cv = *v } for _, value := range shape { var col types.SoftwarePackage destAddr := &col if err := awsRestjson1_deserializeDocumentSoftwarePackage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStandard(v **types.Standard, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Standard if *v == nil { sv = &types.Standard{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "EnabledByDefault": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnabledByDefault = jtv } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "StandardsArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsArn = ptr.String(jtv) } case "StandardsManagedBy": if err := awsRestjson1_deserializeDocumentStandardsManagedBy(&sv.StandardsManagedBy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandards(v *[]types.Standard, 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.Standard if *v == nil { cv = []types.Standard{} } else { cv = *v } for _, value := range shape { var col types.Standard destAddr := &col if err := awsRestjson1_deserializeDocumentStandard(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStandardsControl(v **types.StandardsControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsControl if *v == nil { sv = &types.StandardsControl{} } else { sv = *v } for key, value := range shape { switch key { case "ControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ControlId = ptr.String(jtv) } case "ControlStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ControlStatus to be of type string, got %T instead", value) } sv.ControlStatus = types.ControlStatus(jtv) } case "ControlStatusUpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.ControlStatusUpdatedAt = ptr.Time(t) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "DisabledReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DisabledReason = ptr.String(jtv) } case "RelatedRequirements": if err := awsRestjson1_deserializeDocumentRelatedRequirementsList(&sv.RelatedRequirements, value); err != nil { return err } case "RemediationUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RemediationUrl = ptr.String(jtv) } case "SeverityRating": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SeverityRating to be of type string, got %T instead", value) } sv.SeverityRating = types.SeverityRating(jtv) } case "StandardsControlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsControlArn = ptr.String(jtv) } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsControlArnList(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_deserializeDocumentStandardsControlAssociationDetail(v **types.StandardsControlAssociationDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsControlAssociationDetail if *v == nil { sv = &types.StandardsControlAssociationDetail{} } else { sv = *v } for key, value := range shape { switch key { case "AssociationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssociationStatus to be of type string, got %T instead", value) } sv.AssociationStatus = types.AssociationStatus(jtv) } case "RelatedRequirements": if err := awsRestjson1_deserializeDocumentRelatedRequirementsList(&sv.RelatedRequirements, value); err != nil { return err } case "SecurityControlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlArn = ptr.String(jtv) } case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } case "StandardsArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsArn = ptr.String(jtv) } case "StandardsControlArns": if err := awsRestjson1_deserializeDocumentStandardsControlArnList(&sv.StandardsControlArns, value); err != nil { return err } case "StandardsControlDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsControlDescription = ptr.String(jtv) } case "StandardsControlTitle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsControlTitle = ptr.String(jtv) } case "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } case "UpdatedReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsControlAssociationDetails(v *[]types.StandardsControlAssociationDetail, 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.StandardsControlAssociationDetail if *v == nil { cv = []types.StandardsControlAssociationDetail{} } else { cv = *v } for _, value := range shape { var col types.StandardsControlAssociationDetail destAddr := &col if err := awsRestjson1_deserializeDocumentStandardsControlAssociationDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStandardsControlAssociationId(v **types.StandardsControlAssociationId, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsControlAssociationId if *v == nil { sv = &types.StandardsControlAssociationId{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } case "StandardsArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsControlAssociationSummaries(v *[]types.StandardsControlAssociationSummary, 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.StandardsControlAssociationSummary if *v == nil { cv = []types.StandardsControlAssociationSummary{} } else { cv = *v } for _, value := range shape { var col types.StandardsControlAssociationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentStandardsControlAssociationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStandardsControlAssociationSummary(v **types.StandardsControlAssociationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsControlAssociationSummary if *v == nil { sv = &types.StandardsControlAssociationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "AssociationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssociationStatus to be of type string, got %T instead", value) } sv.AssociationStatus = types.AssociationStatus(jtv) } case "RelatedRequirements": if err := awsRestjson1_deserializeDocumentRelatedRequirementsList(&sv.RelatedRequirements, value); err != nil { return err } case "SecurityControlArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlArn = ptr.String(jtv) } case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } case "StandardsArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsArn = ptr.String(jtv) } case "StandardsControlDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsControlDescription = ptr.String(jtv) } case "StandardsControlTitle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsControlTitle = ptr.String(jtv) } case "UpdatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedAt = ptr.Time(t) } case "UpdatedReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsControlAssociationUpdate(v **types.StandardsControlAssociationUpdate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsControlAssociationUpdate if *v == nil { sv = &types.StandardsControlAssociationUpdate{} } else { sv = *v } for key, value := range shape { switch key { case "AssociationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssociationStatus to be of type string, got %T instead", value) } sv.AssociationStatus = types.AssociationStatus(jtv) } case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } case "StandardsArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsArn = ptr.String(jtv) } case "UpdatedReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.UpdatedReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsControls(v *[]types.StandardsControl, 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.StandardsControl if *v == nil { cv = []types.StandardsControl{} } else { cv = *v } for _, value := range shape { var col types.StandardsControl destAddr := &col if err := awsRestjson1_deserializeDocumentStandardsControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStandardsInputParameterMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentStandardsManagedBy(v **types.StandardsManagedBy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsManagedBy if *v == nil { sv = &types.StandardsManagedBy{} } else { sv = *v } for key, value := range shape { switch key { case "Company": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Company = ptr.String(jtv) } case "Product": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Product = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsStatusReason(v **types.StandardsStatusReason, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsStatusReason if *v == nil { sv = &types.StandardsStatusReason{} } else { sv = *v } for key, value := range shape { switch key { case "StatusReasonCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StatusReasonCode to be of type string, got %T instead", value) } sv.StatusReasonCode = types.StatusReasonCode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsSubscription(v **types.StandardsSubscription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StandardsSubscription if *v == nil { sv = &types.StandardsSubscription{} } else { sv = *v } for key, value := range shape { switch key { case "StandardsArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsArn = ptr.String(jtv) } case "StandardsInput": if err := awsRestjson1_deserializeDocumentStandardsInputParameterMap(&sv.StandardsInput, value); err != nil { return err } case "StandardsStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StandardsStatus to be of type string, got %T instead", value) } sv.StandardsStatus = types.StandardsStatus(jtv) } case "StandardsStatusReason": if err := awsRestjson1_deserializeDocumentStandardsStatusReason(&sv.StandardsStatusReason, value); err != nil { return err } case "StandardsSubscriptionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.StandardsSubscriptionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStandardsSubscriptions(v *[]types.StandardsSubscription, 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.StandardsSubscription if *v == nil { cv = []types.StandardsSubscription{} } else { cv = *v } for _, value := range shape { var col types.StandardsSubscription destAddr := &col if err := awsRestjson1_deserializeDocumentStandardsSubscription(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStatelessCustomActionDefinition(v **types.StatelessCustomActionDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StatelessCustomActionDefinition if *v == nil { sv = &types.StatelessCustomActionDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "PublishMetricAction": if err := awsRestjson1_deserializeDocumentStatelessCustomPublishMetricAction(&sv.PublishMetricAction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStatelessCustomPublishMetricAction(v **types.StatelessCustomPublishMetricAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StatelessCustomPublishMetricAction if *v == nil { sv = &types.StatelessCustomPublishMetricAction{} } else { sv = *v } for key, value := range shape { switch key { case "Dimensions": if err := awsRestjson1_deserializeDocumentStatelessCustomPublishMetricActionDimensionsList(&sv.Dimensions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStatelessCustomPublishMetricActionDimension(v **types.StatelessCustomPublishMetricActionDimension, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StatelessCustomPublishMetricActionDimension if *v == nil { sv = &types.StatelessCustomPublishMetricActionDimension{} } else { sv = *v } for key, value := range shape { switch key { 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_deserializeDocumentStatelessCustomPublishMetricActionDimensionsList(v *[]types.StatelessCustomPublishMetricActionDimension, 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.StatelessCustomPublishMetricActionDimension if *v == nil { cv = []types.StatelessCustomPublishMetricActionDimension{} } else { cv = *v } for _, value := range shape { var col types.StatelessCustomPublishMetricActionDimension destAddr := &col if err := awsRestjson1_deserializeDocumentStatelessCustomPublishMetricActionDimension(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStatusReason(v **types.StatusReason, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StatusReason if *v == nil { sv = &types.StatusReason{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "ReasonCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ReasonCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStatusReasonsList(v *[]types.StatusReason, 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.StatusReason if *v == nil { cv = []types.StatusReason{} } else { cv = *v } for _, value := range shape { var col types.StatusReason destAddr := &col if err := awsRestjson1_deserializeDocumentStatusReason(&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 StringFilterComparison to be of type string, got %T instead", value) } sv.Comparison = types.StringFilterComparison(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_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_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentThreat(v **types.Threat, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Threat if *v == nil { sv = &types.Threat{} } else { sv = *v } for key, value := range shape { switch key { case "FilePaths": if err := awsRestjson1_deserializeDocumentFilePathList(&sv.FilePaths, value); err != nil { return err } case "ItemCount": 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.ItemCount = int32(i64) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Severity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Severity = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThreatIntelIndicator(v **types.ThreatIntelIndicator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ThreatIntelIndicator if *v == nil { sv = &types.ThreatIntelIndicator{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ThreatIntelIndicatorCategory to be of type string, got %T instead", value) } sv.Category = types.ThreatIntelIndicatorCategory(jtv) } case "LastObservedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LastObservedAt = 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 "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 "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ThreatIntelIndicatorType to be of type string, got %T instead", value) } sv.Type = types.ThreatIntelIndicatorType(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_deserializeDocumentThreatIntelIndicatorList(v *[]types.ThreatIntelIndicator, 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.ThreatIntelIndicator if *v == nil { cv = []types.ThreatIntelIndicator{} } else { cv = *v } for _, value := range shape { var col types.ThreatIntelIndicator destAddr := &col if err := awsRestjson1_deserializeDocumentThreatIntelIndicator(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThreatList(v *[]types.Threat, 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.Threat if *v == nil { cv = []types.Threat{} } else { cv = *v } for _, value := range shape { var col types.Threat destAddr := &col if err := awsRestjson1_deserializeDocumentThreat(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTypeList(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_deserializeDocumentUnprocessedAutomationRule(v **types.UnprocessedAutomationRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnprocessedAutomationRule if *v == nil { sv = &types.UnprocessedAutomationRule{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorCode": 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.ErrorCode = int32(i64) } 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 "RuleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RuleArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnprocessedAutomationRulesList(v *[]types.UnprocessedAutomationRule, 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.UnprocessedAutomationRule if *v == nil { cv = []types.UnprocessedAutomationRule{} } else { cv = *v } for _, value := range shape { var col types.UnprocessedAutomationRule destAddr := &col if err := awsRestjson1_deserializeDocumentUnprocessedAutomationRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUnprocessedSecurityControl(v **types.UnprocessedSecurityControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnprocessedSecurityControl if *v == nil { sv = &types.UnprocessedSecurityControl{} } 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 UnprocessedErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.UnprocessedErrorCode(jtv) } case "ErrorReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorReason = ptr.String(jtv) } case "SecurityControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SecurityControlId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnprocessedSecurityControls(v *[]types.UnprocessedSecurityControl, 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.UnprocessedSecurityControl if *v == nil { cv = []types.UnprocessedSecurityControl{} } else { cv = *v } for _, value := range shape { var col types.UnprocessedSecurityControl destAddr := &col if err := awsRestjson1_deserializeDocumentUnprocessedSecurityControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociation(v **types.UnprocessedStandardsControlAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnprocessedStandardsControlAssociation if *v == nil { sv = &types.UnprocessedStandardsControlAssociation{} } 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 UnprocessedErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.UnprocessedErrorCode(jtv) } case "ErrorReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorReason = ptr.String(jtv) } case "StandardsControlAssociationId": if err := awsRestjson1_deserializeDocumentStandardsControlAssociationId(&sv.StandardsControlAssociationId, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociations(v *[]types.UnprocessedStandardsControlAssociation, 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.UnprocessedStandardsControlAssociation if *v == nil { cv = []types.UnprocessedStandardsControlAssociation{} } else { cv = *v } for _, value := range shape { var col types.UnprocessedStandardsControlAssociation destAddr := &col if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociationUpdate(v **types.UnprocessedStandardsControlAssociationUpdate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnprocessedStandardsControlAssociationUpdate if *v == nil { sv = &types.UnprocessedStandardsControlAssociationUpdate{} } 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 UnprocessedErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = types.UnprocessedErrorCode(jtv) } case "ErrorReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ErrorReason = ptr.String(jtv) } case "StandardsControlAssociationUpdate": if err := awsRestjson1_deserializeDocumentStandardsControlAssociationUpdate(&sv.StandardsControlAssociationUpdate, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociationUpdates(v *[]types.UnprocessedStandardsControlAssociationUpdate, 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.UnprocessedStandardsControlAssociationUpdate if *v == nil { cv = []types.UnprocessedStandardsControlAssociationUpdate{} } else { cv = *v } for _, value := range shape { var col types.UnprocessedStandardsControlAssociationUpdate destAddr := &col if err := awsRestjson1_deserializeDocumentUnprocessedStandardsControlAssociationUpdate(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVolumeMount(v **types.VolumeMount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VolumeMount if *v == nil { sv = &types.VolumeMount{} } else { sv = *v } for key, value := range shape { switch key { case "MountPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.MountPath = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVolumeMountList(v *[]types.VolumeMount, 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.VolumeMount if *v == nil { cv = []types.VolumeMount{} } else { cv = *v } for _, value := range shape { var col types.VolumeMount destAddr := &col if err := awsRestjson1_deserializeDocumentVolumeMount(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetDetails(v **types.VpcInfoCidrBlockSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VpcInfoCidrBlockSetDetails if *v == nil { sv = &types.VpcInfoCidrBlockSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CidrBlock = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetList(v *[]types.VpcInfoCidrBlockSetDetails, 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.VpcInfoCidrBlockSetDetails if *v == nil { cv = []types.VpcInfoCidrBlockSetDetails{} } else { cv = *v } for _, value := range shape { var col types.VpcInfoCidrBlockSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetDetails(v **types.VpcInfoIpv6CidrBlockSetDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VpcInfoIpv6CidrBlockSetDetails if *v == nil { sv = &types.VpcInfoIpv6CidrBlockSetDetails{} } else { sv = *v } for key, value := range shape { switch key { case "Ipv6CidrBlock": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Ipv6CidrBlock = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetList(v *[]types.VpcInfoIpv6CidrBlockSetDetails, 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.VpcInfoIpv6CidrBlockSetDetails if *v == nil { cv = []types.VpcInfoIpv6CidrBlockSetDetails{} } else { cv = *v } for _, value := range shape { var col types.VpcInfoIpv6CidrBlockSetDetails destAddr := &col if err := awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetDetails(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVpcInfoPeeringOptionsDetails(v **types.VpcInfoPeeringOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VpcInfoPeeringOptionsDetails if *v == nil { sv = &types.VpcInfoPeeringOptionsDetails{} } else { sv = *v } for key, value := range shape { switch key { case "AllowDnsResolutionFromRemoteVpc": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AllowDnsResolutionFromRemoteVpc = jtv } case "AllowEgressFromLocalClassicLinkToRemoteVpc": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AllowEgressFromLocalClassicLinkToRemoteVpc = jtv } case "AllowEgressFromLocalVpcToRemoteClassicLink": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AllowEgressFromLocalVpcToRemoteClassicLink = jtv } default: _, _ = key, value } } *v = sv 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 "Cvss": if err := awsRestjson1_deserializeDocumentCvssList(&sv.Cvss, value); err != nil { return err } case "FixAvailable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VulnerabilityFixAvailable to be of type string, got %T instead", value) } sv.FixAvailable = types.VulnerabilityFixAvailable(jtv) } 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_deserializeDocumentStringList(&sv.ReferenceUrls, value); err != nil { return err } case "RelatedVulnerabilities": if err := awsRestjson1_deserializeDocumentStringList(&sv.RelatedVulnerabilities, value); err != nil { return err } case "Vendor": if err := awsRestjson1_deserializeDocumentVulnerabilityVendor(&sv.Vendor, value); err != nil { return err } case "VulnerablePackages": if err := awsRestjson1_deserializeDocumentSoftwarePackageList(&sv.VulnerablePackages, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVulnerabilityList(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_deserializeDocumentVulnerabilityVendor(v **types.VulnerabilityVendor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VulnerabilityVendor if *v == nil { sv = &types.VulnerabilityVendor{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } case "VendorCreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VendorCreatedAt = ptr.String(jtv) } 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 { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VendorUpdatedAt = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWafAction(v **types.WafAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WafAction if *v == nil { sv = &types.WafAction{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWafExcludedRule(v **types.WafExcludedRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WafExcludedRule if *v == nil { sv = &types.WafExcludedRule{} } else { sv = *v } for key, value := range shape { switch key { 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWafExcludedRuleList(v *[]types.WafExcludedRule, 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.WafExcludedRule if *v == nil { cv = []types.WafExcludedRule{} } else { cv = *v } for _, value := range shape { var col types.WafExcludedRule destAddr := &col if err := awsRestjson1_deserializeDocumentWafExcludedRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWafOverrideAction(v **types.WafOverrideAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WafOverrideAction if *v == nil { sv = &types.WafOverrideAction{} } else { sv = *v } for key, value := range shape { switch key { case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkflow(v **types.Workflow, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Workflow if *v == nil { sv = &types.Workflow{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStatus to be of type string, got %T instead", value) } sv.Status = types.WorkflowStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkflowUpdate(v **types.WorkflowUpdate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.WorkflowUpdate if *v == nil { sv = &types.WorkflowUpdate{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStatus to be of type string, got %T instead", value) } sv.Status = types.WorkflowStatus(jtv) } default: _, _ = key, value } } *v = sv return nil }