# 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 .haz_mat_haz_mat_chemical_record import HazMatHazMatChemicalRecord


@JsonMap(
    {
        "package_identifier": "PackageIdentifier",
        "q_value": "QValue",
        "over_packed_indicator": "OverPackedIndicator",
        "all_packed_in_one_indicator": "AllPackedInOneIndicator",
        "haz_mat_chemical_record": "HazMatChemicalRecord",
    }
)
class PackageServiceOptionsHazMat(BaseModel):
    """Container to hold HazMat information.  Applies only if SubVersion is greater than or equal to 1701.

    :param package_identifier: Identifies the package containing Dangerous Goods.  Required if SubVersion is greater than or equal to 1701., defaults to None
    :type package_identifier: str, optional
    :param q_value: QValue is required when a HazMat shipment specifies AllPackedInOneIndicator and the regulation set for that shipment is IATA.   Applies only if SubVersion is greater than or equal to 1701. Valid values are : 0.1; 0.2; 0.3; 0.4; 0.5; 0.6; 0.7; 0.8; 0.9; 1.0, defaults to None
    :type q_value: str, optional
    :param over_packed_indicator: Presence/Absence Indicator. Any value is ignored. Presence indicates that shipment is overpack.  Applies only if SubVersion is greater than or equal to 1701., defaults to None
    :type over_packed_indicator: str, optional
    :param all_packed_in_one_indicator: Presence/Absence Indicator. Any value is ignored. Indicates the hazmat shipment/package is all packed in one.  Applies only if SubVersion is greater than or equal to 1701., defaults to None
    :type all_packed_in_one_indicator: str, optional
    :param haz_mat_chemical_record: haz_mat_chemical_record
    :type haz_mat_chemical_record: List[HazMatHazMatChemicalRecord]
    """

    def __init__(
        self,
        haz_mat_chemical_record: List[HazMatHazMatChemicalRecord],
        package_identifier: str = None,
        q_value: str = None,
        over_packed_indicator: str = None,
        all_packed_in_one_indicator: str = None,
    ):
        if package_identifier is not None:
            self.package_identifier = package_identifier
        if q_value is not None:
            self.q_value = q_value
        if over_packed_indicator is not None:
            self.over_packed_indicator = over_packed_indicator
        if all_packed_in_one_indicator is not None:
            self.all_packed_in_one_indicator = all_packed_in_one_indicator
        self.haz_mat_chemical_record = self._define_list(
            haz_mat_chemical_record, HazMatHazMatChemicalRecord
        )
