mirror of
https://github.com/N4S4/synology-api.git
synced 2025-07-28 07:13:07 +00:00
rename base_api_core to base_api and Core class to BaseApi
login logout method unified/standardized return removed from Classes initialization
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
from __future__ import annotations
|
||||
from typing import Optional, Any
|
||||
from synology_api import auth
|
||||
from . import base_api
|
||||
|
||||
|
||||
class UniversalSearch:
|
||||
class UniversalSearch(base_api.BaseApi):
|
||||
def __init__(self,
|
||||
ip_address: str,
|
||||
port: str,
|
||||
@ -15,19 +15,14 @@ class UniversalSearch:
|
||||
debug: bool = True,
|
||||
otp_code: Optional[str] = None
|
||||
) -> None:
|
||||
self.session: auth.Authentication = auth.Authentication(ip_address, port, username, password, secure,
|
||||
cert_verify, dsm_version, debug, otp_code)
|
||||
self.session.login('Finder')
|
||||
|
||||
super(UniversalSearch, self).__init__(ip_address, port, username, password, secure, cert_verify,
|
||||
dsm_version, debug, otp_code)
|
||||
|
||||
self.session.get_api_list('Finder')
|
||||
self.request_data: Any = self.session.request_data
|
||||
self.finder_list: Any = self.session.app_api_list
|
||||
self._sid: str = self.session.sid
|
||||
self.base_url: str = self.session.base_url
|
||||
return
|
||||
|
||||
def logout(self) -> None:
|
||||
self.session.logout('FileStation')
|
||||
return
|
||||
|
||||
def search(self, keyword: str) -> dict[str, object] | str:
|
||||
api_name = 'SYNO.Finder.FileIndexing.Search'
|
||||
|
Reference in New Issue
Block a user