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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .commodity_nmfc import CommodityNmfc


@JsonMap({"freight_class": "FreightClass", "nmfc": "NMFC"})
class PackageCommodity(BaseModel):
    """Commodity Container.  Required only for GFP rating when FRSShipmentIndicator is requested.

    :param freight_class: Freight Classification. Freight class partially determines the freight rate for the article.  See Appendix of the Rating Ground Freight Web Services Developers Guide for list of Freight classes. For GFP Only.
    :type freight_class: str
    :param nmfc: NMFC Commodity container.  For GFP Only., defaults to None
    :type nmfc: CommodityNmfc, optional
    """

    def __init__(self, freight_class: str, nmfc: CommodityNmfc = None):
        self.freight_class = freight_class
        if nmfc is not None:
            self.nmfc = self._define_object(nmfc, CommodityNmfc)
