Source code for sdk.lusid.models.update_valuation_point_request

# coding: utf-8

"""
    LUSID API

    FINBOURNE Technology  # noqa: E501

    Contact: info@finbourne.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


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


from typing import List, Dict, Optional, Any, Union, TYPE_CHECKING
from typing_extensions import Annotated
from pydantic.v1 import BaseModel, StrictStr, StrictInt, StrictBool, StrictFloat, StrictBytes, Field, validator, ValidationError, conlist, constr
from datetime import datetime
from lusid.models.model_property import ModelProperty

[docs] class UpdateValuationPointRequest(BaseModel): """ A definition for the period you wish to close # noqa: E501 """ valuation_point_code: StrictStr = Field(...,alias="valuationPointCode", description="Unique code for the Valuation Point.") variant: Optional[StrictStr] = Field(None,alias="variant", description="Optional variant code. Only required when it is necessary to choose between scenarios with multiple estimates.") name: Optional[StrictStr] = Field(None,alias="name", description="Identifiable Name assigned to the Valuation Point.") properties: Optional[Dict[str, ModelProperty]] = Field(default=None, description="A set of properties for the diary entry.") apply_clear_down: Optional[StrictBool] = Field(default=None, description="Defaults to null. Set to true if you want the closed period to have the clear down applied.", alias="applyClearDown") update_inclusion_date_nav_adjustments: Optional[StrictBool] = Field(default=None, description="Defaults to null. Set to true if you have the required licence and want the InclusionDate property values to be used to determine whether items should be automatically included in the post close activities.", alias="updateInclusionDateNavAdjustments") __properties = ["valuationPointCode", "variant", "name", "properties", "applyClearDown", "updateInclusionDateNavAdjustments"]
[docs] class Config: """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True
def __str__(self): """For `print` and `pprint`""" return pprint.pformat(self.dict(by_alias=False)) def __repr__(self): """For `print` and `pprint`""" return self.to_str()
[docs] def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.dict(by_alias=True))
[docs] def to_json(self) -> str: """Returns the JSON representation of the model using alias""" return json.dumps(self.to_dict())
[docs] @classmethod def from_json(cls, json_str: str) -> UpdateValuationPointRequest: """Create an instance of UpdateValuationPointRequest from a JSON string""" return cls.from_dict(json.loads(json_str))
[docs] def to_dict(self): """Returns the dictionary representation of the model using alias""" _dict = self.dict(by_alias=True, exclude={ }, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each value in properties (dict) _field_dict = {} if self.properties: for _key in self.properties: if self.properties[_key]: _field_dict[_key] = self.properties[_key].to_dict() _dict['properties'] = _field_dict # set to None if variant (nullable) is None # and __fields_set__ contains the field if self.variant is None and "variant" in self.__fields_set__: _dict['variant'] = None # set to None if name (nullable) is None # and __fields_set__ contains the field if self.name is None and "name" in self.__fields_set__: _dict['name'] = None # set to None if properties (nullable) is None # and __fields_set__ contains the field if self.properties is None and "properties" in self.__fields_set__: _dict['properties'] = None # set to None if apply_clear_down (nullable) is None # and __fields_set__ contains the field if self.apply_clear_down is None and "apply_clear_down" in self.__fields_set__: _dict['applyClearDown'] = None # set to None if update_inclusion_date_nav_adjustments (nullable) is None # and __fields_set__ contains the field if self.update_inclusion_date_nav_adjustments is None and "update_inclusion_date_nav_adjustments" in self.__fields_set__: _dict['updateInclusionDateNavAdjustments'] = None return _dict
[docs] @classmethod def from_dict(cls, obj: dict) -> UpdateValuationPointRequest: """Create an instance of UpdateValuationPointRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): return UpdateValuationPointRequest.parse_obj(obj) _obj = UpdateValuationPointRequest.parse_obj({ "valuation_point_code": obj.get("valuationPointCode"), "variant": obj.get("variant"), "name": obj.get("name"), "properties": dict( (_k, ModelProperty.from_dict(_v)) for _k, _v in obj.get("properties").items() ) if obj.get("properties") is not None else None, "apply_clear_down": obj.get("applyClearDown"), "update_inclusion_date_nav_adjustments": obj.get("updateInclusionDateNavAdjustments") }) return _obj
UpdateValuationPointRequest.update_forward_refs()