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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .package_weight_unit_of_measurement import PackageWeightUnitOfMeasurement


@JsonMap({"unit_of_measurement": "UnitOfMeasurement", "weight": "Weight"})
class PackagePackageWeight(BaseModel):
    """Package Weight Container.  Required for an GFP Rating request. Otherwise optional. Required for Heavy Goods service.  Package Weight will be ignored for Simple Rate

    :param unit_of_measurement: UnitOfMeasurement Container.
    :type unit_of_measurement: PackageWeightUnitOfMeasurement
    :param weight: Actual package weight.  Weight accepted for letters/envelopes.
    :type weight: str
    """

    def __init__(
        self, unit_of_measurement: PackageWeightUnitOfMeasurement, weight: str
    ):
        self.unit_of_measurement = self._define_object(
            unit_of_measurement, PackageWeightUnitOfMeasurement
        )
        self.weight = weight
