# (generated with --quick)

import datetime as _datetime
import io
import logging
import requests.models
from typing import Annotated, Any, Callable, Dict, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union

BytesIO: Type[io.BytesIO]
DestinationExists: Any
DirectoryExists: Any
DirectoryExpected: Any
DirectoryNotEmpty: Any
FS: Any
FileExists: Any
FileExpected: Any
Info: Any
Mode: Any
OAuth2Session: Any
ResourceNotFound: Any
ResourceType: Any
SubFS: Any
_log: logging.Logger
basename: Any
datetime: Type[_datetime.datetime]
datetime_to_epoch: Any
dirname: Any
epoch_to_datetime: Any
timezone: Type[_datetime.timezone]

AnyStr = TypeVar('AnyStr', str, bytes)
_T2 = TypeVar('_T2')

class OneDriveFS(Any):
    _drive_root: str
    _meta: Dict[str, Optional[Union[bool, str]]]
    _resource_root: str
    _service_root: str
    session: OneDriveSession
    subfs_class: Type[SubOneDriveFS]
    def __init__(self, clientId, clientSecret, token, SaveToken, tenant = ..., **kwargs) -> None: ...
    def __repr__(self) -> str: ...
    def _itemInfo(self, item) -> Any: ...
    def copy(self, src_path, dst_path, overwrite = ..., preserve_time = ...) -> None: ...
    def create_subscription(self, notification_url, expiration_date_time, client_state) -> Any: ...
    def delete_subscription(self, id_) -> None: ...
    def download_as_format(self, path, output_file, format, **options) -> None: ...
    def getinfo(self, path, namespaces = ...) -> Any: ...
    def listdir(self, path) -> list: ...
    def makedir(self, path, permissions = ..., recreate = ...) -> Any: ...
    def move(self, src_path, dst_path, overwrite = ..., preserve_time = ...) -> None: ...
    def openbin(self, path, mode = ..., buffering = ..., **options) -> _UploadOnClose: ...
    def remove(self, path) -> None: ...
    def removedir(self, path) -> None: ...
    def scandir(self, path, namespaces = ..., page = ...) -> list: ...
    def set_drive(self, driveId = ..., userId = ..., groupId = ..., siteId = ...) -> None: ...
    def setinfo(self, path, info) -> None: ...
    def update_subscription(self, id_, expiration_date_time) -> None: ...

class OneDriveSession(Any):
    _drive_root: Any
    def __init__(self, *args, drive_root, **kwargs) -> None: ...
    def delete_item(self, path, extra = ..., **kwargs) -> Any: ...
    def delete_path(self, path, extra = ..., **kwargs) -> Any: ...
    def get_item(self, path, extra = ..., **kwargs) -> Any: ...
    def get_path(self, path, extra = ..., **kwargs) -> Any: ...
    def item_url(self, itemId, extra) -> str: ...
    def patch_item(self, path, extra = ..., **kwargs) -> Any: ...
    def path_url(self, path, extra) -> str: ...
    def post_item(self, path, extra = ..., **kwargs) -> Any: ...
    def post_path(self, path, extra = ..., **kwargs) -> Any: ...
    def put_item(self, path, extra = ..., **kwargs) -> Any: ...

class SubOneDriveFS(Any):
    def create_subscription(self, notification_url, expiration_date_time, client_state) -> Any: ...
    def delete_subscription(self, id_) -> Any: ...
    def download_as_format(self, path, output_file, format, **options) -> Any: ...
    def update_subscription(self, id_, expiration_date_time) -> Any: ...

class _UploadOnClose(io.BytesIO):
    _closed: bool
    closed: Annotated[bool, 'property']
    itemId: Any
    mode: Annotated[Any, 'property']
    parsedMode: Any
    path: Any
    session: Any
    def _ResumableUpload(self, itemId, filename) -> None: ...
    def __init__(self, session, path, itemId, mode) -> None: ...
    def close(self) -> None: ...
    def read(self, size = ...) -> bytes: ...
    def readable(self) -> Any: ...
    def truncate(self, size = ...) -> int: ...
    def writable(self) -> Any: ...
    def write(self, data) -> int: ...

def _FormatDateTime(dt) -> Any: ...
def _HandleError(response) -> None: ...
def _ParseDateTime(dt) -> _datetime.datetime: ...
def _UpdateDict(dict_, sourceKey, targetKey: _T2, processFn = ...) -> Dict[_T2, Any]: ...
def get(url: Union[bytes, str], params = ..., data = ..., headers = ..., cookies = ..., files = ..., auth = ..., timeout = ..., allow_redirects: bool = ..., proxies = ..., hooks = ..., stream = ..., verify = ..., cert = ..., json = ...) -> requests.models.Response: ...
def getLogger(name: Optional[str] = ...) -> logging.Logger: ...
def urlencode(query: Union[Mapping, Sequence[Tuple[Any, Any]]], doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ..., quote_via: Callable[[str, AnyStr, str, str], str] = ...) -> str: ...
