Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions onelens_backend_client_v2/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: <stdin>
# timestamp: 2025-12-11T10:52:06+00:00
# timestamp: 2025-12-16T11:03:55+00:00

from __future__ import annotations

Expand Down Expand Up @@ -8922,6 +8922,9 @@ class DeltaEvents(BaseModel):
..., description="Details of the delta event", title="Details"
)
run_id: UUID = Field(..., description="Run ID of the delta event", title="Run Id")
provider: Optional[Provider] = Field(
None, description="Cloud provider (AWS, GCP, AZURE, OCI)"
)
id: UUID = Field(..., description="ID of the delta event", title="Id")
method_params_hash: Optional[str] = Field(
None, description="Hash of the method parameters", title="Method Params Hash"
Expand Down Expand Up @@ -8971,6 +8974,9 @@ class DeltaEventsMixin(BaseModel):
..., description="Details of the delta event", title="Details"
)
run_id: UUID = Field(..., description="Run ID of the delta event", title="Run Id")
provider: Optional[Provider] = Field(
None, description="Cloud provider (AWS, GCP, AZURE, OCI)"
)


class DeltaEventsRca(BaseModel):
Expand Down Expand Up @@ -9007,6 +9013,9 @@ class DeltaEventsRca(BaseModel):
..., description="Details of the delta event", title="Details"
)
run_id: UUID = Field(..., description="Run ID of the delta event", title="Run Id")
provider: Optional[Provider] = Field(
None, description="Cloud provider (AWS, GCP, AZURE, OCI)"
)
parent_id: UUID = Field(
..., description="Parent ID of the delta event", title="Parent Id"
)
Expand Down Expand Up @@ -9056,6 +9065,9 @@ class DeltaEventsRcaMixin(BaseModel):
..., description="Details of the delta event", title="Details"
)
run_id: UUID = Field(..., description="Run ID of the delta event", title="Run Id")
provider: Optional[Provider] = Field(
None, description="Cloud provider (AWS, GCP, AZURE, OCI)"
)
parent_id: UUID = Field(
..., description="Parent ID of the delta event", title="Parent Id"
)
Expand Down Expand Up @@ -19160,17 +19172,17 @@ class CreateCustomTenantTicketRequestMixin(BaseModel):
title="Post Policy Execution Last Run",
)
last_run_id: Optional[UUID4] = Field(
"8a46d4e4-91b1-46f4-8dc6-a6d063b360b6",
"1946c8ef-4434-40c3-a4c7-8477988b831f",
description="Id of the last policy violation/anomaly run",
title="Last Run Id",
)
last_run_at: Optional[datetime] = Field(
"2025-12-11T16:21:18.585904",
"2025-12-16T16:30:12.459193",
description="Datetime of the last policy violation/anomaly run",
title="Last Run At",
)
first_run_at: Optional[datetime] = Field(
"2025-12-11T16:21:18.585918",
"2025-12-16T16:30:12.459206",
description="Datetime of the first policy violation/anomaly run",
title="First Run At",
)
Comment on lines 19174 to 19188

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The hardcoded default values for last_run_id, last_run_at, and first_run_at appear to be example values. Since these fields are optional, it would be cleaner and less confusing to default them to None. This avoids embedding potentially stale or arbitrary example data directly in the model definition. If a default value is truly needed, consider using Pydantic's default_factory for dynamic values (e.g., default_factory=uuid.uuid4 or default_factory=datetime.utcnow).

Suggested change
last_run_id: Optional[UUID4] = Field(
"8a46d4e4-91b1-46f4-8dc6-a6d063b360b6",
"1946c8ef-4434-40c3-a4c7-8477988b831f",
description="Id of the last policy violation/anomaly run",
title="Last Run Id",
)
last_run_at: Optional[datetime] = Field(
"2025-12-11T16:21:18.585904",
"2025-12-16T16:30:12.459193",
description="Datetime of the last policy violation/anomaly run",
title="Last Run At",
)
first_run_at: Optional[datetime] = Field(
"2025-12-11T16:21:18.585918",
"2025-12-16T16:30:12.459206",
description="Datetime of the first policy violation/anomaly run",
title="First Run At",
)
last_run_id: Optional[UUID4] = Field(
None,
description="Id of the last policy violation/anomaly run",
title="Last Run Id",
)
last_run_at: Optional[datetime] = Field(
None,
description="Datetime of the last policy violation/anomaly run",
title="Last Run At",
)
first_run_at: Optional[datetime] = Field(
None,
description="Datetime of the first policy violation/anomaly run",
title="First Run At",
)

Expand Down