# 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.portfolio_entity_id import PortfolioEntityId
[docs]
class SettlementActivityQuery(BaseModel):
"""
SettlementActivityQuery
"""
as_at: Optional[datetime] = Field(default=None, description="The asAt time at which to query settlement activity. Defaults to latest.", alias="asAt")
portfolio_entity_ids: Optional[List[PortfolioEntityId]] = Field(default=None, description="The portfolios and / or portfolio groups to query. At least one entry is required.", alias="portfolioEntityIds")
start_activity_date: Optional[StrictStr] = Field(None,alias="startActivityDate", description="Lower bound (inclusive) of the activity date range. If not set, no lower bound is applied.")
end_activity_date: Optional[StrictStr] = Field(None,alias="endActivityDate", description="Upper bound (inclusive) of the activity date range. Defaults to the current date and time. Treated as effectiveAt.")
filter: Optional[StrictStr] = Field(None,alias="filter", description="A LUSID standard filter expression. Supports traversal into transaction and settlementInstruction.")
settlement_instruction_property_keys: Optional[List[StrictStr]] = Field(default=None, description="Settlement instruction property keys to populate on the response. Behaviour matches BuildSettlementInstructions.", alias="settlementInstructionPropertyKeys")
transaction_property_keys: Optional[List[StrictStr]] = Field(default=None, description="Transaction property keys to populate on the response. Behaviour matches BuildSettlementInstructions.", alias="transactionPropertyKeys")
limit: Optional[StrictInt] = Field(default=None, description="Page size limit; standard pagination control. Defaults to 5000.")
page: Optional[StrictStr] = Field(None,alias="page", description="Pagination cursor returned by a previous response.")
__properties = ["asAt", "portfolioEntityIds", "startActivityDate", "endActivityDate", "filter", "settlementInstructionPropertyKeys", "transactionPropertyKeys", "limit", "page"]
[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) -> SettlementActivityQuery:
"""Create an instance of SettlementActivityQuery 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 item in portfolio_entity_ids (list)
_items = []
if self.portfolio_entity_ids:
for _item in self.portfolio_entity_ids:
if _item:
_items.append(_item.to_dict())
_dict['portfolioEntityIds'] = _items
# 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 portfolio_entity_ids (nullable) is None
# and __fields_set__ contains the field
if self.portfolio_entity_ids is None and "portfolio_entity_ids" in self.__fields_set__:
_dict['portfolioEntityIds'] = None
# set to None if start_activity_date (nullable) is None
# and __fields_set__ contains the field
if self.start_activity_date is None and "start_activity_date" in self.__fields_set__:
_dict['startActivityDate'] = None
# set to None if end_activity_date (nullable) is None
# and __fields_set__ contains the field
if self.end_activity_date is None and "end_activity_date" in self.__fields_set__:
_dict['endActivityDate'] = 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 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
return _dict
[docs]
@classmethod
def from_dict(cls, obj: dict) -> SettlementActivityQuery:
"""Create an instance of SettlementActivityQuery from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return SettlementActivityQuery.parse_obj(obj)
_obj = SettlementActivityQuery.parse_obj({
"as_at": obj.get("asAt"),
"portfolio_entity_ids": [PortfolioEntityId.from_dict(_item) for _item in obj.get("portfolioEntityIds")] if obj.get("portfolioEntityIds") is not None else None,
"start_activity_date": obj.get("startActivityDate"),
"end_activity_date": obj.get("endActivityDate"),
"filter": obj.get("filter"),
"settlement_instruction_property_keys": obj.get("settlementInstructionPropertyKeys"),
"transaction_property_keys": obj.get("transactionPropertyKeys"),
"limit": obj.get("limit"),
"page": obj.get("page")
})
return _obj
SettlementActivityQuery.update_forward_refs()