/**
 * OpenAPI Petstore
 * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#ifndef PFX_PFXPetApi_H
#define PFX_PFXPetApi_H

#include "PFXHelpers.h"
#include "PFXHttpRequest.h"
#include "PFXServerConfiguration.h"
#include "PFXOauth.h"

#include "PFXApiResponse.h"
#include "PFXHttpFileElement.h"
#include "PFXPet.h"
#include <QSet>
#include <QString>

#include <QObject>
#include <QByteArray>
#include <QStringList>
#include <QList>
#include <QNetworkAccessManager>

namespace test_namespace {

class PFXPetApi : public QObject {
    Q_OBJECT

public:
    PFXPetApi(const int timeOut = 0);
    ~PFXPetApi();

    void initializeServerConfigs();
    int setDefaultServerValue(int serverIndex,const QString &operation, const QString &variable,const QString &val);
    void setServerIndex(const QString &operation, int serverIndex);
    void setApiKey(const QString &apiKeyName, const QString &apiKey);
    void setBearerToken(const QString &token);
    void setUsername(const QString &username);
    void setPassword(const QString &password);
    void setTimeOut(const int timeOut);
    void setWorkingDirectory(const QString &path);
    void setNetworkAccessManager(QNetworkAccessManager* manager);
    int addServerConfiguration(const QString &operation, const QUrl &url, const QString &description = "", const QMap<QString, PFXServerVariable> &variables = QMap<QString, PFXServerVariable>());
    void setNewServerForAllOperations(const QUrl &url, const QString &description = "", const QMap<QString, PFXServerVariable> &variables =  QMap<QString, PFXServerVariable>());
    void setNewServer(const QString &operation, const QUrl &url, const QString &description = "", const QMap<QString, PFXServerVariable> &variables =  QMap<QString, PFXServerVariable>());
    void addHeaders(const QString &key, const QString &value);
    void enableRequestCompression();
    void enableResponseCompression();
    void abortRequests();
    QString getParamStylePrefix(const QString &style);
    QString getParamStyleSuffix(const QString &style);
    QString getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode);

    /**
    * @param[in]  pfx_pet PFXPet [required]
    */
    void addPet(const PFXPet &pfx_pet);


    void allPets();

    /**
    * @param[in]  pet_id qint64 [required]
    * @param[in]  api_key QString [optional]
    */
    void deletePet(const qint64 &pet_id, const ::test_namespace::OptionalParam<QString> &api_key = ::test_namespace::OptionalParam<QString>());

    /**
    * @param[in]  status QList<QString> [required]
    */
    void findPetsByStatus(const QList<QString> &status);

    /**
    * @param[in]  tags QList<QString> [required]
    */
    Q_DECL_DEPRECATED void findPetsByTags(const QList<QString> &tags);

    /**
    * @param[in]  pet_id qint64 [required]
    */
    void getPetById(const qint64 &pet_id);

    /**
    * @param[in]  pfx_pet PFXPet [required]
    */
    void updatePet(const PFXPet &pfx_pet);

    /**
    * @param[in]  pet_id qint64 [required]
    * @param[in]  name QString [optional]
    * @param[in]  status QString [optional]
    */
    void updatePetWithForm(const qint64 &pet_id, const ::test_namespace::OptionalParam<QString> &name = ::test_namespace::OptionalParam<QString>(), const ::test_namespace::OptionalParam<QString> &status = ::test_namespace::OptionalParam<QString>());

    /**
    * @param[in]  pet_id qint64 [required]
    * @param[in]  additional_metadata QString [optional]
    * @param[in]  file PFXHttpFileElement [optional]
    */
    void uploadFile(const qint64 &pet_id, const ::test_namespace::OptionalParam<QString> &additional_metadata = ::test_namespace::OptionalParam<QString>(), const ::test_namespace::OptionalParam<PFXHttpFileElement> &file = ::test_namespace::OptionalParam<PFXHttpFileElement>());


private:
    QMap<QString,int> _serverIndices;
    QMap<QString,QList<PFXServerConfiguration>> _serverConfigs;
    QMap<QString, QString> _apiKeys;
    QString _bearerToken;
    QString _username;
    QString _password;
    int _timeOut;
    QString _workingDirectory;
    QNetworkAccessManager* _manager;
    QMap<QString, QString> _defaultHeaders;
    bool _isResponseCompressionEnabled;
    bool _isRequestCompressionEnabled;
    PFXHttpRequestInput _latestInput;
    PFXHttpRequestWorker *_latestWorker;
    QStringList _latestScope;
    OauthCode _authFlow;
    OauthImplicit _implicitFlow;
    OauthCredentials _credentialFlow;
    OauthPassword _passwordFlow;
    int _OauthMethod = 0;

    void addPetCallback(PFXHttpRequestWorker *worker);
    void allPetsCallback(PFXHttpRequestWorker *worker);
    void deletePetCallback(PFXHttpRequestWorker *worker);
    void findPetsByStatusCallback(PFXHttpRequestWorker *worker);
    void findPetsByTagsCallback(PFXHttpRequestWorker *worker);
    void getPetByIdCallback(PFXHttpRequestWorker *worker);
    void updatePetCallback(PFXHttpRequestWorker *worker);
    void updatePetWithFormCallback(PFXHttpRequestWorker *worker);
    void uploadFileCallback(PFXHttpRequestWorker *worker);

signals:

    void addPetSignal();
    void allPetsSignal(QSet<PFXPet> summary);
    void deletePetSignal();
    void findPetsByStatusSignal(QList<PFXPet> summary);
    void findPetsByTagsSignal(QList<PFXPet> summary);
    void getPetByIdSignal(PFXPet summary);
    void updatePetSignal();
    void updatePetWithFormSignal();
    void uploadFileSignal(PFXApiResponse summary);

    void addPetSignalFull(PFXHttpRequestWorker *worker);
    void allPetsSignalFull(PFXHttpRequestWorker *worker, QSet<PFXPet> summary);
    void deletePetSignalFull(PFXHttpRequestWorker *worker);
    void findPetsByStatusSignalFull(PFXHttpRequestWorker *worker, QList<PFXPet> summary);
    void findPetsByTagsSignalFull(PFXHttpRequestWorker *worker, QList<PFXPet> summary);
    void getPetByIdSignalFull(PFXHttpRequestWorker *worker, PFXPet summary);
    void updatePetSignalFull(PFXHttpRequestWorker *worker);
    void updatePetWithFormSignalFull(PFXHttpRequestWorker *worker);
    void uploadFileSignalFull(PFXHttpRequestWorker *worker, PFXApiResponse summary);

    void addPetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
    void allPetsSignalE(QSet<PFXPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
    void deletePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
    void findPetsByStatusSignalE(QList<PFXPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
    void findPetsByTagsSignalE(QList<PFXPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
    void getPetByIdSignalE(PFXPet summary, QNetworkReply::NetworkError error_type, QString error_str);
    void updatePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
    void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString error_str);
    void uploadFileSignalE(PFXApiResponse summary, QNetworkReply::NetworkError error_type, QString error_str);

    void addPetSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void allPetsSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void deletePetSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void findPetsByStatusSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void findPetsByTagsSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void getPetByIdSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void updatePetSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void updatePetWithFormSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
    void uploadFileSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);

    void abortRequestsSignal();
    void allPendingRequestsCompleted();

public slots:
    void tokenAvailable();
    
};

} // namespace test_namespace
#endif
