# coding: utf-8

"""
    UniCourt Enterprise APIs

    <button><a href=\"/developers/enterpriseapi/api/download/UniCourt-Enterprise-API-Spec.yaml\" >Download UniCourt Enterprise APIs Specification</a></button> 

    The version of the OpenAPI document: 
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class PACERCaseSearchContent(BaseModel):
    """
    PACERCaseSearchContent
    """ # noqa: E501
    object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = Field(default='PACERCaseSearchContent', description="Name of the object")
    pcl_case_link: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to case in the case management/electronic case files (CM/ECF) system at the court.", alias="pclCaseLink")
    pcl_jurisdiction_type: Optional[StrictStr] = Field(default=None, description="Link to case in the case management/electronic case files (CM/ECF) system at the court.", alias="pclJurisdictionType")
    pcl_case_id: Optional[StrictInt] = Field(default=None, description="Sequentially generated number that identifies the case.", alias="pclCaseId")
    pcl_case_number_full: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="Case Number.", alias="pclCaseNumberFull")
    pcl_case_title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Title of the case.", alias="pclCaseTitle")
    pcl_case_office: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, description="The divisional office in which the case was filed.", alias="pclCaseOffice")
    pcl_case_number: Optional[StrictInt] = Field(default=None, description="The sequence number of the case.", alias="pclCaseNumber")
    pcl_case_type: Optional[Annotated[str, Field(strict=True, max_length=6)]] = Field(default=None, description="Code that identifies the type of case.", alias="pclCaseType")
    pcl_case_year: Optional[StrictInt] = Field(default=None, description="The year in which the case falls. Could be two or four digit.", alias="pclCaseYear")
    pcl_court_id: Optional[Annotated[str, Field(strict=True, max_length=6)]] = Field(default=None, description="The general geographical region or specific court district. The court ID is the abbreviation of the court location combined with the court type (dc or bk). Please refer the Appendix B", alias="pclCourtId")
    pcl_date_filed: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="Filing date of the case.", alias="pclDateFiled")
    pcl_jpml_number: Optional[StrictInt] = Field(default=None, description="JPML Case Seed number.", alias="pclJpmlNumber")
    pcl_mdl_court_id: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="Which court does this mdl belongs too.", alias="pclMdlCourtId")
    pcl_mdl_date_ordered: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the mdl date ordered of the case when it is present", alias="pclMdlDateOrdered")
    pcl_mdl_date_received: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the mdl date received of the case when it is present", alias="pclMdlDateReceived")
    pcl_mdl_extension: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl extension of the case when it is present", alias="pclMdlExtension")
    pcl_mdl_judge_last_name: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl judge lastname of the case when it is present", alias="pclMdlJudgeLastName")
    pcl_mdl_littype: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl lit type of the case when it is present", alias="pclMdlLittype")
    pcl_mdl_status: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl status of the case when it is present", alias="pclMdlStatus")
    pcl_mdl_transferee: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl transferee of the case when it is present", alias="pclMdlTransferee")
    pcl_mdl_transferee_district: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl transferee district of the case when it is present", alias="pclMdlTransfereeDistrict")
    pcl_civil_cto_number: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil cto number of the case when it is present", alias="pclCivilCtoNumber")
    pcl_civil_date_disposition: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the civil disposition date of the case when it is present", alias="pclCivilDateDisposition")
    pcl_civil_date_initiated: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the civil initiated date of the case when it is present", alias="pclCivilDateInitiated")
    pcl_civil_date_terminated: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the civil terminated date of the case when it is present", alias="pclCivilDateTerminated")
    pcl_civil_stat_disposition: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil stat disposition of the case when it is present", alias="pclCivilStatDisposition")
    pcl_civil_stat_initiated: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil stat initiated of the case when it is present", alias="pclCivilStatInitiated")
    pcl_civil_stat_terminated: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil stat terminated of the case when it is present", alias="pclCivilStatTerminated")
    pcl_civil_transferee: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil transferee of the case when it is present", alias="pclCivilTransferee")
    pcl_bankruptcy_chapter: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the bankruptcy chapter of the case when it is present", alias="pclBankruptcyChapter")
    pcl_date_discharged: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date discharged of the case when it is present", alias="pclDateDischarged")
    pcl_date_dismissed: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date dismissed of the case when it is present", alias="pclDateDismissed")
    pcl_date_reopened: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date reopened of the case when it is present", alias="pclDateReopened")
    pcl_date_termed: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date termed of the case when it is present", alias="pclDateTermed")
    pcl_disposition: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="This parameter represents the disposition of the case when it is present", alias="pclDisposition")
    pcl_disposition_method: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="This parameter represents the disposition method of the case when it is present", alias="pclDispositionMethod")
    pcl_joint_bankruptcy_flag: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the joint bankruptcy flag of the case when it is present", alias="pclJointBankruptcyFlag")
    pcl_joint_discharged_date: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the joint discharged date of the case when it is present", alias="pclJointDischargedDate")
    pcl_joint_dismissed_date: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the joint dismissed date of the case when it is present", alias="pclJointDismissedDate")
    pcl_joint_disposition_method: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="This parameter represents the joint disposition method of the case when it is present", alias="pclJointDispositionMethod")
    pcl_nature_of_suit: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the nature of suit of the case when it is present", alias="pclNatureOfSuit")
    __properties: ClassVar[List[str]] = ["object", "pclCaseLink", "pclJurisdictionType", "pclCaseId", "pclCaseNumberFull", "pclCaseTitle", "pclCaseOffice", "pclCaseNumber", "pclCaseType", "pclCaseYear", "pclCourtId", "pclDateFiled", "pclJpmlNumber", "pclMdlCourtId", "pclMdlDateOrdered", "pclMdlDateReceived", "pclMdlExtension", "pclMdlJudgeLastName", "pclMdlLittype", "pclMdlStatus", "pclMdlTransferee", "pclMdlTransfereeDistrict", "pclCivilCtoNumber", "pclCivilDateDisposition", "pclCivilDateInitiated", "pclCivilDateTerminated", "pclCivilStatDisposition", "pclCivilStatInitiated", "pclCivilStatTerminated", "pclCivilTransferee", "pclBankruptcyChapter", "pclDateDischarged", "pclDateDismissed", "pclDateReopened", "pclDateTermed", "pclDisposition", "pclDispositionMethod", "pclJointBankruptcyFlag", "pclJointDischargedDate", "pclJointDismissedDate", "pclJointDispositionMethod", "pclNatureOfSuit"]

    @field_validator('pcl_jurisdiction_type')
    def pcl_jurisdiction_type_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['Appellate', 'Bankruptcy', 'Criminal', 'Civil', 'Multi-district Litigation', 'null']):
            raise ValueError("must be one of enum values ('Appellate', 'Bankruptcy', 'Criminal', 'Civil', 'Multi-district Litigation', 'null')")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of PACERCaseSearchContent from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # set to None if pcl_case_link (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_case_link is None and "pcl_case_link" in self.model_fields_set:
            _dict['pclCaseLink'] = None

        # set to None if pcl_jurisdiction_type (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_jurisdiction_type is None and "pcl_jurisdiction_type" in self.model_fields_set:
            _dict['pclJurisdictionType'] = None

        # set to None if pcl_case_number_full (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_case_number_full is None and "pcl_case_number_full" in self.model_fields_set:
            _dict['pclCaseNumberFull'] = None

        # set to None if pcl_case_title (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_case_title is None and "pcl_case_title" in self.model_fields_set:
            _dict['pclCaseTitle'] = None

        # set to None if pcl_case_office (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_case_office is None and "pcl_case_office" in self.model_fields_set:
            _dict['pclCaseOffice'] = None

        # set to None if pcl_case_type (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_case_type is None and "pcl_case_type" in self.model_fields_set:
            _dict['pclCaseType'] = None

        # set to None if pcl_court_id (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_court_id is None and "pcl_court_id" in self.model_fields_set:
            _dict['pclCourtId'] = None

        # set to None if pcl_date_filed (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_date_filed is None and "pcl_date_filed" in self.model_fields_set:
            _dict['pclDateFiled'] = None

        # set to None if pcl_jpml_number (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_jpml_number is None and "pcl_jpml_number" in self.model_fields_set:
            _dict['pclJpmlNumber'] = None

        # set to None if pcl_mdl_court_id (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_court_id is None and "pcl_mdl_court_id" in self.model_fields_set:
            _dict['pclMdlCourtId'] = None

        # set to None if pcl_mdl_date_ordered (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_date_ordered is None and "pcl_mdl_date_ordered" in self.model_fields_set:
            _dict['pclMdlDateOrdered'] = None

        # set to None if pcl_mdl_date_received (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_date_received is None and "pcl_mdl_date_received" in self.model_fields_set:
            _dict['pclMdlDateReceived'] = None

        # set to None if pcl_mdl_extension (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_extension is None and "pcl_mdl_extension" in self.model_fields_set:
            _dict['pclMdlExtension'] = None

        # set to None if pcl_mdl_judge_last_name (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_judge_last_name is None and "pcl_mdl_judge_last_name" in self.model_fields_set:
            _dict['pclMdlJudgeLastName'] = None

        # set to None if pcl_mdl_littype (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_littype is None and "pcl_mdl_littype" in self.model_fields_set:
            _dict['pclMdlLittype'] = None

        # set to None if pcl_mdl_status (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_status is None and "pcl_mdl_status" in self.model_fields_set:
            _dict['pclMdlStatus'] = None

        # set to None if pcl_mdl_transferee (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_transferee is None and "pcl_mdl_transferee" in self.model_fields_set:
            _dict['pclMdlTransferee'] = None

        # set to None if pcl_mdl_transferee_district (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_mdl_transferee_district is None and "pcl_mdl_transferee_district" in self.model_fields_set:
            _dict['pclMdlTransfereeDistrict'] = None

        # set to None if pcl_civil_cto_number (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_cto_number is None and "pcl_civil_cto_number" in self.model_fields_set:
            _dict['pclCivilCtoNumber'] = None

        # set to None if pcl_civil_date_disposition (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_date_disposition is None and "pcl_civil_date_disposition" in self.model_fields_set:
            _dict['pclCivilDateDisposition'] = None

        # set to None if pcl_civil_date_initiated (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_date_initiated is None and "pcl_civil_date_initiated" in self.model_fields_set:
            _dict['pclCivilDateInitiated'] = None

        # set to None if pcl_civil_date_terminated (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_date_terminated is None and "pcl_civil_date_terminated" in self.model_fields_set:
            _dict['pclCivilDateTerminated'] = None

        # set to None if pcl_civil_stat_disposition (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_stat_disposition is None and "pcl_civil_stat_disposition" in self.model_fields_set:
            _dict['pclCivilStatDisposition'] = None

        # set to None if pcl_civil_stat_initiated (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_stat_initiated is None and "pcl_civil_stat_initiated" in self.model_fields_set:
            _dict['pclCivilStatInitiated'] = None

        # set to None if pcl_civil_stat_terminated (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_stat_terminated is None and "pcl_civil_stat_terminated" in self.model_fields_set:
            _dict['pclCivilStatTerminated'] = None

        # set to None if pcl_civil_transferee (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_civil_transferee is None and "pcl_civil_transferee" in self.model_fields_set:
            _dict['pclCivilTransferee'] = None

        # set to None if pcl_bankruptcy_chapter (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_bankruptcy_chapter is None and "pcl_bankruptcy_chapter" in self.model_fields_set:
            _dict['pclBankruptcyChapter'] = None

        # set to None if pcl_date_discharged (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_date_discharged is None and "pcl_date_discharged" in self.model_fields_set:
            _dict['pclDateDischarged'] = None

        # set to None if pcl_date_dismissed (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_date_dismissed is None and "pcl_date_dismissed" in self.model_fields_set:
            _dict['pclDateDismissed'] = None

        # set to None if pcl_date_reopened (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_date_reopened is None and "pcl_date_reopened" in self.model_fields_set:
            _dict['pclDateReopened'] = None

        # set to None if pcl_date_termed (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_date_termed is None and "pcl_date_termed" in self.model_fields_set:
            _dict['pclDateTermed'] = None

        # set to None if pcl_disposition (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_disposition is None and "pcl_disposition" in self.model_fields_set:
            _dict['pclDisposition'] = None

        # set to None if pcl_disposition_method (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_disposition_method is None and "pcl_disposition_method" in self.model_fields_set:
            _dict['pclDispositionMethod'] = None

        # set to None if pcl_joint_bankruptcy_flag (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_joint_bankruptcy_flag is None and "pcl_joint_bankruptcy_flag" in self.model_fields_set:
            _dict['pclJointBankruptcyFlag'] = None

        # set to None if pcl_joint_discharged_date (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_joint_discharged_date is None and "pcl_joint_discharged_date" in self.model_fields_set:
            _dict['pclJointDischargedDate'] = None

        # set to None if pcl_joint_dismissed_date (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_joint_dismissed_date is None and "pcl_joint_dismissed_date" in self.model_fields_set:
            _dict['pclJointDismissedDate'] = None

        # set to None if pcl_joint_disposition_method (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_joint_disposition_method is None and "pcl_joint_disposition_method" in self.model_fields_set:
            _dict['pclJointDispositionMethod'] = None

        # set to None if pcl_nature_of_suit (nullable) is None
        # and model_fields_set contains the field
        if self.pcl_nature_of_suit is None and "pcl_nature_of_suit" in self.model_fields_set:
            _dict['pclNatureOfSuit'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of PACERCaseSearchContent from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "object": obj.get("object") if obj.get("object") is not None else 'PACERCaseSearchContent',
            "pclCaseLink": obj.get("pclCaseLink"),
            "pclJurisdictionType": obj.get("pclJurisdictionType"),
            "pclCaseId": obj.get("pclCaseId"),
            "pclCaseNumberFull": obj.get("pclCaseNumberFull"),
            "pclCaseTitle": obj.get("pclCaseTitle"),
            "pclCaseOffice": obj.get("pclCaseOffice"),
            "pclCaseNumber": obj.get("pclCaseNumber"),
            "pclCaseType": obj.get("pclCaseType"),
            "pclCaseYear": obj.get("pclCaseYear"),
            "pclCourtId": obj.get("pclCourtId"),
            "pclDateFiled": obj.get("pclDateFiled"),
            "pclJpmlNumber": obj.get("pclJpmlNumber"),
            "pclMdlCourtId": obj.get("pclMdlCourtId"),
            "pclMdlDateOrdered": obj.get("pclMdlDateOrdered"),
            "pclMdlDateReceived": obj.get("pclMdlDateReceived"),
            "pclMdlExtension": obj.get("pclMdlExtension"),
            "pclMdlJudgeLastName": obj.get("pclMdlJudgeLastName"),
            "pclMdlLittype": obj.get("pclMdlLittype"),
            "pclMdlStatus": obj.get("pclMdlStatus"),
            "pclMdlTransferee": obj.get("pclMdlTransferee"),
            "pclMdlTransfereeDistrict": obj.get("pclMdlTransfereeDistrict"),
            "pclCivilCtoNumber": obj.get("pclCivilCtoNumber"),
            "pclCivilDateDisposition": obj.get("pclCivilDateDisposition"),
            "pclCivilDateInitiated": obj.get("pclCivilDateInitiated"),
            "pclCivilDateTerminated": obj.get("pclCivilDateTerminated"),
            "pclCivilStatDisposition": obj.get("pclCivilStatDisposition"),
            "pclCivilStatInitiated": obj.get("pclCivilStatInitiated"),
            "pclCivilStatTerminated": obj.get("pclCivilStatTerminated"),
            "pclCivilTransferee": obj.get("pclCivilTransferee"),
            "pclBankruptcyChapter": obj.get("pclBankruptcyChapter"),
            "pclDateDischarged": obj.get("pclDateDischarged"),
            "pclDateDismissed": obj.get("pclDateDismissed"),
            "pclDateReopened": obj.get("pclDateReopened"),
            "pclDateTermed": obj.get("pclDateTermed"),
            "pclDisposition": obj.get("pclDisposition"),
            "pclDispositionMethod": obj.get("pclDispositionMethod"),
            "pclJointBankruptcyFlag": obj.get("pclJointBankruptcyFlag"),
            "pclJointDischargedDate": obj.get("pclJointDischargedDate"),
            "pclJointDismissedDate": obj.get("pclJointDismissedDate"),
            "pclJointDispositionMethod": obj.get("pclJointDispositionMethod"),
            "pclNatureOfSuit": obj.get("pclNatureOfSuit")
        })
        return _obj


