We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bc8c3a commit 1c2e14aCopy full SHA for 1c2e14a
src/tailscale/models.py
@@ -54,6 +54,21 @@ class Device(BaseModel):
54
advertised_routes: List[str] = Field(alias="advertisedRoutes", default_factory=list)
55
client_connectivity: ClientConnectivity = Field(alias="clientConnectivity")
56
57
+ @validator("created", pre=True)
58
+ @classmethod
59
+ def empty_as_none(cls, data: str | None) -> str | None: # noqa: F841
60
+ """Convert an emtpty string to None.
61
+
62
+ Args:
63
+ data: String to convert.
64
65
+ Returns:
66
+ String or none if string is empty.
67
+ """
68
+ if not data:
69
+ return None
70
+ return data
71
72
73
class Devices(BaseModel):
74
"""Object holding Tailscale device information."""
0 commit comments