From 6ecdf14aae1487e797235e94f2f1df096fce6331 Mon Sep 17 00:00:00 2001 From: PrzeG <86780353+PrzeG@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:06:56 +0200 Subject: [PATCH] Add default None values to the Tier model (#16) --- .../templates/payloads/tenant/tenant_model.py | 4 ++-- .../endpoints/monitoring_device_details.py | 20 ++++++++++++------- pyproject.toml | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/catalystwan/api/templates/payloads/tenant/tenant_model.py b/catalystwan/api/templates/payloads/tenant/tenant_model.py index 690031d3..77454178 100644 --- a/catalystwan/api/templates/payloads/tenant/tenant_model.py +++ b/catalystwan/api/templates/payloads/tenant/tenant_model.py @@ -20,8 +20,8 @@ class Tenant(BaseModel): organization_name: str tier_name: str - tenant_info: Optional[TenantInfo] - tier_info: Optional[TierInfo] + tenant_info: Optional[TenantInfo] = None + tier_info: Optional[TierInfo] = None class TenantModel(FeatureTemplate): diff --git a/catalystwan/endpoints/monitoring_device_details.py b/catalystwan/endpoints/monitoring_device_details.py index 955843e0..36c81d5e 100644 --- a/catalystwan/endpoints/monitoring_device_details.py +++ b/catalystwan/endpoints/monitoring_device_details.py @@ -25,22 +25,28 @@ class Tier(BaseModel): vpn: int rid: int = Field(serialization_alias="@rid", validation_alias="@rid") ipv4_route_limit_type: Optional[str] = Field( - serialization_alias="ipv4RouteLimitType", validation_alias="ipv4RouteLimitType" + default=None, serialization_alias="ipv4RouteLimitType", validation_alias="ipv4RouteLimitType" ) ipv4_route_limit_threshold: Optional[int] = Field( - serialization_alias="ipv4RouteLimitThreshold", validation_alias="ipv4RouteLimitThreshold" + default=None, serialization_alias="ipv4RouteLimitThreshold", validation_alias="ipv4RouteLimitThreshold" + ) + ipv4_route_limit: Optional[int] = Field( + default=None, serialization_alias="ipv4RouteLimit", validation_alias="ipv4RouteLimit" ) - ipv4_route_limit: Optional[int] = Field(serialization_alias="ipv4RouteLimit", validation_alias="ipv4RouteLimit") ipv6_route_limit_type: Optional[str] = Field( - serialization_alias="ipv6RouteLimitType", validation_alias="ipv6RouteLimitType" + default=None, serialization_alias="ipv6RouteLimitType", validation_alias="ipv6RouteLimitType" ) ipv6_route_limit_threshold: Optional[int] = Field( - serialization_alias="ipv6RouteLimitThreshold", validation_alias="ipv6RouteLimitThreshold" + default=None, serialization_alias="ipv6RouteLimitThreshold", validation_alias="ipv6RouteLimitThreshold" + ) + ipv6_route_limit: Optional[int] = Field( + default=None, serialization_alias="ipv6RouteLimit", validation_alias="ipv6RouteLimit" ) - ipv6_route_limit: Optional[int] = Field(serialization_alias="ipv6RouteLimit", validation_alias="ipv6RouteLimit") tlocs: List[TLOC] = Field(default=[]) # New in 20.12 version - nat_session_limit: Optional[int] = Field(serialization_alias="natSessionLimit", validation_alias="natSessionLimit") + nat_session_limit: Optional[int] = Field( + default=None, serialization_alias="natSessionLimit", validation_alias="natSessionLimit" + ) class DeviceData(BaseModel): diff --git a/pyproject.toml b/pyproject.toml index 72a7c245..fe01979b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "catalystwan" -version = "0.33.0dev0" +version = "0.33.2" description = "Cisco Catalyst WAN SDK for Python" authors = ["kagorski "] readme = "README.md"