prod-wag-backend-automate-s.../Schemas/rules/rules.py

36 lines
1022 B
Python

from sqlalchemy import (
UUID,
String,
text,
)
from sqlalchemy.orm import (
Mapped,
mapped_column,
)
from Controllers.Postgres.mixin import CrudCollection
class EndpointRestriction(CrudCollection):
"""
Initialize Endpoint Restriction with default values
"""
__tablename__ = "endpoint_restriction"
__exclude__fields__ = []
operation_uu_id: Mapped[UUID] = mapped_column(
String, comment="UUID of the operation", nullable=False, unique=True
)
endpoint_function: Mapped[str] = mapped_column(
String, server_default="", comment="Function name of the API endpoint"
)
endpoint_name: Mapped[str] = mapped_column(
String, server_default="", comment="Name of the API endpoint"
)
endpoint_method: Mapped[str] = mapped_column(
String, server_default="", comment="HTTP method used by the endpoint"
)
endpoint_desc: Mapped[str] = mapped_column(
String, server_default="", comment="Description of the endpoint"
)