# coding: utf-8

"""
    RentCast API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 1.0
    Contact: support@rentcast.io
    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, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python

class RentcastPropertyRecords200ResponseInnerFeatures(BaseModel):
    """
    RentcastPropertyRecords200ResponseInnerFeatures
    """ # noqa: E501
    architecture_type: Optional[StrictStr] = Field(default=None, alias="architectureType")
    cooling: Optional[StrictBool] = False
    cooling_type: Optional[StrictStr] = Field(default=None, alias="coolingType")
    exterior_type: Optional[StrictStr] = Field(default=None, alias="exteriorType")
    fireplace: Optional[StrictBool] = False
    fireplace_type: Optional[StrictStr] = Field(default=None, alias="fireplaceType")
    floor_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="floorCount")
    foundation_type: Optional[StrictStr] = Field(default=None, alias="foundationType")
    garage: Optional[StrictBool] = False
    garage_spaces: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="garageSpaces")
    garage_type: Optional[StrictStr] = Field(default=None, alias="garageType")
    heating: Optional[StrictBool] = False
    heating_type: Optional[StrictStr] = Field(default=None, alias="heatingType")
    pool: Optional[StrictBool] = False
    pool_type: Optional[StrictStr] = Field(default=None, alias="poolType")
    roof_type: Optional[StrictStr] = Field(default=None, alias="roofType")
    room_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="roomCount")
    unit_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="unitCount")
    view_type: Optional[StrictStr] = Field(default=None, alias="viewType")
    additional_properties: Dict[str, Any] = {}
    __properties: ClassVar[List[str]] = ["architectureType", "cooling", "coolingType", "exteriorType", "fireplace", "fireplaceType", "floorCount", "foundationType", "garage", "garageSpaces", "garageType", "heating", "heatingType", "pool", "poolType", "roofType", "roomCount", "unitCount", "viewType"]

    model_config = ConfigDict(
        validate_by_name=True,
        validate_by_alias=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"""
        return json.dumps(to_jsonable_python(self.to_dict()))

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of RentcastPropertyRecords200ResponseInnerFeatures 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.
        * Fields in `self.additional_properties` are added to the output dict.
        """
        excluded_fields: Set[str] = set([
            "additional_properties",
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # puts key-value pairs in additional_properties in the top level
        if self.additional_properties is not None:
            for _key, _value in self.additional_properties.items():
                _dict[_key] = _value

        return _dict

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

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

        _obj = cls.model_validate({
            "architectureType": obj.get("architectureType"),
            "cooling": obj.get("cooling") if obj.get("cooling") is not None else False,
            "coolingType": obj.get("coolingType"),
            "exteriorType": obj.get("exteriorType"),
            "fireplace": obj.get("fireplace") if obj.get("fireplace") is not None else False,
            "fireplaceType": obj.get("fireplaceType"),
            "floorCount": obj.get("floorCount") if obj.get("floorCount") is not None else None,
            "foundationType": obj.get("foundationType"),
            "garage": obj.get("garage") if obj.get("garage") is not None else False,
            "garageSpaces": obj.get("garageSpaces") if obj.get("garageSpaces") is not None else None,
            "garageType": obj.get("garageType"),
            "heating": obj.get("heating") if obj.get("heating") is not None else False,
            "heatingType": obj.get("heatingType"),
            "pool": obj.get("pool") if obj.get("pool") is not None else False,
            "poolType": obj.get("poolType"),
            "roofType": obj.get("roofType"),
            "roomCount": obj.get("roomCount") if obj.get("roomCount") is not None else None,
            "unitCount": obj.get("unitCount") if obj.get("unitCount") is not None else None,
            "viewType": obj.get("viewType")
        })
        # store additional fields in additional_properties
        for _key in obj.keys():
            if _key not in cls.__properties:
                _obj.additional_properties[_key] = obj.get(_key)

        return _obj


