# 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
[docs]
class SettlementInstructionQuery(BaseModel):
"""
SettlementInstructionQuery
"""
as_at: Optional[datetime] = Field(default=None, alias="asAt")
start_date: Optional[StrictStr] = Field(None,alias="startDate")
end_date: Optional[StrictStr] = Field(None,alias="endDate")
limit: Optional[StrictInt] = None
page: Optional[StrictStr] = Field(None,alias="page")
filter: Optional[StrictStr] = Field(None,alias="filter")
settlement_instruction_property_keys: Optional[List[StrictStr]] = Field(default=None, alias="settlementInstructionPropertyKeys")
transaction_property_keys: Optional[List[StrictStr]] = Field(default=None, alias="transactionPropertyKeys")
timeline_scope: Optional[StrictStr] = Field(None,alias="timelineScope")
timeline_code: Optional[StrictStr] = Field(None,alias="timelineCode")
closed_period_id: Optional[StrictStr] = Field(None,alias="closedPeriodId")
__properties = ["asAt", "startDate", "endDate", "limit", "page", "filter", "settlementInstructionPropertyKeys", "transactionPropertyKeys", "timelineScope", "timelineCode", "closedPeriodId"]
[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) -> SettlementInstructionQuery:
"""Create an instance of SettlementInstructionQuery 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)
# set to None if as_at (nullable) is None
# and __fields_set__ contains the field
if self.as_at is None and "as_at" in self.__fields_set__:
_dict['asAt'] = None
# set to None if start_date (nullable) is None
# and __fields_set__ contains the field
if self.start_date is None and "start_date" in self.__fields_set__:
_dict['startDate'] = None
# set to None if end_date (nullable) is None
# and __fields_set__ contains the field
if self.end_date is None and "end_date" in self.__fields_set__:
_dict['endDate'] = None
# set to None if limit (nullable) is None
# and __fields_set__ contains the field
if self.limit is None and "limit" in self.__fields_set__:
_dict['limit'] = None
# set to None if page (nullable) is None
# and __fields_set__ contains the field
if self.page is None and "page" in self.__fields_set__:
_dict['page'] = None
# set to None if filter (nullable) is None
# and __fields_set__ contains the field
if self.filter is None and "filter" in self.__fields_set__:
_dict['filter'] = None
# set to None if settlement_instruction_property_keys (nullable) is None
# and __fields_set__ contains the field
if self.settlement_instruction_property_keys is None and "settlement_instruction_property_keys" in self.__fields_set__:
_dict['settlementInstructionPropertyKeys'] = None
# set to None if transaction_property_keys (nullable) is None
# and __fields_set__ contains the field
if self.transaction_property_keys is None and "transaction_property_keys" in self.__fields_set__:
_dict['transactionPropertyKeys'] = None
# set to None if timeline_scope (nullable) is None
# and __fields_set__ contains the field
if self.timeline_scope is None and "timeline_scope" in self.__fields_set__:
_dict['timelineScope'] = None
# set to None if timeline_code (nullable) is None
# and __fields_set__ contains the field
if self.timeline_code is None and "timeline_code" in self.__fields_set__:
_dict['timelineCode'] = None
# set to None if closed_period_id (nullable) is None
# and __fields_set__ contains the field
if self.closed_period_id is None and "closed_period_id" in self.__fields_set__:
_dict['closedPeriodId'] = None
return _dict
[docs]
@classmethod
def from_dict(cls, obj: dict) -> SettlementInstructionQuery:
"""Create an instance of SettlementInstructionQuery from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return SettlementInstructionQuery.parse_obj(obj)
_obj = SettlementInstructionQuery.parse_obj({
"as_at": obj.get("asAt"),
"start_date": obj.get("startDate"),
"end_date": obj.get("endDate"),
"limit": obj.get("limit"),
"page": obj.get("page"),
"filter": obj.get("filter"),
"settlement_instruction_property_keys": obj.get("settlementInstructionPropertyKeys"),
"transaction_property_keys": obj.get("transactionPropertyKeys"),
"timeline_scope": obj.get("timelineScope"),
"timeline_code": obj.get("timelineCode"),
"closed_period_id": obj.get("closedPeriodId")
})
return _obj
SettlementInstructionQuery.update_forward_refs()