#############################################################################
##
## Copyright (C) 2021 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of Qt for Python.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and The Qt Company. For licensing terms
## and conditions see https://www.qt.io/terms-conditions. For further
## information use the contact form at https://www.qt.io/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 3 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL3 included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 3 requirements
## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
##
## GNU General Public License Usage
## Alternatively, this file may be used under the terms of the GNU
## General Public License version 2.0 or (at your option) the GNU General
## Public license version 3 or any later version approved by the KDE Free
## Qt Foundation. The licenses are as published by the Free Software
## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
## included in the packaging of this file. Please review the following
## information to ensure the GNU General Public License requirements will
## be met: https://www.gnu.org/licenses/gpl-2.0.html and
## https://www.gnu.org/licenses/gpl-3.0.html.
##
## $QT_END_LICENSE$
##
#############################################################################
from __future__ import annotations

"""
This file contains the exact signatures for all functions in module
PySide6.QtNetworkAuth, except for defaults which are replaced by "...".
"""

# Module `PySide6.QtNetworkAuth`

import PySide6.QtNetworkAuth
import PySide6.QtCore
import PySide6.QtNetwork

from enum import Enum
from typing import Any, Optional, Tuple, Union, Dict, List, overload
from shiboken6 import Shiboken


class QAbstractOAuth(PySide6.QtCore.QObject):

    class ContentType(Enum):

        WwwFormUrlEncoded        : QAbstractOAuth.ContentType = ... # 0x0
        Json                     : QAbstractOAuth.ContentType = ... # 0x1

    class Error(Enum):

        NoError                  : QAbstractOAuth.Error = ... # 0x0
        NetworkError             : QAbstractOAuth.Error = ... # 0x1
        ServerError              : QAbstractOAuth.Error = ... # 0x2
        OAuthTokenNotFoundError  : QAbstractOAuth.Error = ... # 0x3
        OAuthTokenSecretNotFoundError: QAbstractOAuth.Error = ... # 0x4
        OAuthCallbackNotVerified : QAbstractOAuth.Error = ... # 0x5

    class Stage(Enum):

        RequestingTemporaryCredentials: QAbstractOAuth.Stage = ... # 0x0
        RequestingAuthorization  : QAbstractOAuth.Stage = ... # 0x1
        RequestingAccessToken    : QAbstractOAuth.Stage = ... # 0x2
        RefreshingAccessToken    : QAbstractOAuth.Stage = ... # 0x3

    class Status(Enum):

        NotAuthenticated         : QAbstractOAuth.Status = ... # 0x0
        TemporaryCredentialsReceived: QAbstractOAuth.Status = ... # 0x1
        Granted                  : QAbstractOAuth.Status = ... # 0x2
        RefreshingToken          : QAbstractOAuth.Status = ... # 0x3


    def authorizationUrl(self) -> PySide6.QtCore.QUrl: ...
    def callback(self) -> str: ...
    def clientIdentifier(self) -> str: ...
    def contentType(self) -> PySide6.QtNetworkAuth.QAbstractOAuth.ContentType: ...
    def deleteResource(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def extraTokens(self) -> Dict[str, Any]: ...
    @staticmethod
    def generateRandomString(length: int) -> PySide6.QtCore.QByteArray: ...
    def get(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def grant(self) -> None: ...
    def head(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def networkAccessManager(self) -> PySide6.QtNetwork.QNetworkAccessManager: ...
    def post(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def prepareRequest(self, request: PySide6.QtNetwork.QNetworkRequest, verb: Union[PySide6.QtCore.QByteArray, bytes], body: Union[PySide6.QtCore.QByteArray, bytes] = ...) -> None: ...
    def put(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def replyHandler(self) -> PySide6.QtNetworkAuth.QAbstractOAuthReplyHandler: ...
    def resourceOwnerAuthorization(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any]) -> None: ...
    def setAuthorizationUrl(self, url: Union[PySide6.QtCore.QUrl, str]) -> None: ...
    def setClientIdentifier(self, clientIdentifier: str) -> None: ...
    def setContentType(self, contentType: PySide6.QtNetworkAuth.QAbstractOAuth.ContentType) -> None: ...
    def setModifyParametersFunction(self, modifyParametersFunction: object) -> None: ...
    def setNetworkAccessManager(self, networkAccessManager: PySide6.QtNetwork.QNetworkAccessManager) -> None: ...
    def setReplyHandler(self, handler: PySide6.QtNetworkAuth.QAbstractOAuthReplyHandler) -> None: ...
    def setStatus(self, status: PySide6.QtNetworkAuth.QAbstractOAuth.Status) -> None: ...
    def setToken(self, token: str) -> None: ...
    def status(self) -> PySide6.QtNetworkAuth.QAbstractOAuth.Status: ...
    def token(self) -> str: ...


class QAbstractOAuth2(PySide6.QtNetworkAuth.QAbstractOAuth):

    @overload
    def __init__(self, manager: PySide6.QtNetwork.QNetworkAccessManager, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...

    def clientIdentifierSharedKey(self) -> str: ...
    def createAuthenticatedUrl(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtCore.QUrl: ...
    def deleteResource(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def expirationAt(self) -> PySide6.QtCore.QDateTime: ...
    def get(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def head(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    @overload
    def post(self, url: Union[PySide6.QtCore.QUrl, str], data: Union[PySide6.QtCore.QByteArray, bytes]) -> PySide6.QtNetwork.QNetworkReply: ...
    @overload
    def post(self, url: Union[PySide6.QtCore.QUrl, str], multiPart: PySide6.QtNetwork.QHttpMultiPart) -> PySide6.QtNetwork.QNetworkReply: ...
    @overload
    def post(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def prepareRequest(self, request: PySide6.QtNetwork.QNetworkRequest, verb: Union[PySide6.QtCore.QByteArray, bytes], body: Union[PySide6.QtCore.QByteArray, bytes] = ...) -> None: ...
    @overload
    def put(self, url: Union[PySide6.QtCore.QUrl, str], data: Union[PySide6.QtCore.QByteArray, bytes]) -> PySide6.QtNetwork.QNetworkReply: ...
    @overload
    def put(self, url: Union[PySide6.QtCore.QUrl, str], multiPart: PySide6.QtNetwork.QHttpMultiPart) -> PySide6.QtNetwork.QNetworkReply: ...
    @overload
    def put(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def refreshToken(self) -> str: ...
    def responseType(self) -> str: ...
    def scope(self) -> str: ...
    def setClientIdentifierSharedKey(self, clientIdentifierSharedKey: str) -> None: ...
    def setRefreshToken(self, refreshToken: str) -> None: ...
    def setResponseType(self, responseType: str) -> None: ...
    def setScope(self, scope: str) -> None: ...
    def setState(self, state: str) -> None: ...
    def setUserAgent(self, userAgent: str) -> None: ...
    def state(self) -> str: ...
    def userAgent(self) -> str: ...


class QAbstractOAuthReplyHandler(PySide6.QtCore.QObject):

    def __init__(self, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...

    def callback(self) -> str: ...
    def networkReplyFinished(self, reply: PySide6.QtNetwork.QNetworkReply) -> None: ...


class QIntList(object): ...


class QOAuth1(PySide6.QtNetworkAuth.QAbstractOAuth):

    class SignatureMethod(Enum):

        Hmac_Sha1                : QOAuth1.SignatureMethod = ... # 0x0
        Rsa_Sha1                 : QOAuth1.SignatureMethod = ... # 0x1
        PlainText                : QOAuth1.SignatureMethod = ... # 0x2


    @overload
    def __init__(self, clientIdentifier: str, clientSharedSecret: str, manager: PySide6.QtNetwork.QNetworkAccessManager, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, manager: PySide6.QtNetwork.QNetworkAccessManager, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...

    def clientCredentials(self) -> Tuple[str, str]: ...
    def clientSharedSecret(self) -> str: ...
    def continueGrantWithVerifier(self, verifier: str) -> None: ...
    def deleteResource(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    @staticmethod
    def generateAuthorizationHeader(oauthParams: Dict[str, Any]) -> PySide6.QtCore.QByteArray: ...
    def get(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def grant(self) -> None: ...
    def head(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    @staticmethod
    def nonce() -> PySide6.QtCore.QByteArray: ...
    def post(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def prepareRequest(self, request: PySide6.QtNetwork.QNetworkRequest, verb: Union[PySide6.QtCore.QByteArray, bytes], body: Union[PySide6.QtCore.QByteArray, bytes] = ...) -> None: ...
    def put(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def requestTemporaryCredentials(self, operation: PySide6.QtNetwork.QNetworkAccessManager.Operation, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    def requestTokenCredentials(self, operation: PySide6.QtNetwork.QNetworkAccessManager.Operation, url: Union[PySide6.QtCore.QUrl, str], temporaryToken: Tuple[str, str], parameters: Dict[str, Any] = ...) -> PySide6.QtNetwork.QNetworkReply: ...
    @overload
    def setClientCredentials(self, clientCredentials: Tuple[str, str]) -> None: ...
    @overload
    def setClientCredentials(self, clientIdentifier: str, clientSharedSecret: str) -> None: ...
    def setClientSharedSecret(self, clientSharedSecret: str) -> None: ...
    def setSignatureMethod(self, value: PySide6.QtNetworkAuth.QOAuth1.SignatureMethod) -> None: ...
    def setTemporaryCredentialsUrl(self, url: Union[PySide6.QtCore.QUrl, str]) -> None: ...
    @overload
    def setTokenCredentials(self, token: str, tokenSecret: str) -> None: ...
    @overload
    def setTokenCredentials(self, tokenCredentials: Tuple[str, str]) -> None: ...
    def setTokenCredentialsUrl(self, url: Union[PySide6.QtCore.QUrl, str]) -> None: ...
    def setTokenSecret(self, tokenSecret: str) -> None: ...
    @overload
    def setup(self, request: PySide6.QtNetwork.QNetworkRequest, signingParameters: Dict[str, Any], operation: PySide6.QtNetwork.QNetworkAccessManager.Operation) -> None: ...
    @overload
    def setup(self, request: PySide6.QtNetwork.QNetworkRequest, signingParameters: Dict[str, Any], operationVerb: Union[PySide6.QtCore.QByteArray, bytes]) -> None: ...
    def signatureMethod(self) -> PySide6.QtNetworkAuth.QOAuth1.SignatureMethod: ...
    def temporaryCredentialsUrl(self) -> PySide6.QtCore.QUrl: ...
    def tokenCredentials(self) -> Tuple[str, str]: ...
    def tokenCredentialsUrl(self) -> PySide6.QtCore.QUrl: ...
    def tokenSecret(self) -> str: ...


class QOAuth1Signature(Shiboken.Object):

    class HttpRequestMethod(Enum):

        Unknown                  : QOAuth1Signature.HttpRequestMethod = ... # 0x0
        Head                     : QOAuth1Signature.HttpRequestMethod = ... # 0x1
        Get                      : QOAuth1Signature.HttpRequestMethod = ... # 0x2
        Put                      : QOAuth1Signature.HttpRequestMethod = ... # 0x3
        Post                     : QOAuth1Signature.HttpRequestMethod = ... # 0x4
        Delete                   : QOAuth1Signature.HttpRequestMethod = ... # 0x5
        Custom                   : QOAuth1Signature.HttpRequestMethod = ... # 0x6


    @overload
    def __init__(self, other: PySide6.QtNetworkAuth.QOAuth1Signature) -> None: ...
    @overload
    def __init__(self, url: Union[PySide6.QtCore.QUrl, str], clientSharedKey: str, tokenSecret: str, method: PySide6.QtNetworkAuth.QOAuth1Signature.HttpRequestMethod = ..., parameters: Dict[str, Any] = ...) -> None: ...
    @overload
    def __init__(self, url: Union[PySide6.QtCore.QUrl, str] = ..., method: PySide6.QtNetworkAuth.QOAuth1Signature.HttpRequestMethod = ..., parameters: Dict[str, Any] = ...) -> None: ...

    @staticmethod
    def __copy__() -> None: ...
    def addRequestBody(self, body: PySide6.QtCore.QUrlQuery) -> None: ...
    def clientSharedKey(self) -> str: ...
    def customMethodString(self) -> PySide6.QtCore.QByteArray: ...
    def hmacSha1(self) -> PySide6.QtCore.QByteArray: ...
    def httpRequestMethod(self) -> PySide6.QtNetworkAuth.QOAuth1Signature.HttpRequestMethod: ...
    def insert(self, key: str, value: Any) -> None: ...
    def keys(self) -> List[str]: ...
    def parameters(self) -> Dict[str, Any]: ...
    @overload
    @staticmethod
    def plainText(clientSharedSecret: str, tokenSecret: str) -> PySide6.QtCore.QByteArray: ...
    @overload
    def plainText(self) -> PySide6.QtCore.QByteArray: ...
    def rsaSha1(self) -> PySide6.QtCore.QByteArray: ...
    def setClientSharedKey(self, secret: str) -> None: ...
    def setCustomMethodString(self, verb: Union[PySide6.QtCore.QByteArray, bytes]) -> None: ...
    def setHttpRequestMethod(self, method: PySide6.QtNetworkAuth.QOAuth1Signature.HttpRequestMethod) -> None: ...
    def setParameters(self, parameters: Dict[str, Any]) -> None: ...
    def setTokenSecret(self, secret: str) -> None: ...
    def setUrl(self, url: Union[PySide6.QtCore.QUrl, str]) -> None: ...
    def swap(self, other: PySide6.QtNetworkAuth.QOAuth1Signature) -> None: ...
    def take(self, key: str) -> Any: ...
    def tokenSecret(self) -> str: ...
    def url(self) -> PySide6.QtCore.QUrl: ...
    def value(self, key: str, defaultValue: Any = ...) -> Any: ...


class QOAuth2AuthorizationCodeFlow(PySide6.QtNetworkAuth.QAbstractOAuth2):

    @overload
    def __init__(self, authorizationUrl: Union[PySide6.QtCore.QUrl, str], accessTokenUrl: Union[PySide6.QtCore.QUrl, str], manager: PySide6.QtNetwork.QNetworkAccessManager, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, clientIdentifier: str, authorizationUrl: Union[PySide6.QtCore.QUrl, str], accessTokenUrl: Union[PySide6.QtCore.QUrl, str], manager: PySide6.QtNetwork.QNetworkAccessManager, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, clientIdentifier: str, manager: PySide6.QtNetwork.QNetworkAccessManager, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, manager: PySide6.QtNetwork.QNetworkAccessManager, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...

    def accessTokenUrl(self) -> PySide6.QtCore.QUrl: ...
    def buildAuthenticateUrl(self, parameters: Dict[str, Any] = ...) -> PySide6.QtCore.QUrl: ...
    def grant(self) -> None: ...
    def refreshAccessToken(self) -> None: ...
    def requestAccessToken(self, code: str) -> None: ...
    def resourceOwnerAuthorization(self, url: Union[PySide6.QtCore.QUrl, str], parameters: Dict[str, Any] = ...) -> None: ...
    def setAccessTokenUrl(self, accessTokenUrl: Union[PySide6.QtCore.QUrl, str]) -> None: ...


class QOAuthHttpServerReplyHandler(PySide6.QtNetworkAuth.QOAuthOobReplyHandler):

    @overload
    def __init__(self, address: Union[PySide6.QtNetwork.QHostAddress, PySide6.QtNetwork.QHostAddress.SpecialAddress], port: int, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...
    @overload
    def __init__(self, port: int, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...

    def callback(self) -> str: ...
    def callbackPath(self) -> str: ...
    def callbackText(self) -> str: ...
    def close(self) -> None: ...
    def isListening(self) -> bool: ...
    def listen(self, address: Union[PySide6.QtNetwork.QHostAddress, PySide6.QtNetwork.QHostAddress.SpecialAddress] = ..., port: int = ...) -> bool: ...
    def port(self) -> int: ...
    def setCallbackPath(self, path: str) -> None: ...
    def setCallbackText(self, text: str) -> None: ...


class QOAuthOobReplyHandler(PySide6.QtNetworkAuth.QAbstractOAuthReplyHandler):

    def __init__(self, parent: Optional[PySide6.QtCore.QObject] = ...) -> None: ...

    def callback(self) -> str: ...
    def networkReplyFinished(self, reply: PySide6.QtNetwork.QNetworkReply) -> None: ...


# eof
