Skip to content

Commit

Permalink
adjusted notification models
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerskk committed Jul 26, 2024
1 parent ac71b62 commit eb635f6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
19 changes: 10 additions & 9 deletions app/helpers/notifications/email/models/account.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from typing import Optional, List, Dict

from pydantic import BaseModel

from pydantic import BaseModel, Field

class Account(BaseModel):
sender: str
account_name: str
password: str
server_address: str
port: int
sender: str = Field(...)
account_name: str = Field(...)
password: str = Field(...)
server_address: str = Field(...)
port: int = Field(...)

model_config = {
'validate_assignment': True
}
20 changes: 12 additions & 8 deletions app/helpers/notifications/email/models/email.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
from typing import Optional, List, Dict

from pydantic import BaseModel

from pydantic import BaseModel, Field

class Services(BaseModel):
neo4j: str
swate: str
rabbitmq: str
neo4j: str = Field(default="")
swate: str = Field(default="")
rabbitmq: str = Field(default="")

model_config = {
'validate_assignment': True
}

class Health(BaseModel):
services: Services
status: str
status: str = Field(default="")

model_config = {
'validate_assignment': True
}
16 changes: 9 additions & 7 deletions app/helpers/notifications/email/models/images.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from typing import Optional, List, Dict

from pydantic import BaseModel

from typing import Optional
from pydantic import BaseModel, Field

class Images(BaseModel):
success: Optional[bool]
warning: Optional[bool]
webhook: Optional[bool]
success: Optional[bool] = Field(default=None)
warning: Optional[bool] = Field(default=None)
webhook: Optional[bool] = Field(default=None)

model_config = {
'validate_assignment': True
}

0 comments on commit eb635f6

Please sign in to comment.