From 3d983a1955015ffdc322f530aac74cee096ea5b8 Mon Sep 17 00:00:00 2001 From: acichon Date: Wed, 17 Apr 2024 17:20:21 +0200 Subject: [PATCH 1/4] fix tags field for DeviceDetailsResponse --- catalystwan/endpoints/configuration_device_inventory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalystwan/endpoints/configuration_device_inventory.py b/catalystwan/endpoints/configuration_device_inventory.py index cb4d9675..b4957256 100644 --- a/catalystwan/endpoints/configuration_device_inventory.py +++ b/catalystwan/endpoints/configuration_device_inventory.py @@ -2,7 +2,7 @@ # mypy: disable-error-code="empty-body" from pathlib import Path -from typing import List, Literal, Optional, Union +from typing import Dict, List, Literal, Optional, Union from uuid import UUID from pydantic import BaseModel, ConfigDict, Field @@ -126,7 +126,7 @@ class DeviceDetailsResponse(BaseModel): default=None, validation_alias="resourceGroup", serialization_alias="resourceGroup" ) id: Optional[str] = None - tags: Optional[List[str]] = None + tags: Optional[Union[List[str], List[Dict]]] = None draft_mode: Optional[str] = Field(default=None, validation_alias="draftMode", serialization_alias="draftMode") solution: Optional[str] = None device_lock: Optional[str] = Field(default=None, validation_alias="device-lock", serialization_alias="device-lock") From d669939e6bde4dfa42ec1506a547dcbf51be6681 Mon Sep 17 00:00:00 2001 From: acichon Date: Thu, 18 Apr 2024 13:24:22 +0200 Subject: [PATCH 2/4] enhance modesl for configuration_settings --- catalystwan/endpoints/configuration_settings.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/catalystwan/endpoints/configuration_settings.py b/catalystwan/endpoints/configuration_settings.py index ecc47248..f7e6b421 100644 --- a/catalystwan/endpoints/configuration_settings.py +++ b/catalystwan/endpoints/configuration_settings.py @@ -20,16 +20,16 @@ class Organization(BaseModel): model_config = ConfigDict(populate_by_name=True) org: Optional[str] = Field(default=None) - domain_id: Optional[str] = Field(serialization_alias="domain-id", validation_alias="domain-id") + domain_id: Optional[str] = Field(default=None, serialization_alias="domain-id", validation_alias="domain-id") control_connection_up: Optional[bool] = Field( - serialization_alias="controlConnectionUp", validation_alias="controlConnectionUp" + default=None, serialization_alias="controlConnectionUp", validation_alias="controlConnectionUp" ) class Device(BaseModel): model_config = ConfigDict(populate_by_name=True) domain_ip: Optional[str] = Field(default=None, serialization_alias="domainIp", validation_alias="domainIp") - port: Optional[str] = Field(default="12346") + port: Optional[Union[str, int]] = Field(default="12346") class EmailNotificationSettings(BaseModel): @@ -50,7 +50,9 @@ class Certificate(BaseModel): model_config = ConfigDict(populate_by_name=True) certificate_signing: str = Field(serialization_alias="certificateSigning", validation_alias="certificateSigning") validity_period: str = Field(serialization_alias="validityPeriod", validation_alias="validityPeriod") - retrieve_interval: str = Field(serialization_alias="retrieveInterval", validation_alias="retrieveInterval") + retrieve_interval: Union[str, int] = Field( + serialization_alias="retrieveInterval", validation_alias="retrieveInterval" + ) first_name: Optional[str] = Field(default=None, serialization_alias="firstName", validation_alias="firstName") last_name: Optional[str] = Field(default=None, serialization_alias="lastName", validation_alias="lastName") email: Optional[str] = Field(default=None) From 0c9affcef2ae6314940082c87982bb3558ecd786 Mon Sep 17 00:00:00 2001 From: acichon Date: Thu, 18 Apr 2024 16:46:31 +0200 Subject: [PATCH 3/4] don't use Union --- catalystwan/endpoints/configuration_settings.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/catalystwan/endpoints/configuration_settings.py b/catalystwan/endpoints/configuration_settings.py index f7e6b421..c03ab90a 100644 --- a/catalystwan/endpoints/configuration_settings.py +++ b/catalystwan/endpoints/configuration_settings.py @@ -29,7 +29,7 @@ class Organization(BaseModel): class Device(BaseModel): model_config = ConfigDict(populate_by_name=True) domain_ip: Optional[str] = Field(default=None, serialization_alias="domainIp", validation_alias="domainIp") - port: Optional[Union[str, int]] = Field(default="12346") + port: Optional[str] = Field(default="12346") class EmailNotificationSettings(BaseModel): @@ -50,9 +50,7 @@ class Certificate(BaseModel): model_config = ConfigDict(populate_by_name=True) certificate_signing: str = Field(serialization_alias="certificateSigning", validation_alias="certificateSigning") validity_period: str = Field(serialization_alias="validityPeriod", validation_alias="validityPeriod") - retrieve_interval: Union[str, int] = Field( - serialization_alias="retrieveInterval", validation_alias="retrieveInterval" - ) + retrieve_interval: str = Field(serialization_alias="retrieveInterval", validation_alias="retrieveInterval") first_name: Optional[str] = Field(default=None, serialization_alias="firstName", validation_alias="firstName") last_name: Optional[str] = Field(default=None, serialization_alias="lastName", validation_alias="lastName") email: Optional[str] = Field(default=None) From 293b1fb73ad322ab3cc73495570c7ffbdbe9a2cf Mon Sep 17 00:00:00 2001 From: acichon Date: Mon, 22 Apr 2024 10:12:55 +0200 Subject: [PATCH 4/4] fix for groupId for get_list_of_installed_devices --- catalystwan/endpoints/configuration_device_actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalystwan/endpoints/configuration_device_actions.py b/catalystwan/endpoints/configuration_device_actions.py index 70017111..e5aeb336 100644 --- a/catalystwan/endpoints/configuration_device_actions.py +++ b/catalystwan/endpoints/configuration_device_actions.py @@ -27,7 +27,7 @@ class ActionId(BaseModel): class GroupId(BaseModel): - group_id: str = Field(default="all", serialization_alias="groupID", validation_alias="groupID") + group_id: str = Field(default="all", serialization_alias="groupId", validation_alias="groupId") class ZTPUpgradeSettings(BaseModel):