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

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

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

	for key, value := range shape {
		switch key {
		case "Metric":
			if err := awsRestjson1_deserializeDocumentCurrentMetric(&sv.Metric, value); err!= nil {
				return err
			}

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

				case string:
					var f64 float64
					switch {
					case strings.EqualFold(jtv, "NaN"):
						f64 = math.NaN()

					case strings.EqualFold(jtv, "Infinity"):
						f64 = math.Inf(1)

					case strings.EqualFold(jtv, "-Infinity"):
						f64 = math.Inf(-1)

					default:
						return fmt.Errorf("unknown JSON number value: %s", jtv)

					}
					sv.Value = ptr.Float64(f64)

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

				}
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}

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

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

	var cv []types.CurrentMetricData
	if *v == nil {
		cv = []types.CurrentMetricData{}
	} else {
		cv = *v
	}

	for _, value := range shape {
		var col types.CurrentMetricData
		destAddr := &col
		if err := awsRestjson1_deserializeDocumentCurrentMetricData(&destAddr, value); err!= nil {
			return err
		}
		col = *destAddr
		cv = append(cv, col)

	}
	*v = cv
	return nil
}

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

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

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

	for key, value := range shape {
		switch key {
		case "Collections":
			if err := awsRestjson1_deserializeDocumentCurrentMetricDataCollections(&sv.Collections, value); err!= nil {
				return err
			}

		case "Dimensions":
			if err := awsRestjson1_deserializeDocumentDimensions(&sv.Dimensions, value); err!= nil {
				return err
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}

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

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

	var cv []types.CurrentMetricResult
	if *v == nil {
		cv = []types.CurrentMetricResult{}
	} else {
		cv = *v
	}

	for _, value := range shape {
		var col types.CurrentMetricResult
		destAddr := &col
		if err := awsRestjson1_deserializeDocumentCurrentMetricResult(&destAddr, value); err!= nil {
			return err
		}
		col = *destAddr
		cv = append(cv, col)

	}
	*v = cv
	return nil
}

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

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

	var sv *types.DestinationNotAllowedException
	if *v == nil {
		sv = &types.DestinationNotAllowedException{}
	} 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 Message to be of type string, got %T instead", value)
				}
				sv.Message = ptr.String(jtv)
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}

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

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

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

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

		case "Queue":
			if err := awsRestjson1_deserializeDocumentQueueReference(&sv.Queue, value); err!= nil {
				return err
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}

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

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

	var sv *types.DuplicateResourceException
	if *v == nil {
		sv = &types.DuplicateResourceException{}
	} 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 Message to be of type string, got %T instead", value)
				}
				sv.Message = ptr.String(jtv)
			}

		default:
			_,