Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added usage_type attribute to policy ticket details #46

Merged
merged 1 commit into from
Dec 6, 2024
Merged
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
159 changes: 120 additions & 39 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-12-03T07:17:48+00:00
# timestamp: 2024-12-06T06:19:23+00:00

from __future__ import annotations

Expand Down Expand Up @@ -1022,6 +1022,9 @@ class DetectChangeResponse(BaseModel):
data_found: Optional[bool] = Field(
None, description="Whether data was found", title="Data Found"
)
usage_type: Optional[str] = Field(
None, description="Usage type of the change", title="Usage Type"
)


class Direction(str, Enum):
Expand Down Expand Up @@ -1127,6 +1130,13 @@ class ExportFileType(str, Enum):
pdf = "pdf"


class FeatureIntegrationStatus(str, Enum):
ENABLED = "ENABLED"
DISABLED = "DISABLED"
INITIATED = "INITIATED"
NOT_STARTED = "NOT_STARTED"


class Features(BaseModel):
enable_in_policy: Optional[bool] = Field(False, title="Enable In Policy")
enable_in_anomalies: Optional[bool] = Field(False, title="Enable In Anomalies")
Expand All @@ -1140,15 +1150,6 @@ class FeedbackModel(BaseModel):
)


class FormattedTicketActivity(BaseModel):
time: str = Field(..., description="Time in UTC format (HH:mm UTC)", title="Time")
status: str = Field(..., description="Status of the ticket", title="Status")
title: Optional[str] = Field("", description="Title of the activity", title="Title")
note: Optional[str] = Field(
"", description="Activity note or changelog data", title="Note"
)


class GcpService(str, Enum):
GCE = "GCE"
GCS = "GCS"
Expand All @@ -1165,8 +1166,8 @@ class GenerateSQLRequest(BaseModel):
selected_tables: List[str] = Field(
..., description="Selected tables", title="Selected Tables"
)
metric_names: Optional[List[str]] = Field(
..., description="List of metric names required", title="Metric Names"
metrics: Optional[List[Dict[str, Any]]] = Field(
..., description="List of metrics required", title="Metrics"
)


Expand Down Expand Up @@ -2858,8 +2859,8 @@ class SelectTablesResponse(BaseModel):
selected_tables: List[str] = Field(
..., description="Selected tables", title="Selected Tables"
)
metric_names: Optional[List[str]] = Field(
[], description="list of available metrics", title="Metric Names"
metrics: Optional[List[Dict[str, Any]]] = Field(
[], description="list of available metrics", title="Metrics"
)
error: Optional[Dict[str, Any]] = Field(
None, description="Error message if any", title="Error"
Expand Down Expand Up @@ -2913,6 +2914,7 @@ class Subcategory(str, Enum):
MIGRATE_TO_GP3 = "MIGRATE_TO_GP3"
SHIFT_TO_AMD = "SHIFT_TO_AMD"
STORAGE_TIER_TRANSITIONS = "STORAGE_TIER_TRANSITIONS"
DELETE_OBSOLETE_DATA = "DELETE_OBSOLETE_DATA"


class SyncActionTypeFromRepoRequest(BaseModel):
Expand Down Expand Up @@ -3140,6 +3142,9 @@ class TenantPolicyFilters(BaseModel):
change_types: Optional[List[ChangeType]] = Field(
[], description="Filter by change type.", title="Change Types"
)
effort_levels: Optional[List[Effort]] = Field(
[], description="Filter by effort level.", title="Effort Levels"
)


class TenantPolicyState(str, Enum):
Expand Down Expand Up @@ -3201,6 +3206,11 @@ class TenantPolicyTicketDetailsMixin(BaseModel):
description="The name of the feature associated with the policy.",
title="Feature Name",
)
usage_type: Optional[str] = Field(
None,
description="The usage type of the resource experiencing policy violation.",
title="Usage Type",
)


class TenantProviderAttributes(str, Enum):
Expand Down Expand Up @@ -3353,6 +3363,13 @@ class TicketsSelectedFieldsCategory(str, Enum):
TAG = "TAG"


class TimeFilter(BaseModel):
range: List[str] = Field(..., title="Range")
granularity: Optional[Dict[str, Any]] = Field(
{"unit": "days", "value": 1}, title="Granularity"
)


class UpdateActionTypeRequest(BaseModel):
service: Union[AwsService, GcpService] = Field(
..., description="Service AWS etc.", title="Service"
Expand Down Expand Up @@ -5197,13 +5214,6 @@ class CurBucketConfig(BaseModel):
status: Optional[TenantProviderState] = None


class DailyFormattedActivities(BaseModel):
date: str = Field(..., description="Date in generic format", title="Date")
data: Optional[List[FormattedTicketActivity]] = Field(
None, description="List of activities for the given date", title="Data"
)


class DataRetrieverQuery(BaseModel):
measures: Optional[List[str]] = Field(
None, description="List of measures", title="Measures"
Expand Down Expand Up @@ -5594,6 +5604,16 @@ class FeatureStore(BaseModel):


class GenerateSQLResponse(BaseModel):
chain_of_thought: str = Field(
...,
description="Detailed step-by-step reasoning process used to generate the SQL query using the provided schema",
title="Chain Of Thought",
)
reflection: str = Field(
...,
description="Reflect on the generated SQL query and the chain of thought based on the user query.",
title="Reflection",
)
sql_query: str = Field(..., description="Generated SQL", title="Sql Query")
status: OutputStatus = Field(..., description="Status of the query execution")
error: Optional[str] = Field(
Expand Down Expand Up @@ -5741,18 +5761,6 @@ class GetFeaturesByFiltersRequest(BaseModel):
tenant_id: UUID4 = Field(..., title="Tenant Id")


class GetFormattedTicketActivitiesApiResponse(BaseModel):
activities: Optional[List[DailyFormattedActivities]] = Field(
None, description="List of daily activities", title="Activities"
)


class GetFormattedTicketActivitiesResponse(BaseModel):
activities: Optional[List[DailyFormattedActivities]] = Field(
None, description="List of daily activities", title="Activities"
)


class GetHierarchyFilters(BaseModel):
state: Optional[HierarchyState] = Field(
"ACTIVE", description="Filter by state(ACTIVE, INACTIVE, DRAFT)"
Expand Down Expand Up @@ -5852,7 +5860,7 @@ class GetMetricsAvailabilityForResourceRequest(BaseModel):
node_ids: Optional[List[UUID4]] = Field(
None, description="The unique identifiers of the nodes", title="Node Ids"
)
resource_ids: List[str] = Field(
resource_ids: List[UUID] = Field(
..., description="The unique identifiers of the resources", title="Resource Ids"
)
metric_name: MetricName = Field(..., description="The name of the metric")
Expand Down Expand Up @@ -6384,6 +6392,7 @@ class GetTenantPoliciesAPIRequest(BaseModel):
"risk_levels": [],
"cost_saving_categories": [],
"change_types": [],
"effort_levels": [],
}
),
description="Filters to apply to the tenant policies.",
Expand All @@ -6406,6 +6415,7 @@ class GetTenantPoliciesRequest(BaseModel):
"risk_levels": [],
"cost_saving_categories": [],
"change_types": [],
"effort_levels": [],
}
),
description="Filters to apply to the tenant policies.",
Expand Down Expand Up @@ -7206,11 +7216,6 @@ class ResponseGetAllTenantEmbedAppsLinksResponse(BaseModel):
message: Optional[str] = Field(None, title="Message")


class ResponseGetFormattedTicketActivitiesApiResponse(BaseModel):
data: GetFormattedTicketActivitiesApiResponse
message: Optional[str] = Field(None, title="Message")


class ResponseGetHierarchyResponse(BaseModel):
data: GetHierarchyResponse
message: Optional[str] = Field(None, title="Message")
Expand Down Expand Up @@ -7476,6 +7481,9 @@ class TenantFeature(BaseModel):
config: Optional[FeatureConfig] = Field(
None, description="Configuration for the feature"
)
integration_status: FeatureIntegrationStatus = Field(
..., description="Integration status of the feature"
)
created_at: datetime = Field(
..., description="Creation datetime of the feature", title="Created At"
)
Expand Down Expand Up @@ -8649,6 +8657,17 @@ class CURDataMetricsQuery(BaseModel):
timezone: Optional[str] = Field("Asia/Kolkata", title="Timezone")


class ChartPayload(BaseModel):
name: Optional[str] = Field("aws_cur", title="Name")
dimension: str = Field(..., title="Dimension")
measures: Optional[List[str]] = Field(["sum_unblended_cost"], title="Measures")
filters: List[OnelensDomainUtilitiesRepositoriesDynamicFiltersFilterCriteria] = (
Field(..., title="Filters")
)
time_filter: TimeFilter
timezone: Optional[str] = Field("Asia/Kolkata", title="Timezone")


class CreateAuth0AndOnelensUserResponse(BaseModel):
auth0_data: Auth0UserAllFields = Field(
..., description="The data of the user in Auth0."
Expand Down Expand Up @@ -10558,6 +10577,11 @@ class UpdateSavedViewResponse(BaseModel):
is_default: Optional[bool] = Field(
False, description="Whether the saved view is default", title="Is Default"
)
is_system_defined: Optional[bool] = Field(
False,
description="Whether the saved view is system defined",
title="Is System Defined",
)
ol_user_id: UUID4 = Field(
..., description="Unique onelens identifier for the user", title="Ol User Id"
)
Expand Down Expand Up @@ -10618,6 +10642,11 @@ class ViolationMetricsDetails(BaseModel):
query: MetricsQueryOutput = Field(..., description="Query for the metric")


class ChartComponentData(BaseModel):
cost_trend_usage_name: str = Field(..., title="Cost Trend Usage Name")
query: ChartPayload


class CreatePolicyTemplateRequest(BaseModel):
parent_ptp_id: UUID4 = Field(
...,
Expand Down Expand Up @@ -10783,6 +10812,11 @@ class CreateSavedViewResponse(BaseModel):
is_default: Optional[bool] = Field(
False, description="Whether the saved view is default", title="Is Default"
)
is_system_defined: Optional[bool] = Field(
False,
description="Whether the saved view is system defined",
title="Is System Defined",
)
ol_user_id: UUID4 = Field(
..., description="Unique onelens identifier for the user", title="Ol User Id"
)
Expand All @@ -10791,6 +10825,24 @@ class CreateSavedViewResponse(BaseModel):
)


class DetailsMetadata(BaseModel):
title: Optional[str] = Field(None, title="Title")
evidence_data: Optional[List[Dict[str, str]]] = Field(None, title="Evidence Data")
graph_data: Optional[ChartComponentData] = None


class FormattedTicketActivity(BaseModel):
time: str = Field(..., description="Time in UTC format (HH:mm UTC)", title="Time")
status: str = Field(..., description="Status of the ticket", title="Status")
title: Optional[str] = Field("", description="Title of the activity", title="Title")
note: Optional[str] = Field(
"", description="Activity note or changelog data", title="Note"
)
details_metadata: Optional[DetailsMetadata] = Field(
None, description="Details of the activity"
)


class GetAllTenantUsersItem(BaseModel):
model_config = ConfigDict(
extra="forbid",
Expand Down Expand Up @@ -11508,10 +11560,34 @@ class SavedViewItem(BaseModel):
is_default: Optional[bool] = Field(
False, description="Whether the saved view is default", title="Is Default"
)
is_system_defined: Optional[bool] = Field(
False,
description="Whether the saved view is system defined",
title="Is System Defined",
)
created_at: datetime = Field(..., description="Created at", title="Created At")
updated_at: datetime = Field(..., description="Updated at", title="Updated At")


class DailyFormattedActivities(BaseModel):
date: str = Field(..., description="Date in generic format", title="Date")
data: Optional[List[FormattedTicketActivity]] = Field(
None, description="List of activities for the given date", title="Data"
)


class GetFormattedTicketActivitiesApiResponse(BaseModel):
activities: Optional[List[DailyFormattedActivities]] = Field(
None, description="List of daily activities", title="Activities"
)


class GetFormattedTicketActivitiesResponse(BaseModel):
activities: Optional[List[DailyFormattedActivities]] = Field(
None, description="List of daily activities", title="Activities"
)


class GetMutipleMetricsResponse(BaseModel):
metrics: List[GetMutipleMetricsResponseMixin] = Field(..., title="Metrics")

Expand All @@ -11529,6 +11605,11 @@ class GetSavedViewsResponse(BaseModel):
)


class ResponseGetFormattedTicketActivitiesApiResponse(BaseModel):
data: GetFormattedTicketActivitiesApiResponse
message: Optional[str] = Field(None, title="Message")


class ResponseGetPolicyTemplatesResponse(BaseModel):
data: GetPolicyTemplatesResponse
message: Optional[str] = Field(None, title="Message")
Expand Down
Loading