Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -702,13 +702,13 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
_credentialFlow.unlink();
_passwordFlow.unlink();
_authFlow.link();
QStringList scope;
QStringList scope2;
{{#scopes}}
scope.append("{{scope}}");
scope2.append("{{scope}}");
{{/scopes}}
auto token = _authFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
auto token2 = _authFlow.getToken(scope2.join(" "));
if(token2.isValid())
input.headers.insert("Authorization", "Bearer " + token2.getToken());

_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -725,20 +725,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
});

_latestInput = input;
_latestScope = scope;{{/isCode}}
_latestScope = scope2;{{/isCode}}
{{#isImplicit}}
_OauthMethod = 1;
_implicitFlow.link();
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
QStringList scope1;
{{#scopes}}
scope.append("{{scope}}");
scope1.append("{{scope}}");
{{/scopes}}
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -755,20 +755,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
});

_latestInput = input;
_latestScope = scope;{{/isImplicit}}
_latestScope = scope1;{{/isImplicit}}
{{#isApplication}}
_OauthMethod = 3;
_authFlow.unlink();
_implicitFlow.unlink();
_passwordFlow.unlink();
_credentialFlow.link();
QStringList scope;
QStringList scope3;
{{#scopes}}
scope.append("{{scope}}");
scope3.append("{{scope}}");
{{/scopes}}
auto token = _credentialFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
auto token3 = _credentialFlow.getToken(scope3.join(" "));
if(token3.isValid())
input.headers.insert("Authorization", "Bearer " + token3.getToken());

_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -785,20 +785,20 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
});

_latestInput = input;
_latestScope = scope;{{/isApplication}}
_latestScope = scope3;{{/isApplication}}
{{#isPassword}}
_OauthMethod = 4;
_passwordFlow.link();
_authFlow.unlink();
_implicitFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
QStringList scope4;
{{#scopes}}
scope.append("{{scope}}");
scope4.append("{{scope}}");
{{/scopes}}
auto token = _passwordFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
auto token4 = _passwordFlow.getToken(scope4.join(" "));
if(token4.isValid())
input.headers.insert("Authorization", "Bearer " + token4.getToken());

_latestWorker = new {{prefix}}HttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -815,7 +815,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}}
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope4;
{{/isPassword}}{{/isOAuth}}{{/authMethods}}

worker->execute(&input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) {
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
scope.append("write:pets");
scope.append("read:pets");
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
QStringList scope1;
scope1.append("write:pets");
scope1.append("read:pets");
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new PFXHttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -289,7 +289,7 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) {
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope1;



Expand Down Expand Up @@ -477,12 +477,12 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
scope.append("write:pets");
scope.append("read:pets");
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
QStringList scope1;
scope1.append("write:pets");
scope1.append("read:pets");
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new PFXHttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -497,7 +497,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope1;



Expand Down Expand Up @@ -672,12 +672,12 @@ void PFXPetApi::findPetsByStatus(const QList<QString> &status) {
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
scope.append("write:pets");
scope.append("read:pets");
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
QStringList scope1;
scope1.append("write:pets");
scope1.append("read:pets");
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new PFXHttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -692,7 +692,7 @@ void PFXPetApi::findPetsByStatus(const QList<QString> &status) {
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope1;



Expand Down Expand Up @@ -877,12 +877,12 @@ void PFXPetApi::findPetsByTags(const QList<QString> &tags) {
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
scope.append("write:pets");
scope.append("read:pets");
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
QStringList scope1;
scope1.append("write:pets");
scope1.append("read:pets");
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new PFXHttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -897,7 +897,7 @@ void PFXPetApi::findPetsByTags(const QList<QString> &tags) {
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope1;



Expand Down Expand Up @@ -1089,12 +1089,12 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) {
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
scope.append("write:pets");
scope.append("read:pets");
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
QStringList scope1;
scope1.append("write:pets");
scope1.append("read:pets");
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new PFXHttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -1109,7 +1109,7 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) {
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope1;



Expand Down Expand Up @@ -1220,12 +1220,12 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace::
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
scope.append("write:pets");
scope.append("read:pets");
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
QStringList scope1;
scope1.append("write:pets");
scope1.append("read:pets");
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new PFXHttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -1240,7 +1240,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace::
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope1;



Expand Down Expand Up @@ -1351,12 +1351,12 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona
_passwordFlow.unlink();
_authFlow.unlink();
_credentialFlow.unlink();
QStringList scope;
scope.append("write:pets");
scope.append("read:pets");
auto token = _implicitFlow.getToken(scope.join(" "));
if(token.isValid())
input.headers.insert("Authorization", "Bearer " + token.getToken());
QStringList scope1;
scope1.append("write:pets");
scope1.append("read:pets");
auto token1 = _implicitFlow.getToken(scope1.join(" "));
if(token1.isValid())
input.headers.insert("Authorization", "Bearer " + token1.getToken());

_latestWorker = new PFXHttpRequestWorker(this, _manager);
_latestWorker->setTimeOut(_timeOut);
Expand All @@ -1371,7 +1371,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona
});

_latestInput = input;
_latestScope = scope;
_latestScope = scope1;



Expand Down
Loading
Loading