# generated by datamodel-codegen:
#   filename:  Folio/AccountHistoryRequest.json

from __future__ import annotations
from architect_py.grpc.models.Folio.AccountHistoryResponse import AccountHistoryResponse

from datetime import datetime
from typing import Optional

from msgspec import Struct

from .. import definitions


class AccountHistoryRequest(Struct, omit_defaults=True):
    account: definitions.AccountIdOrName
    from_inclusive: Optional[datetime] = None
    to_exclusive: Optional[datetime] = None

    # Constructor that takes all field titles as arguments for convenience
    @classmethod
    def new(
        cls,
        account: definitions.AccountIdOrName,
        from_inclusive: Optional[datetime] = None,
        to_exclusive: Optional[datetime] = None,
    ):
        return cls(
            account,
            from_inclusive,
            to_exclusive,
        )

    def __str__(self) -> str:
        return f"AccountHistoryRequest(account={self.account},from_inclusive={self.from_inclusive},to_exclusive={self.to_exclusive})"

    @staticmethod
    def get_response_type():
        return AccountHistoryResponse

    @staticmethod
    def get_unannotated_response_type():
        return AccountHistoryResponse

    @staticmethod
    def get_route() -> str:
        return "/json.architect.Folio/AccountHistory"

    @staticmethod
    def get_rpc_method():
        return "unary"
