-
Notifications
You must be signed in to change notification settings - Fork 49
/
agenda.py
46 lines (37 loc) · 1.29 KB
/
agenda.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from datetime import datetime
from enum import Enum
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
class CalendarType(str, Enum):
DIVIDEND_CALENDAR = "DividendCalendar"
ECONOMIC_CALENDAR = "EconomicCalendar"
EARNINGS_CALENDAR = "EarningsCalendar"
HOLIDAY_CALENDAR = "HolidayCalendar"
IPO_CALENDAR = "IpoCalendar"
SPLIT_CALENDAR = "SplitCalendar"
class AgendaRequest(BaseModel):
model_config = ConfigDict(
alias_generator=to_camel,
extra="allow",
populate_by_name=True,
json_encoders={
datetime: lambda v: v.strftime("%Y-%m-%dT%H:%M:%SZ") if v else None
},
)
calendar_type: CalendarType
classifications: str | None = Field(default=None)
company_name: str | None = Field(default=None)
countries: str | None = Field(default=None)
end_date: datetime
limit: int = Field(default=25)
offset: int = Field(default=0)
sort_column: str | None = Field(default="date")
sort_type: str | None = Field(default="asc")
start_date: datetime
units: str | None = Field(default=None)
int_account: int | None = Field(default=None)
session_id: str | None = Field(default=None)
class Agenda(BaseModel):
items: list[dict]
offset: int
total: int