1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverquerystringparameter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsServerQueryStringParameter
{
%Docstring(signature="appended")
The :py:class:`QgsServerQueryStringParameter` class holds the
information regarding a query string input parameter and its validation.
The class is extendable through custom validators (C++ only) and/or by
subclassing and overriding the :py:func:`~value` method.
.. versionadded:: 3.10
%End
%TypeHeaderCode
#include "qgsserverquerystringparameter.h"
%End
public:
static const QMetaObject staticMetaObject;
public:
enum class Type
{
String,
Integer,
Double,
Boolean,
List,
};
QgsServerQueryStringParameter( const QString name, bool required = false, Type type = QgsServerQueryStringParameter::Type::String, const QString &description = QString(), const QVariant &defaultValue = QVariant() );
%Docstring
Constructs a QgsServerQueryStringParameter object.
:param name: parameter name
:param required:
:param type: the parameter type
:param description: parameter description
:param defaultValue: default value, it is ignored if the parameter is
required
%End
virtual ~QgsServerQueryStringParameter();
virtual QVariant value( const QgsServerApiContext &context ) const;
%Docstring
Extracts the value from the request ``context`` by validating the
parameter value and converting it to its proper Type. If the value is
not set and a default was not provided an invalid QVariant is returned.
Validation steps:
- required
- can convert to proper Type
- custom validator (if set - not available in Python bindings)
.. seealso:: :py:func:`setCustomValidator` (not available in Python bindings)
:return: the parameter value or an invalid QVariant if not found (and
not required)
:raises QgsServerApiBadRequestError: if validation fails
%End
QString description() const;
%Docstring
Returns parameter description
%End
static QString typeName( const Type type );
%Docstring
Returns the name of the ``type``
%End
QString name() const;
%Docstring
Returns the name of the parameter
%End
void setDescription( const QString &description );
%Docstring
Sets validator ``description``
%End
bool hidden() const;
%Docstring
Returns ``True`` if the parameter is hidden from the schema.
Hidden params can be useful to implement legacy parameters or parameters
that can be accepted without being advertised.
.. versionadded:: 3.28
%End
void setHidden( bool hidden );
%Docstring
Set the parameter's ``hidden`` status, parameters are not hidden by
default.
.. versionadded:: 3.28
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverquerystringparameter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|