tbapi.api.interfaces.iexchange_session
1from __future__ import annotations 2from typing import TYPE_CHECKING 3from tbapi.common.decorators import tb_interface 4from tbapi.common.converters import to_python_datetime, to_net_datetime 5from datetime import datetime 6from Tickblaze.Scripts.Api.Interfaces import IExchangeSession as _IExchangeSession 7from typing import Any, overload 8from abc import ABC, abstractmethod 9 10@tb_interface(_IExchangeSession) 11class IExchangeSession(): 12 """Defines methods and properties for handling exchange sessions, including session times and duration.""" 13 14 @property 15 def end_exchange_date_time(self) -> datetime: 16 """The end exchange date/time of the session.""" 17 val = self._value.EndExchangeDateTime 18 return to_python_datetime(val) 19 @property 20 def end_utc_date_time(self) -> datetime: 21 """The end UTC date/time of the session.""" 22 val = self._value.EndUtcDateTime 23 return to_python_datetime(val) 24 @property 25 def session_minutes(self) -> int: 26 """The session duration in minutes.""" 27 val = self._value.SessionMinutes 28 return val 29 @property 30 def session_seconds(self) -> int: 31 """The session duration in seconds.""" 32 val = self._value.SessionSeconds 33 return val 34 @property 35 def start_exchange_date_time(self) -> datetime: 36 """The start exchange date/time of the session.""" 37 val = self._value.StartExchangeDateTime 38 return to_python_datetime(val) 39 @property 40 def start_utc_date_time(self) -> datetime: 41 """The start UTC date/time of the session.""" 42 val = self._value.StartUtcDateTime 43 return to_python_datetime(val) 44 @property 45 def total_minutes(self) -> int: 46 """The total minute count from the first minute of the first session.""" 47 val = self._value.TotalMinutes 48 return val 49 50 @abstractmethod 51 def contains(self, utc_date_time: datetime) -> bool: 52 """Determines whether the provided UTC date/time is within the session. The UTC date/time to check. True if the date/time is within the session, false otherwise.""" 53 result = self._value.Contains(to_net_datetime(utc_date_time)) 54 return result 55
@tb_interface(_IExchangeSession)
class
IExchangeSession:
16@tb_interface(_IExchangeSession) 17class IExchangeSession(): 18 """Defines methods and properties for handling exchange sessions, including session times and duration.""" 19 20 @property 21 def end_exchange_date_time(self) -> datetime: 22 """The end exchange date/time of the session.""" 23 val = self._value.EndExchangeDateTime 24 return to_python_datetime(val) 25 @property 26 def end_utc_date_time(self) -> datetime: 27 """The end UTC date/time of the session.""" 28 val = self._value.EndUtcDateTime 29 return to_python_datetime(val) 30 @property 31 def session_minutes(self) -> int: 32 """The session duration in minutes.""" 33 val = self._value.SessionMinutes 34 return val 35 @property 36 def session_seconds(self) -> int: 37 """The session duration in seconds.""" 38 val = self._value.SessionSeconds 39 return val 40 @property 41 def start_exchange_date_time(self) -> datetime: 42 """The start exchange date/time of the session.""" 43 val = self._value.StartExchangeDateTime 44 return to_python_datetime(val) 45 @property 46 def start_utc_date_time(self) -> datetime: 47 """The start UTC date/time of the session.""" 48 val = self._value.StartUtcDateTime 49 return to_python_datetime(val) 50 @property 51 def total_minutes(self) -> int: 52 """The total minute count from the first minute of the first session.""" 53 val = self._value.TotalMinutes 54 return val 55 56 @abstractmethod 57 def contains(self, utc_date_time: datetime) -> bool: 58 """Determines whether the provided UTC date/time is within the session. The UTC date/time to check. True if the date/time is within the session, false otherwise.""" 59 result = self._value.Contains(to_net_datetime(utc_date_time)) 60 return result
Defines methods and properties for handling exchange sessions, including session times and duration.
end_exchange_date_time: datetime.datetime
20 @property 21 def end_exchange_date_time(self) -> datetime: 22 """The end exchange date/time of the session.""" 23 val = self._value.EndExchangeDateTime 24 return to_python_datetime(val)
The end exchange date/time of the session.
end_utc_date_time: datetime.datetime
25 @property 26 def end_utc_date_time(self) -> datetime: 27 """The end UTC date/time of the session.""" 28 val = self._value.EndUtcDateTime 29 return to_python_datetime(val)
The end UTC date/time of the session.
session_minutes: int
30 @property 31 def session_minutes(self) -> int: 32 """The session duration in minutes.""" 33 val = self._value.SessionMinutes 34 return val
The session duration in minutes.
session_seconds: int
35 @property 36 def session_seconds(self) -> int: 37 """The session duration in seconds.""" 38 val = self._value.SessionSeconds 39 return val
The session duration in seconds.
start_exchange_date_time: datetime.datetime
40 @property 41 def start_exchange_date_time(self) -> datetime: 42 """The start exchange date/time of the session.""" 43 val = self._value.StartExchangeDateTime 44 return to_python_datetime(val)
The start exchange date/time of the session.
start_utc_date_time: datetime.datetime
45 @property 46 def start_utc_date_time(self) -> datetime: 47 """The start UTC date/time of the session.""" 48 val = self._value.StartUtcDateTime 49 return to_python_datetime(val)
The start UTC date/time of the session.
total_minutes: int
50 @property 51 def total_minutes(self) -> int: 52 """The total minute count from the first minute of the first session.""" 53 val = self._value.TotalMinutes 54 return val
The total minute count from the first minute of the first session.
@abstractmethod
def
contains(self, utc_date_time: datetime.datetime) -> bool:
56 @abstractmethod 57 def contains(self, utc_date_time: datetime) -> bool: 58 """Determines whether the provided UTC date/time is within the session. The UTC date/time to check. True if the date/time is within the session, false otherwise.""" 59 result = self._value.Contains(to_net_datetime(utc_date_time)) 60 return result
Determines whether the provided UTC date/time is within the session. The UTC date/time to check. True if the date/time is within the session, false otherwise.