2024-09-26 14:51:10 +08:00
|
|
|
from collections.abc import Mapping
|
2024-09-26 12:49:00 +08:00
|
|
|
from datetime import datetime
|
|
|
|
|
2024-09-26 14:51:10 +08:00
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
|
|
from core.entities.provider_entities import ProviderConfig
|
2024-09-26 12:49:00 +08:00
|
|
|
from core.plugin.entities.base import BasePluginEntity
|
|
|
|
|
|
|
|
|
2024-09-26 14:51:10 +08:00
|
|
|
class EndpointDeclaration(BaseModel):
|
|
|
|
"""
|
|
|
|
declaration of an endpoint
|
|
|
|
"""
|
|
|
|
|
|
|
|
settings: Mapping[str, ProviderConfig] = Field(default_factory=Mapping)
|
|
|
|
|
|
|
|
|
2024-09-26 12:49:00 +08:00
|
|
|
class EndpointEntity(BasePluginEntity):
|
2024-09-26 14:51:10 +08:00
|
|
|
"""
|
|
|
|
entity of an endpoint
|
|
|
|
"""
|
|
|
|
|
2024-09-26 12:49:00 +08:00
|
|
|
settings: dict
|
|
|
|
hook_id: str
|
|
|
|
tenant_id: str
|
|
|
|
plugin_id: str
|
|
|
|
expired_at: datetime
|
2024-09-26 14:51:10 +08:00
|
|
|
declaration: EndpointDeclaration = Field(default_factory=EndpointDeclaration)
|