func awsRestjson1_deserializeDocumentApplicationComponentDetail()

in service/migrationhubstrategy/deserializers.go [4313:4528]


func awsRestjson1_deserializeDocumentApplicationComponentDetail(v **types.ApplicationComponentDetail, value interface{}) error {
	if v == nil {
		return fmt.Errorf("unexpected nil of type %T", v)
	}
	if value == nil {
		return nil
	}

	shape, ok := value.(map[string]interface{})
	if !ok {
		return fmt.Errorf("unexpected JSON type %v", value)
	}

	var sv *types.ApplicationComponentDetail
	if *v == nil {
		sv = &types.ApplicationComponentDetail{}
	} else {
		sv = *v
	}

	for key, value := range shape {
		switch key {
		case "analysisStatus":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected SrcCodeOrDbAnalysisStatus to be of type string, got %T instead", value)
				}
				sv.AnalysisStatus = types.SrcCodeOrDbAnalysisStatus(jtv)
			}

		case "antipatternReportS3Object":
			if err := awsRestjson1_deserializeDocumentS3Object(&sv.AntipatternReportS3Object, value); err != nil {
				return err
			}

		case "antipatternReportStatus":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected AntipatternReportStatus to be of type string, got %T instead", value)
				}
				sv.AntipatternReportStatus = types.AntipatternReportStatus(jtv)
			}

		case "antipatternReportStatusMessage":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value)
				}
				sv.AntipatternReportStatusMessage = ptr.String(jtv)
			}

		case "appType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected AppType to be of type string, got %T instead", value)
				}
				sv.AppType = types.AppType(jtv)
			}

		case "appUnitError":
			if err := awsRestjson1_deserializeDocumentAppUnitError(&sv.AppUnitError, value); err != nil {
				return err
			}

		case "associatedServerId":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected ServerId to be of type string, got %T instead", value)
				}
				sv.AssociatedServerId = ptr.String(jtv)
			}

		case "databaseConfigDetail":
			if err := awsRestjson1_deserializeDocumentDatabaseConfigDetail(&sv.DatabaseConfigDetail, value); err != nil {
				return err
			}

		case "id":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
				}
				sv.Id = ptr.String(jtv)
			}

		case "inclusionStatus":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected InclusionStatus to be of type string, got %T instead", value)
				}
				sv.InclusionStatus = types.InclusionStatus(jtv)
			}

		case "lastAnalyzedTimestamp":
			if value != nil {
				switch jtv := value.(type) {
				case json.Number:
					f64, err := jtv.Float64()
					if err != nil {
						return err
					}
					sv.LastAnalyzedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))

				default:
					return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value)

				}
			}

		case "listAntipatternSeveritySummary":
			if err := awsRestjson1_deserializeDocumentListAntipatternSeveritySummary(&sv.ListAntipatternSeveritySummary, value); err != nil {
				return err
			}

		case "moreServerAssociationExists":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
				}
				sv.MoreServerAssociationExists = ptr.Bool(jtv)
			}

		case "name":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
				}
				sv.Name = ptr.String(jtv)
			}

		case "osDriver":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.OsDriver = ptr.String(jtv)
			}

		case "osVersion":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.OsVersion = ptr.String(jtv)
			}

		case "recommendationSet":
			if err := awsRestjson1_deserializeDocumentRecommendationSet(&sv.RecommendationSet, value); err != nil {
				return err
			}

		case "resourceSubType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected ResourceSubType to be of type string, got %T instead", value)
				}
				sv.ResourceSubType = types.ResourceSubType(jtv)
			}

		case "resultList":
			if err := awsRestjson1_deserializeDocumentResultList(&sv.ResultList, value); err != nil {
				return err
			}

		case "runtimeStatus":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected RuntimeAnalysisStatus to be of type string, got %T instead", value)
				}
				sv.RuntimeStatus = types.RuntimeAnalysisStatus(jtv)
			}

		case "runtimeStatusMessage":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value)
				}
				sv.RuntimeStatusMessage = ptr.String(jtv)
			}

		case "sourceCodeRepositories":
			if err := awsRestjson1_deserializeDocumentSourceCodeRepositories(&sv.SourceCodeRepositories, value); err != nil {
				return err
			}

		case "statusMessage":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected StatusMessage to be of type string, got %T instead", value)
				}
				sv.StatusMessage = ptr.String(jtv)
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}