Skip to content

Commit

Permalink
changed ticket alias model
Browse files Browse the repository at this point in the history
  • Loading branch information
parteek65 committed Sep 12, 2024
1 parent 8f22199 commit ec381c8
Showing 1 changed file with 152 additions and 4 deletions.
156 changes: 152 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: 2024-09-09T11:21:50+00:00
# timestamp: 2024-09-12T14:04:46+00:00

from __future__ import annotations

Expand Down Expand Up @@ -4285,12 +4285,21 @@ class GetSinglePolicyTicketByPolicyIdResponse(BaseModel):
policy_title: Optional[str] = Field(
None, description="Policy title", title="Policy Title"
)
policy_display_alias: Optional[str] = Field(
None, description="Policy alias", title="Policy Display Alias"
)
policy_labels: Optional[List[str]] = Field(
None, description="Policy labels", title="Policy Labels"
)
effort: Optional[Effort] = Field(
None, description="Effort of the ticket recommendation"
)
ticket_alias: str = Field(
..., description="The unique identifier of the ticket", title="Ticket Alias"
)
first_run_at: Optional[datetime] = Field(
None, description="violation creation time", title="First Run At"
)


class GetTenantByIDResponse(BaseModel):
Expand Down Expand Up @@ -5410,6 +5419,9 @@ class TenantTicket(BaseModel):
details: Union[TenantPolicyTicketDetailsMixin, TenantAnomalyTicketDetailsMixin] = (
Field(..., description="Details of the ticket", title="Details")
)
ticket_alias: Optional[int] = Field(
None, description="the numeric ticket alias of the ticket", title="Ticket Alias"
)


class TenantTicketFilters(BaseModel):
Expand Down Expand Up @@ -5442,6 +5454,77 @@ class TenantTicketFilters(BaseModel):
)


class TenantTicketWithTicketAlias(BaseModel):
created_at: datetime = Field(
..., description="Datetime of ticket creation", title="Created At"
)
updated_at: datetime = Field(
..., description="Datetime of ticket updation", title="Updated At"
)
monitor_id: Optional[UUID5] = Field(
None, description="Violation monitor id/anomlay node id", title="Monitor Id"
)
ticket_category: TicketCategory = Field(..., description="Category of the ticket")
state: TicketState = Field(..., description="State of the ticket")
entity_id: UUID = Field(
...,
description="The id of the resource experiencing policy violation.",
title="Entity Id",
)
entity_type: str = Field(
...,
description="The type of the resource experiencing policy violation.",
title="Entity Type",
)
entity_attributes: Optional[Dict[str, Any]] = Field(
{},
description="The attributes of the resource experiencing policy violation.",
title="Entity Attributes",
)
monthly_unblended_cost: Optional[float] = Field(
None,
description="The monthly unblended cost of the resource experiencing policy violation.",
title="Monthly Unblended Cost",
)
assignment: TicketAssignment = Field(
..., description="Assignment state of the ticket"
)
assigned_to: Optional[UUID4] = Field(
None,
description="The unique identifier of the user the current ticket is assigned to",
title="Assigned To",
)
last_run_id: UUID4 = Field(
...,
description="Id of the last policy violation/anomaly run",
title="Last Run Id",
)
last_run_at: datetime = Field(
...,
description="Datetime of the last policy violation/anomaly run",
title="Last Run At",
)
first_run_at: datetime = Field(
...,
description="Datetime of the first policy violation/anomaly run",
title="First Run At",
)
id: UUID4 = Field(
..., description="The unique identifier of the ticket", title="Id"
)
status: Union[PolicyTicketStatus, AnomalyTicketStatus] = Field(
..., description="Status of the ticket", title="Status"
)
details: Union[TenantPolicyTicketDetailsMixin, TenantAnomalyTicketDetailsMixin] = (
Field(..., description="Details of the ticket", title="Details")
)
ticket_alias: Optional[str] = Field(
None,
description="the # included ticket alias of the ticket",
title="Ticket Alias",
)


class TenantUserDetailsUpdateFieldsMixin(BaseModel):
first_name: Optional[str] = Field(
None, description="First name of the user", title="First Name"
Expand Down Expand Up @@ -7269,6 +7352,65 @@ class TenantPolicyForPolicyWithSetting(BaseModel):
)


class TenantPolicyWithPolicyDisplayAlias(BaseModel):
parent_ptp_id: UUID4 = Field(
...,
description="The id of the parent policy template pack.",
title="Parent Ptp Id",
)
title: str = Field(
..., description="The title of the policy template.", title="Title"
)
alias: str = Field(
..., description="The alias of the policy template.", title="Alias"
)
description: Optional[str] = Field(
None, description="The description of the policy template.", title="Description"
)
services: List[Union[AwsService, GcpService]] = Field(
...,
description="The list of services associated the policy template.",
title="Services",
)
execution_type: PolicyExecutionType = Field(
..., description="The execution type of the policy template."
)
details: PolicyTemplateDetailsOutput = Field(
..., description="The details of the policy template."
)
description2: Optional[str] = Field(
None,
description="The description2 of the policy template.",
title="Description2",
)
resource_type: str = Field(
...,
description="The resource type of the policy template.",
title="Resource Type",
)
recommendation_details: PolicyTemplateRecommendationDetailsOutput = Field(
..., description="The recommendation details for the policy template."
)
policy_template_id: UUID4 = Field(
..., description="The id of the policy template.", title="Policy Template Id"
)
category: PolicyCategory = Field(
..., description="The category of the policy template."
)
provider: Provider = Field(
..., description="The cloud provider of the policy template."
)
id: UUID4 = Field(
..., description="The unique identifier of the tenant policy.", title="Id"
)
state: TenantPolicySystemState = Field(
..., description="The state of the tenant policy."
)
policy_display_alias: str = Field(
..., description="Policy display alias ", title="Policy Display Alias"
)


class TenantPolicyWithSetting(BaseModel):
policy: TenantPolicyForPolicyWithSetting = Field(
..., description="The policy details."
Expand Down Expand Up @@ -7759,7 +7901,9 @@ class GetTenantPolicyByIdResponse(BaseModel):


class GetTenantPolicyWithSummaryResponse(BaseModel):
policy: TenantPolicy = Field(..., description="The policy details.")
policy: TenantPolicyWithPolicyDisplayAlias = Field(
..., description="The policy details."
)
recommendation_units: List[str] = Field(
...,
description="List of recommendation units names.",
Expand All @@ -7768,8 +7912,12 @@ class GetTenantPolicyWithSummaryResponse(BaseModel):


class GetTicketByIdPolicyDetailsResponse(BaseModel):
tenant_ticket: TenantTicket = Field(..., description="Tenant ticket details")
policy_details: TenantPolicy = Field(..., description="Policy details")
tenant_ticket: TenantTicketWithTicketAlias = Field(
..., description="Tenant ticket details"
)
policy_details: TenantPolicyWithPolicyDisplayAlias = Field(
..., description="Policy details"
)
recommendation_units: List[str] = Field(
..., description="List of recommendation units", title="Recommendation Units"
)
Expand Down

0 comments on commit ec381c8

Please sign in to comment.