mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-31 07:12:23 -07:00
feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ from __future__ import annotations
|
||||
|
||||
import re
|
||||
import ipaddress
|
||||
from typing import Optional, List, Literal, Any, Dict
|
||||
from typing import Optional, List, Literal, Any, Dict, Union
|
||||
from pydantic import BaseModel, Field, field_validator, model_validator, ConfigDict, RootModel
|
||||
|
||||
# Internal helper imports
|
||||
@@ -279,6 +279,22 @@ class LockDeviceFieldRequest(BaseModel):
|
||||
lock: bool = Field(True, description="True to lock the field, False to unlock")
|
||||
|
||||
|
||||
class UnlockDeviceFieldsRequest(BaseModel):
|
||||
"""Request to unlock/clear device fields for one or multiple devices."""
|
||||
mac: Optional[Union[str, List[str]]] = Field(
|
||||
None,
|
||||
description="Single MAC, list of MACs, or None to target all devices"
|
||||
)
|
||||
fields: Optional[List[str]] = Field(
|
||||
None,
|
||||
description="List of field names to unlock. If omitted, all tracked fields will be unlocked"
|
||||
)
|
||||
clear_all: bool = Field(
|
||||
False,
|
||||
description="True to clear all sources, False to clear only LOCKED/USER"
|
||||
)
|
||||
|
||||
|
||||
class DeviceUpdateRequest(BaseModel):
|
||||
"""Request to update device fields (create/update)."""
|
||||
model_config = ConfigDict(extra="allow")
|
||||
|
||||
Reference in New Issue
Block a user