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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .dim_weight_unit_of_measurement import DimWeightUnitOfMeasurement


@JsonMap({"unit_of_measurement": "UnitOfMeasurement", "weight": "Weight"})
class PackageDimWeight(BaseModel):
    """Package Dimensional Weight container. Values in this container are ignored when package dimensions are provided. Please visit ups.com for instructions on calculating this value.  Only used for non-US/CA/PR shipments.

    :param unit_of_measurement: UnitOfMeasurement Container., defaults to None
    :type unit_of_measurement: DimWeightUnitOfMeasurement, optional
    :param weight: Dimensional weight of the package. Decimal values are not accepted, however there is one implied decimal place for values in this field (i.e. 115 = 11.5)., defaults to None
    :type weight: str, optional
    """

    def __init__(
        self, unit_of_measurement: DimWeightUnitOfMeasurement = None, weight: str = None
    ):
        if unit_of_measurement is not None:
            self.unit_of_measurement = self._define_object(
                unit_of_measurement, DimWeightUnitOfMeasurement
            )
        if weight is not None:
            self.weight = weight
