diff --git a/src/middlewared/middlewared/api/v25_04_0/common.py b/src/middlewared/middlewared/api/v25_04_0/common.py index 69f233553eee4..e3f857e894097 100644 --- a/src/middlewared/middlewared/api/v25_04_0/common.py +++ b/src/middlewared/middlewared/api/v25_04_0/common.py @@ -2,7 +2,7 @@ from middlewared.api.base import BaseModel -__all__ = ["QueryOptions", "QueryArgs", "NoArgs", "NoneReturn"] +__all__ = ["QueryOptions", "QueryArgs"] class QueryOptions(BaseModel): @@ -23,11 +23,3 @@ class QueryOptions(BaseModel): class QueryArgs(BaseModel): filters: list[Any] = [] # FIXME: Add validation here options: QueryOptions = QueryOptions() - - -class NoArgs(BaseModel): - pass - - -class NoneReturn(BaseModel): - result: None diff --git a/src/middlewared/middlewared/api/v25_04_0/vendor.py b/src/middlewared/middlewared/api/v25_04_0/vendor.py index 02eb4215c949b..62a83a5a4295a 100644 --- a/src/middlewared/middlewared/api/v25_04_0/vendor.py +++ b/src/middlewared/middlewared/api/v25_04_0/vendor.py @@ -1,5 +1,17 @@ from middlewared.api.base import BaseModel +class VendorNameArgs(BaseModel): + pass + + class VendorNameResult(BaseModel): result: str | None + + +class UnvendorArgs(BaseModel): + pass + + +class UnvendorResult(BaseModel): + result: None diff --git a/src/middlewared/middlewared/plugins/system/vendor/vendor.py b/src/middlewared/middlewared/plugins/system/vendor/vendor.py index 2ae1dcf4e39c6..5acd7a99ad509 100644 --- a/src/middlewared/middlewared/plugins/system/vendor/vendor.py +++ b/src/middlewared/middlewared/plugins/system/vendor/vendor.py @@ -1,7 +1,7 @@ import os from middlewared.api import api_method -from middlewared.api.current import NoArgs, NoneReturn, VendorNameResult +from middlewared.api.current import VendorNameArgs, VendorNameResult, UnvendorArgs, UnvendorResult from middlewared.service import Service @@ -10,7 +10,7 @@ class VendorService(Service): - @api_method(NoArgs, VendorNameResult, private=True) + @api_method(VendorNameArgs, VendorNameResult, private=True) def name(self) -> str | None: try: with open(SENTINEL_FILE_PATH, 'r') as file: @@ -19,7 +19,7 @@ def name(self) -> str | None: except FileNotFoundError: return None - @api_method(NoArgs, NoneReturn, private=True) + @api_method(UnvendorArgs, UnvendorResult, private=True) def unvendor(self): try: os.remove(SENTINEL_FILE_PATH)