# coding: utf-8

"""
    Acre Platform User API

    # CORS CORS is implemented by all Acre API endpoints and only certain hostnames are allowed for each deployment of the API. If your use case requires calling the Acre User API from a browser, please contact Acre to arrange the appropriate configuration. # API Authentication The primary method of authentication for users of the Acre API is with the use of JSON Web Tokens (JWTs), which are suplemented by an application specific API Key. The API key must be provided through the `X-API-KEY` HTTP header and will be provided by your Acre Customer Success Manager. The JWT must be provided through a cookie with key of `authorization`. The JWT must be generated and signed as per the following section. # Generating JWTs JWT must either be generated by a third-party such as Azure ADB2C that has been configured for the appropriate service and/or user account, or alternatively can be generated locally and signed by an private key for which the public key has been made available to Acre via a JWKS URL. In addition to being signed by your private key, the JWT will also need to contain at a minimum:  * An issuer `iss`, which must be a valid URI previously agreed with Acre.  * A subject `sub`, which must be a unique identifier for the user and/or service account previously agreed with Acre.  * An expiry time `exp` which must not be more than four hours in the future.  * A not before time `nbf` which must be in the past, but not greater than six hours in the past.  The JWT should be signed using RS256.

    The version of the OpenAPI document: 1.0
    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, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from acre_api.models.cdm_address import CdmAddress
from acre_api.models.cdm_occupant import CdmOccupant
from acre_api.models.cdm_property_details_property_tenure import CdmPropertyDetailsPropertyTenure
from acre_api.models.cdm_property_details_property_type import CdmPropertyDetailsPropertyType
from acre_api.models.property_details_builder_registration_scheme import PropertyDetailsBuilderRegistrationScheme
from acre_api.models.property_details_energy_rating import PropertyDetailsEnergyRating
from acre_api.models.property_details_property_location import PropertyDetailsPropertyLocation
from acre_api.models.property_details_property_parking import PropertyDetailsPropertyParking
from acre_api.models.property_details_property_sub_type import PropertyDetailsPropertySubType
from acre_api.models.property_details_property_use import PropertyDetailsPropertyUse
from acre_api.models.property_details_property_valuation_source import PropertyDetailsPropertyValuationSource
from acre_api.models.property_details_property_work import PropertyDetailsPropertyWork
from acre_api.models.property_details_roof_type import PropertyDetailsRoofType
from acre_api.models.property_details_shared_ownership_type import PropertyDetailsSharedOwnershipType
from acre_api.models.property_details_wall_type import PropertyDetailsWallType
from typing import Optional, Set
from typing_extensions import Self

class CdmPropertyDetails(BaseModel):
    """
    CdmPropertyDetails
    """ # noqa: E501
    property_id: Optional[StrictStr] = Field(default=None, description="Automatically populated; cannot be set.")
    occupants: Optional[List[CdmOccupant]] = None
    registered_owners_details: Optional[List[StrictStr]] = Field(default=None, description="Who will be the legal owners of the property (list of client IDs).")
    property_location: Optional[PropertyDetailsPropertyLocation] = PropertyDetailsPropertyLocation.INVALID_PROPERTY_LOCATION
    wall_type: Optional[PropertyDetailsWallType] = PropertyDetailsWallType.INVALID_WALL_TYPE
    roof_type: Optional[PropertyDetailsRoofType] = PropertyDetailsRoofType.INVALID_ROOF_TYPE
    year_property_built: Optional[StrictInt] = Field(default=None, description="The year that the property was built.")
    property_price: Optional[StrictStr] = Field(default=None, description="The property price (in pence, not GBP).")
    property_valuation: Optional[StrictStr] = Field(default=None, description="The property value (in pence, not GBP).")
    property_valuation_date: Optional[StrictStr] = Field(default=None, description="Date when the valuation was conducted (YYYY-MM-DD).")
    property_valuation_source: Optional[PropertyDetailsPropertyValuationSource] = PropertyDetailsPropertyValuationSource.INVALID_PROPERTY_VALUATION_SOURCE
    right_to_buy_valuation: Optional[StrictStr] = Field(default=None, description="The right to buy valuation (in pence, not GBP).")
    is_private_sale: Optional[StrictBool] = Field(default=None, description="Indicates whether the sale is private.")
    purchasing_as_sitting_tenant: Optional[StrictBool] = Field(default=None, description="Indicates whether the applicants are purchasing as sitting tenants.")
    is_new_build: Optional[StrictBool] = Field(default=None, description="Flag indicating whether this property is a new build.")
    property_builder_name: Optional[StrictStr] = Field(default=None, description="The property builder's name.")
    builder_registration_scheme: Optional[PropertyDetailsBuilderRegistrationScheme] = PropertyDetailsBuilderRegistrationScheme.INVALID_BUILDER_REGISTRATION_SCHEME
    new_build_discounts_or_incentives_description: Optional[StrictStr] = Field(default=None, description="Additional details on any new build discounts or incentives.")
    new_build_discounts_or_incentives_value: Optional[StrictStr] = Field(default=None, description="The monetary value in pence of any discounts of incentives received from the developer of a new build property.")
    num_flats_in_block: Optional[StrictInt] = Field(default=None, description="The number of flats in the block.")
    num_floors_in_block: Optional[StrictInt] = Field(default=None, description="The number of floors in the block.")
    floor_of_flat: Optional[StrictInt] = Field(default=None, description="The floor of the flat.")
    does_the_property_have_a_lift: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property has a lift.")
    does_the_property_have_deck_access: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property has deck access.")
    is_property_over_retail: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property is over retail.")
    clear_floor_between_retail: Optional[StrictBool] = Field(default=None, description="Flag indicating if there is a clear floor between the flat and retail store.")
    property_converted_in_last_ten_years: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property has been converted in the last 10 years.")
    intend_to_let_or_run_business: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the applicants intend to let or run a business from the property.")
    intend_to_let_or_run_business_description: Optional[StrictStr] = Field(default=None, description="Additional details on letting or running a business from the property.")
    percent_of_property_used_for_residential: Optional[StrictInt] = Field(default=None, description="The percentage of the property that will be used for residential purposes, represented as 1/100000 of a percent (precision for up to 5 decimal places).")
    remaining_percent_property_use_description: Optional[StrictStr] = Field(default=None, description="Additional details on what the remaining percentage of the property will be used for.")
    freehold_percent_floor_area: Optional[StrictInt] = Field(default=None, description="Freehold percentage of floor area, represented as 1/100000 of a percent (precision for up to 5 decimal places).")
    is_single_dwelling: Optional[StrictBool] = Field(default=None, description="Whether the property is a single dwelling.")
    is_designated_defective: Optional[StrictBool] = Field(default=None, description="Whether the property is designated defective.")
    is_near_environmental_hazards: Optional[StrictBool] = Field(default=None, description="Whether the property is near environmental hazards.")
    years_left_on_lease: Optional[StrictInt] = Field(default=None, description="The number of years left on lease.")
    leasehold_ground_rent: Optional[StrictStr] = Field(default=None, description="The ground rent amount on the lease (in pence, not GBP).")
    leasehold_service_charge: Optional[StrictStr] = Field(default=None, description="The service charge amount on the lease (in pence, not GBP).")
    solar_panels_on_property: Optional[StrictBool] = Field(default=None, description="Indicates whether solar panels are installed on the property.")
    solar_panels_equipment_in_use: Optional[StrictBool] = Field(default=None, description="Indicates whether solar panels are in use.")
    roof_subject_to_lease: Optional[StrictBool] = Field(default=None, description="Indicates whether the roof is subject to a lease.")
    is_property_currently_rented: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property is currently rented.")
    address: Optional[CdmAddress] = None
    property_type: Optional[CdmPropertyDetailsPropertyType] = CdmPropertyDetailsPropertyType.INVALID_PROPERTY_TYPE
    property_tenure: Optional[CdmPropertyDetailsPropertyTenure] = CdmPropertyDetailsPropertyTenure.INVALID_PROPERTY_TENURE
    property_use: Optional[PropertyDetailsPropertyUse] = PropertyDetailsPropertyUse.INVALID_PROPERTY_USE
    flying_freehold_percentage: Optional[StrictInt] = Field(default=None, description="The percentage of the property that is flying freehold, represented as 1/100000 of a percent (precision for up to 5 decimal places).")
    is_property_ex_local_authority: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property is ex-local authority.")
    is_studio: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property is a studio flat.")
    is_bedsit: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property is a bedsit.")
    is_house_of_multiple_occupancy: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the house is multiple occupancy.")
    is_property_furnished: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the property is furnished.")
    number_of_bedrooms: Optional[StrictInt] = Field(default=None, description="The number of bedrooms on the property.")
    right_to_buy_purchase: Optional[StrictBool] = Field(default=None, description="Flag identifying whether this property is purchased under the right to buy scheme.")
    is_shared_ownership: Optional[StrictBool] = Field(default=None, description="Whether the property is owned/purchased under a SharedOwnership scheme.")
    shared_ownership_share: Optional[StrictInt] = Field(default=None, description="Percentage of property owned, represented as 1/100000 of a percent (precision for up to 5 decimal places).")
    shared_ownership_monthly_rent: Optional[StrictStr] = Field(default=None, description="Monthly rental payment for unowned share (in pence, not GBP).")
    shared_equity_monthly_interest: Optional[StrictStr] = Field(default=None, description="The amount of interest paid each month on the part of the property financed by the shared equity provider.")
    help_to_buy_loan_amount: Optional[StrictStr] = Field(default=None, description="The amount being borrowed by the client against the Government Help To Buy Scheme (in pence, not GBP).")
    monthly_rental_income: Optional[StrictStr] = Field(default=None, description="Monthly rental income from this property (in pence, not GBP).")
    shared_ownership_scheme_provider: Optional[StrictStr] = Field(default=None, description="The shared ownership scheme provider.")
    shared_ownership_type: Optional[PropertyDetailsSharedOwnershipType] = PropertyDetailsSharedOwnershipType.INVALID_SHARED_OWNERSHIP_TYPE
    monthly_management_expenses: Optional[StrictStr] = Field(default=None, description="Monthly management expenses for the property, if BTL (in pence, not GBP).")
    modified_at: Optional[StrictStr] = Field(default=None, description="The datetime that the property was last modified (RFC3339).")
    shared_equity_repayment_details: Optional[StrictStr] = Field(default=None, description="Repayment term and circumstances for Shared Equity Loan.")
    property_parking: Optional[PropertyDetailsPropertyParking] = PropertyDetailsPropertyParking.INVALID_PROPERTY_PARKING
    sub_type: Optional[PropertyDetailsPropertySubType] = PropertyDetailsPropertySubType.INVALID_SUBTYPE
    is_property_habitable: Optional[StrictBool] = Field(default=None, description="Details if the property is habitable.")
    work_planned_on_property: Optional[PropertyDetailsPropertyWork] = PropertyDetailsPropertyWork.INVALID_WORK
    is_unencumbered: Optional[StrictBool] = None
    acre_property_id: Optional[StrictStr] = None
    btl_has_lived: Optional[StrictBool] = Field(default=None, description="Has the client or a relative previously lived at the property.")
    btl_will_lived: Optional[StrictBool] = None
    btl_is_operating_a_business: Optional[StrictBool] = Field(default=None, description="Will the client or a relative be operating a business at the property.")
    is_multi_unit_freehold_block: Optional[StrictBool] = Field(default=None, description="Is property a Multi Unit Freehold Block.")
    gross_development_value: Optional[StrictStr] = Field(default=None, description="Estimated value of property on completion of works (in pence, not GBP).")
    cost_of_works: Optional[StrictStr] = Field(default=None, description="Cost for proposed works to property (in pence, not GBP).")
    number_of_lettable_rooms: Optional[StrictStr] = Field(default=None, description="Number of separately lettable rooms within the property.")
    is_work_planned_on_property: Optional[StrictBool] = Field(default=None, description="Are any works planned on the property.")
    number_of_kitchens: Optional[StrictStr] = Field(default=None, description="Number of Kitchens within the property.")
    number_of_reception_rooms: Optional[StrictStr] = Field(default=None, description="Number of reception rooms within the property.")
    number_of_bathrooms: Optional[StrictStr] = Field(default=None, description="Number of bathrooms within the property.")
    has_annex: Optional[StrictBool] = Field(default=None, description="Does property have an Annex.")
    current_energy_rating: Optional[PropertyDetailsEnergyRating] = PropertyDetailsEnergyRating.INVALID_ENERGY_RATING
    potential_energy_rating: Optional[PropertyDetailsEnergyRating] = PropertyDetailsEnergyRating.INVALID_ENERGY_RATING
    current_environment_impact: Optional[StrictStr] = Field(default=None, description="The Environmental Impact Rating. A measure of the property's current impact on the environment in terms of carbon dioxide (CO₂) emissions. The higher the rating the lower the CO₂ emissions (CO₂ emissions in tonnes / year).")
    potential_environment_impact: Optional[StrictStr] = Field(default=None, description="The potential Environmental Impact Rating. A measure of the property's potential impact on the environment in terms of carbon dioxide (CO₂) emissions after improvements have been carried out. The higher the rating the lower the CO₂ emissions (CO₂ emissions in tonnes / year).")
    target_registered_owners_details: Optional[List[StrictStr]] = Field(default=None, description="The prospective legal owners of the property (list of client IDs).")
    purchase_date: Optional[StrictStr] = Field(default=None, description="The date the property was purchased (YYYY-MM-DD).")
    specified_rebuild_cost: Optional[StrictInt] = Field(default=None, description="Specified rebuild cost (in pence, not GBP).")
    __properties: ClassVar[List[str]] = ["property_id", "occupants", "registered_owners_details", "property_location", "wall_type", "roof_type", "year_property_built", "property_price", "property_valuation", "property_valuation_date", "property_valuation_source", "right_to_buy_valuation", "is_private_sale", "purchasing_as_sitting_tenant", "is_new_build", "property_builder_name", "builder_registration_scheme", "new_build_discounts_or_incentives_description", "new_build_discounts_or_incentives_value", "num_flats_in_block", "num_floors_in_block", "floor_of_flat", "does_the_property_have_a_lift", "does_the_property_have_deck_access", "is_property_over_retail", "clear_floor_between_retail", "property_converted_in_last_ten_years", "intend_to_let_or_run_business", "intend_to_let_or_run_business_description", "percent_of_property_used_for_residential", "remaining_percent_property_use_description", "freehold_percent_floor_area", "is_single_dwelling", "is_designated_defective", "is_near_environmental_hazards", "years_left_on_lease", "leasehold_ground_rent", "leasehold_service_charge", "solar_panels_on_property", "solar_panels_equipment_in_use", "roof_subject_to_lease", "is_property_currently_rented", "address", "property_type", "property_tenure", "property_use", "flying_freehold_percentage", "is_property_ex_local_authority", "is_studio", "is_bedsit", "is_house_of_multiple_occupancy", "is_property_furnished", "number_of_bedrooms", "right_to_buy_purchase", "is_shared_ownership", "shared_ownership_share", "shared_ownership_monthly_rent", "shared_equity_monthly_interest", "help_to_buy_loan_amount", "monthly_rental_income", "shared_ownership_scheme_provider", "shared_ownership_type", "monthly_management_expenses", "modified_at", "shared_equity_repayment_details", "property_parking", "sub_type", "is_property_habitable", "work_planned_on_property", "is_unencumbered", "acre_property_id", "btl_has_lived", "btl_will_lived", "btl_is_operating_a_business", "is_multi_unit_freehold_block", "gross_development_value", "cost_of_works", "number_of_lettable_rooms", "is_work_planned_on_property", "number_of_kitchens", "number_of_reception_rooms", "number_of_bathrooms", "has_annex", "current_energy_rating", "potential_energy_rating", "current_environment_impact", "potential_environment_impact", "target_registered_owners_details", "purchase_date", "specified_rebuild_cost"]

    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 CdmPropertyDetails 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,
        )
        # override the default output from pydantic by calling `to_dict()` of each item in occupants (list)
        _items = []
        if self.occupants:
            for _item_occupants in self.occupants:
                if _item_occupants:
                    _items.append(_item_occupants.to_dict())
            _dict['occupants'] = _items
        # override the default output from pydantic by calling `to_dict()` of address
        if self.address:
            _dict['address'] = self.address.to_dict()
        return _dict

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

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

        _obj = cls.model_validate({
            "property_id": obj.get("property_id"),
            "occupants": [CdmOccupant.from_dict(_item) for _item in obj["occupants"]] if obj.get("occupants") is not None else None,
            "registered_owners_details": obj.get("registered_owners_details"),
            "property_location": obj.get("property_location") if obj.get("property_location") is not None else PropertyDetailsPropertyLocation.INVALID_PROPERTY_LOCATION,
            "wall_type": obj.get("wall_type") if obj.get("wall_type") is not None else PropertyDetailsWallType.INVALID_WALL_TYPE,
            "roof_type": obj.get("roof_type") if obj.get("roof_type") is not None else PropertyDetailsRoofType.INVALID_ROOF_TYPE,
            "year_property_built": obj.get("year_property_built"),
            "property_price": obj.get("property_price"),
            "property_valuation": obj.get("property_valuation"),
            "property_valuation_date": obj.get("property_valuation_date"),
            "property_valuation_source": obj.get("property_valuation_source") if obj.get("property_valuation_source") is not None else PropertyDetailsPropertyValuationSource.INVALID_PROPERTY_VALUATION_SOURCE,
            "right_to_buy_valuation": obj.get("right_to_buy_valuation"),
            "is_private_sale": obj.get("is_private_sale"),
            "purchasing_as_sitting_tenant": obj.get("purchasing_as_sitting_tenant"),
            "is_new_build": obj.get("is_new_build"),
            "property_builder_name": obj.get("property_builder_name"),
            "builder_registration_scheme": obj.get("builder_registration_scheme") if obj.get("builder_registration_scheme") is not None else PropertyDetailsBuilderRegistrationScheme.INVALID_BUILDER_REGISTRATION_SCHEME,
            "new_build_discounts_or_incentives_description": obj.get("new_build_discounts_or_incentives_description"),
            "new_build_discounts_or_incentives_value": obj.get("new_build_discounts_or_incentives_value"),
            "num_flats_in_block": obj.get("num_flats_in_block"),
            "num_floors_in_block": obj.get("num_floors_in_block"),
            "floor_of_flat": obj.get("floor_of_flat"),
            "does_the_property_have_a_lift": obj.get("does_the_property_have_a_lift"),
            "does_the_property_have_deck_access": obj.get("does_the_property_have_deck_access"),
            "is_property_over_retail": obj.get("is_property_over_retail"),
            "clear_floor_between_retail": obj.get("clear_floor_between_retail"),
            "property_converted_in_last_ten_years": obj.get("property_converted_in_last_ten_years"),
            "intend_to_let_or_run_business": obj.get("intend_to_let_or_run_business"),
            "intend_to_let_or_run_business_description": obj.get("intend_to_let_or_run_business_description"),
            "percent_of_property_used_for_residential": obj.get("percent_of_property_used_for_residential"),
            "remaining_percent_property_use_description": obj.get("remaining_percent_property_use_description"),
            "freehold_percent_floor_area": obj.get("freehold_percent_floor_area"),
            "is_single_dwelling": obj.get("is_single_dwelling"),
            "is_designated_defective": obj.get("is_designated_defective"),
            "is_near_environmental_hazards": obj.get("is_near_environmental_hazards"),
            "years_left_on_lease": obj.get("years_left_on_lease"),
            "leasehold_ground_rent": obj.get("leasehold_ground_rent"),
            "leasehold_service_charge": obj.get("leasehold_service_charge"),
            "solar_panels_on_property": obj.get("solar_panels_on_property"),
            "solar_panels_equipment_in_use": obj.get("solar_panels_equipment_in_use"),
            "roof_subject_to_lease": obj.get("roof_subject_to_lease"),
            "is_property_currently_rented": obj.get("is_property_currently_rented"),
            "address": CdmAddress.from_dict(obj["address"]) if obj.get("address") is not None else None,
            "property_type": obj.get("property_type") if obj.get("property_type") is not None else CdmPropertyDetailsPropertyType.INVALID_PROPERTY_TYPE,
            "property_tenure": obj.get("property_tenure") if obj.get("property_tenure") is not None else CdmPropertyDetailsPropertyTenure.INVALID_PROPERTY_TENURE,
            "property_use": obj.get("property_use") if obj.get("property_use") is not None else PropertyDetailsPropertyUse.INVALID_PROPERTY_USE,
            "flying_freehold_percentage": obj.get("flying_freehold_percentage"),
            "is_property_ex_local_authority": obj.get("is_property_ex_local_authority"),
            "is_studio": obj.get("is_studio"),
            "is_bedsit": obj.get("is_bedsit"),
            "is_house_of_multiple_occupancy": obj.get("is_house_of_multiple_occupancy"),
            "is_property_furnished": obj.get("is_property_furnished"),
            "number_of_bedrooms": obj.get("number_of_bedrooms"),
            "right_to_buy_purchase": obj.get("right_to_buy_purchase"),
            "is_shared_ownership": obj.get("is_shared_ownership"),
            "shared_ownership_share": obj.get("shared_ownership_share"),
            "shared_ownership_monthly_rent": obj.get("shared_ownership_monthly_rent"),
            "shared_equity_monthly_interest": obj.get("shared_equity_monthly_interest"),
            "help_to_buy_loan_amount": obj.get("help_to_buy_loan_amount"),
            "monthly_rental_income": obj.get("monthly_rental_income"),
            "shared_ownership_scheme_provider": obj.get("shared_ownership_scheme_provider"),
            "shared_ownership_type": obj.get("shared_ownership_type") if obj.get("shared_ownership_type") is not None else PropertyDetailsSharedOwnershipType.INVALID_SHARED_OWNERSHIP_TYPE,
            "monthly_management_expenses": obj.get("monthly_management_expenses"),
            "modified_at": obj.get("modified_at"),
            "shared_equity_repayment_details": obj.get("shared_equity_repayment_details"),
            "property_parking": obj.get("property_parking") if obj.get("property_parking") is not None else PropertyDetailsPropertyParking.INVALID_PROPERTY_PARKING,
            "sub_type": obj.get("sub_type") if obj.get("sub_type") is not None else PropertyDetailsPropertySubType.INVALID_SUBTYPE,
            "is_property_habitable": obj.get("is_property_habitable"),
            "work_planned_on_property": obj.get("work_planned_on_property") if obj.get("work_planned_on_property") is not None else PropertyDetailsPropertyWork.INVALID_WORK,
            "is_unencumbered": obj.get("is_unencumbered"),
            "acre_property_id": obj.get("acre_property_id"),
            "btl_has_lived": obj.get("btl_has_lived"),
            "btl_will_lived": obj.get("btl_will_lived"),
            "btl_is_operating_a_business": obj.get("btl_is_operating_a_business"),
            "is_multi_unit_freehold_block": obj.get("is_multi_unit_freehold_block"),
            "gross_development_value": obj.get("gross_development_value"),
            "cost_of_works": obj.get("cost_of_works"),
            "number_of_lettable_rooms": obj.get("number_of_lettable_rooms"),
            "is_work_planned_on_property": obj.get("is_work_planned_on_property"),
            "number_of_kitchens": obj.get("number_of_kitchens"),
            "number_of_reception_rooms": obj.get("number_of_reception_rooms"),
            "number_of_bathrooms": obj.get("number_of_bathrooms"),
            "has_annex": obj.get("has_annex"),
            "current_energy_rating": obj.get("current_energy_rating") if obj.get("current_energy_rating") is not None else PropertyDetailsEnergyRating.INVALID_ENERGY_RATING,
            "potential_energy_rating": obj.get("potential_energy_rating") if obj.get("potential_energy_rating") is not None else PropertyDetailsEnergyRating.INVALID_ENERGY_RATING,
            "current_environment_impact": obj.get("current_environment_impact"),
            "potential_environment_impact": obj.get("potential_environment_impact"),
            "target_registered_owners_details": obj.get("target_registered_owners_details"),
            "purchase_date": obj.get("purchase_date"),
            "specified_rebuild_cost": obj.get("specified_rebuild_cost")
        })
        return _obj


