Skip to content

Commit

Permalink
Rename application filter models for consistency.
Browse files Browse the repository at this point in the history
Updated class and import names in application_filters.py and __init__.py, changing 'ApplicationFilter' to 'ApplicationFilters'. This enhancement ensures naming consistency across the codebase, improving readability and maintainability of model definitions and their usage.
  • Loading branch information
cdot65 committed Dec 5, 2024
1 parent 9a4304e commit b0ed5d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions scm/models/objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
ApplicationUpdateModel,
)
from .application_filters import (
ApplicationFilterCreateModel,
ApplicationFilterResponseModel,
ApplicationFilterUpdateModel,
ApplicationFiltersCreateModel,
ApplicationFiltersResponseModel,
ApplicationFiltersUpdateModel,
)
from .application_group import (
ApplicationGroupCreateModel,
Expand Down
14 changes: 7 additions & 7 deletions scm/models/objects/application_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)


class ApplicationFilterBaseModel(BaseModel):
class ApplicationFiltersBaseModel(BaseModel):
"""
Base model for Application filter objects containing fields common to all CRUD operations.
Expand Down Expand Up @@ -140,14 +140,14 @@ class ApplicationFilterBaseModel(BaseModel):
)


class ApplicationFilterCreateModel(ApplicationFilterBaseModel):
class ApplicationFiltersCreateModel(ApplicationFiltersBaseModel):
"""
Model for creating a new application filter.
Inherits from ApplicationFilterBaseModel and adds container type validation.
Inherits from ApplicationFiltersBaseModel and adds container type validation.
"""

@model_validator(mode="after")
def validate_container_type(self) -> "ApplicationFilterCreateModel":
def validate_container_type(self) -> "ApplicationFiltersCreateModel":
container_fields = [
"folder",
"snippet",
Expand All @@ -160,7 +160,7 @@ def validate_container_type(self) -> "ApplicationFilterCreateModel":
return self


class ApplicationFilterUpdateModel(ApplicationFilterBaseModel):
class ApplicationFiltersUpdateModel(ApplicationFiltersBaseModel):
"""
Model for updating an existing application filter.
All fields are optional to allow partial updates.
Expand All @@ -173,10 +173,10 @@ class ApplicationFilterUpdateModel(ApplicationFilterBaseModel):
)


class ApplicationFilterResponseModel(ApplicationFilterBaseModel):
class ApplicationFiltersResponseModel(ApplicationFiltersBaseModel):
"""
Model for application filter responses.
Includes all base fields plus the id field.
Includes all base fields plus the (optional!) id field.
"""

id: Optional[UUID] = Field(
Expand Down

0 comments on commit b0ed5d0

Please sign in to comment.