# This file was generated by liblab | https://liblab.com/

from __future__ import annotations
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .freight_density_info_adjusted_height import FreightDensityInfoAdjustedHeight
from .freight_density_info_handling_units import FreightDensityInfoHandlingUnits


@JsonMap(
    {
        "adjusted_height_indicator": "AdjustedHeightIndicator",
        "adjusted_height": "AdjustedHeight",
        "handling_units": "HandlingUnits",
    }
)
class FreightShipmentInformationFreightDensityInfo(BaseModel):
    """Freight Density Info container.  Required if DensityEligibleIndicator is present.

    :param adjusted_height_indicator: The presence of the AdjustedHeightIndicator allows UPS to do height reduction adjustment for density based rate request., defaults to None
    :type adjusted_height_indicator: str, optional
    :param adjusted_height: Container to hold Adjusted Height information.  Required if AdjustedHeightIndicator is present., defaults to None
    :type adjusted_height: FreightDensityInfoAdjustedHeight, optional
    :param handling_units: handling_units
    :type handling_units: List[FreightDensityInfoHandlingUnits]
    """

    def __init__(
        self,
        handling_units: List[FreightDensityInfoHandlingUnits],
        adjusted_height_indicator: str = None,
        adjusted_height: FreightDensityInfoAdjustedHeight = None,
    ):
        if adjusted_height_indicator is not None:
            self.adjusted_height_indicator = adjusted_height_indicator
        if adjusted_height is not None:
            self.adjusted_height = self._define_object(
                adjusted_height, FreightDensityInfoAdjustedHeight
            )
        self.handling_units = self._define_list(
            handling_units, FreightDensityInfoHandlingUnits
        )
