# 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
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class CaseStats(BaseModel):
    """
    Count of each entitiy of a case is mentioned here so that you can calculate the number of requests needs to be done to obtain each entity results completely.
    """ # noqa: E501
    object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = Field(default='CaseStats', description="Name of the object")
    party_count: Optional[StrictInt] = Field(default=None, description="Count of number of parties available in the case being requested for.", alias="partyCount")
    attorney_count: Optional[StrictInt] = Field(default=None, description="Count of number of attornies available in the case being requested for.", alias="attorneyCount")
    judge_count: Optional[StrictInt] = Field(default=None, description="Count of number of judges available in the case being requested for.", alias="judgeCount")
    docket_entry_count: Optional[StrictInt] = Field(default=None, description="Count of number of docket entries available in the case being requested for.", alias="docketEntryCount")
    free_case_document_count: Optional[StrictInt] = Field(default=None, description="Count of number of free documents available in the case being requested for.", alias="freeCaseDocumentCount")
    paid_case_document_count: Optional[StrictInt] = Field(default=None, description="Count of number of paid documents available in the case being requested for.", alias="paidCaseDocumentCount")
    all_case_document_count: Optional[StrictInt] = Field(default=None, description="Count which includes the freeCaseDocumentCount and paidCaseDocumentCount.", alias="allCaseDocumentCount")
    case_document_in_library_count: Optional[StrictInt] = Field(default=None, description="Count of number of documents that are available in the UniCourt CrowdSourced Library for the case being requested for.", alias="caseDocumentInLibraryCount")
    hearing_count: Optional[StrictInt] = Field(default=None, description="Count of number of hearings available in the case being requested for.", alias="hearingCount")
    related_case_count: Optional[StrictInt] = Field(default=None, description="Count of related cases that are available in the case being requested.", alias="relatedCaseCount")
    __properties: ClassVar[List[str]] = ["object", "partyCount", "attorneyCount", "judgeCount", "docketEntryCount", "freeCaseDocumentCount", "paidCaseDocumentCount", "allCaseDocumentCount", "caseDocumentInLibraryCount", "hearingCount", "relatedCaseCount"]

    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 CaseStats 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,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of CaseStats 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 'CaseStats',
            "partyCount": obj.get("partyCount"),
            "attorneyCount": obj.get("attorneyCount"),
            "judgeCount": obj.get("judgeCount"),
            "docketEntryCount": obj.get("docketEntryCount"),
            "freeCaseDocumentCount": obj.get("freeCaseDocumentCount"),
            "paidCaseDocumentCount": obj.get("paidCaseDocumentCount"),
            "allCaseDocumentCount": obj.get("allCaseDocumentCount"),
            "caseDocumentInLibraryCount": obj.get("caseDocumentInLibraryCount"),
            "hearingCount": obj.get("hearingCount"),
            "relatedCaseCount": obj.get("relatedCaseCount")
        })
        return _obj


