basyskom-dege febd65d3b8
Qt5 parameterized server (#8183)
* first Commit parameterzied Server support

* fixed serverconfig classes

* Defautl constructor f. Config, fixed regex replace

* Polosihed Templates, Added MultiServer support

* Update Readme. Fixed MultiServer. Fixed def. Value

* Passing global Server to mustache. Small fixes

* Updated  samples, fixed mustache for multi server

* added prefixes, removed unused imports

* added newly generated samples

* missing vendorExtension in mustache. Update smaple

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-19 11:34:12 +08:00

59 lines
1.6 KiB
C++

/**
* 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.
*/
/**
* Representing a Server Variable for server URL template substitution.
*/
#ifndef PFX_SERVERVARIABLE_H
#define PFX_SERVERVARIABLE_H
#include <QString>
#include <QSet>
namespace test_namespace {
class PFXServerVariable {
public:
/**
* @param description A description for the server variable.
* @param defaultValue The default value to use for substitution.
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
*/
PFXServerVariable(const QString &description, const QString &defaultValue, const QSet<QString> &enumValues)
: _defaultValue(defaultValue),
_description(description),
_enumValues(enumValues){}
PFXServerVariable(){}
~PFXServerVariable(){}
int setDefaultValue(const QString& value){
if( _enumValues.contains(value)){
_defaultValue = value;
return 0;
}
return -2;
}
QString getDefaultValue(){return _defaultValue;}
QSet<QString> getEnumValues(){return _enumValues;}
QString _defaultValue;
QString _description;
QSet<QString> _enumValues;
};
} // namespace test_namespace
#endif // PFX_SERVERVARIABLE_H