Skip to content

Commit

Permalink
fix: mypy violations
Browse files Browse the repository at this point in the history
  • Loading branch information
sbasan committed Nov 22, 2024
1 parent 96f74d2 commit 03574ef
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
4 changes: 1 addition & 3 deletions catalystwan/models/configuration/feature_profile/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ class WANIPv4StaticRoute(BaseModel):
gateway: Global[Literal["nextHop", "null0", "dhcp"]] = Field(
default=Global(value="nextHop"), serialization_alias="gateway", validation_alias="gateway"
)
next_hops: Optional[List[NextHop]] = Field(
default_factory=list, serialization_alias="nextHop", validation_alias="nextHop"
)
next_hops: Optional[List[NextHop]] = Field(default=None, serialization_alias="nextHop", validation_alias="nextHop")
distance: Optional[Global[int]] = Field(default=None, serialization_alias="distance", validation_alias="distance")

def set_to_next_hop(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ class LoggingParcel(_ParcelBase):
populate_by_name=True,
)
disk: Disk = Field(default_factory=Disk, validation_alias=AliasPath("data", "disk"))
tls_profile: Optional[List[TlsProfile]] = Field(
default_factory=list, validation_alias=AliasPath("data", "tlsProfile")
)
server: Optional[List[Server]] = Field(default_factory=list, validation_alias=AliasPath("data", "server"))
ipv6_server: Optional[List[Server]] = Field(default_factory=list, validation_alias=AliasPath("data", "ipv6Server"))
tls_profile: Optional[List[TlsProfile]] = Field(default=None, validation_alias=AliasPath("data", "tlsProfile"))
server: Optional[List[Server]] = Field(default=None, validation_alias=AliasPath("data", "server"))
ipv6_server: Optional[List[Server]] = Field(default=None, validation_alias=AliasPath("data", "ipv6Server"))

def set_disk(self, enable: bool, disk_file_size: int = 10, disk_file_rotate: int = 10):
self.disk.disk_enable = as_global(enable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class Actions(BaseModel):

class Sequence(BaseModel):
model_config = ConfigDict(populate_by_name=True)
actions: Optional[List[Actions]] = Field(default_factory=list)
actions: Optional[List[Actions]] = Field(default=None)
base_action: Optional[Global[AcceptRejectActionType]] = Field(
default=None, validation_alias="baseAction", serialization_alias="baseAction"
)
Expand Down
2 changes: 1 addition & 1 deletion catalystwan/models/policy/definition/url_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class UrlFilteringDefinition(BaseModel):
logging: List[str] = Field(default_factory=list)
enable_alerts: bool = Field(validation_alias="enableAlerts", serialization_alias="enableAlerts")
alerts: Set[UrlFilteringAlerts] = Field(
default_factory=list, validation_alias="alerts", serialization_alias="alerts"
default_factory=set, validation_alias="alerts", serialization_alias="alerts"
)
target_vpns: List[VpnId] = Field(
default_factory=list, validation_alias="targetVpns", serialization_alias="targetVpns"
Expand Down
4 changes: 2 additions & 2 deletions catalystwan/models/policy/list/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

class IdentityListEntry(BaseModel):
model_config = ConfigDict(populate_by_name=True)
user: str = Field(default=None)
user_group: str = Field(default=None, validation_alias="userGroup", serialization_alias="userGroup")
user: str
user_group: str = Field(validation_alias="userGroup", serialization_alias="userGroup")


class IdentityList(PolicyListBase):
Expand Down

0 comments on commit 03574ef

Please sign in to comment.