QtRestClient  3.0.0
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
Public Member Functions | List of all members
QtRestClient::Auth::AuthRestClient Class Reference

An extension of the RestClient that uses a AuthRequestBuilder to create authenticated requests. More...

#include <authrestclient.h>

+ Inheritance diagram for QtRestClient::Auth::AuthRestClient:

Public Member Functions

 AuthRestClient (QAbstractOAuth *oAuth, QObject *parent=nullptr)
 Constructor with the OAuth instance to use for authenticating requests.
 
 AuthRestClient (DataMode dataMode, QAbstractOAuth *oAuth, QObject *parent=nullptr)
 Constructor with the data mode and an OAuth instance to use for authenticating requests.
 
 AuthRestClient (QtJsonSerializer::SerializerBase *serializer, QAbstractOAuth *oAuth, QObject *parent=nullptr)
 Constructor with a serializer and an OAuth instance to use for authenticating requests.
 
QAbstractOAuthoAuth () const
 Returns the used OAuth instance.
 
AuthRequestBuilder authBuilder () const
 Returns the same as builder(), but as AuthRequestBuilder instance.
 
RequestBuilder builder () const override
 Creates a request builder with all the settings of this client. More...
 
- Public Member Functions inherited from QtRestClient::RestClient
 RestClient (QObject *parent=nullptr)
 Constructor.
 
 RestClient (DataMode dataMode, QObject *parent=nullptr)
 Constructor with a data mode.
 
 RestClient (QtJsonSerializer::SerializerBase *serializer, QObject *parent=nullptr)
 Constructor with a serializer.
 
RestClasscreateClass (const QString &path, QObject *parent=nullptr)
 Creates a new rest class for the given path and parent. More...
 
RestClassrootClass () const
 Returns the rest class with the root path. More...
 
QNetworkAccessManagermanager () const
 Returns the network access manager used by the restclient. More...
 
QtJsonSerializer::SerializerBaseserializer () const
 Returns the json serializer used by the restclient. More...
 
IPagingFactorypagingFactory () const
 Returns the paging factory used by the restclient. More...
 
DataMode dataMode () const
 READ accessor for RestClient::dataMode.
 
QUrl baseUrl () const
 READ accessor for RestClient::baseUrl.
 
QVersionNumber apiVersion () const
 READ accessor for RestClient::apiVersion.
 
HeaderHash globalHeaders () const
 READ accessor for RestClient::globalHeaders.
 
QUrlQuery globalParameters () const
 READ accessor for RestClient::globalParameters.
 
QHash< QNetworkRequest::Attribute, QVariantrequestAttributes () const
 READ accessor for RestClient::requestAttributes.
 
bool isThreaded () const
 READ accessor for RestClient::threaded.
 
QSslConfiguration sslConfiguration () const
 READ accessor for RestClient::sslConfiguration.
 
QThreadPoolasyncPool () const
 READ accessor for RestClient::asyncPool.
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () const const
 
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
bool signalsBlocked () const const
 
bool blockSignals (bool block)
 
QThreadthread () const const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () const const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const const
 
void dumpObjectInfo () const const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const const
 
QList< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 

Additional Inherited Members

- Public Types inherited from QtRestClient::RestClient
enum  DataMode { DataMode::Cbor, DataMode::Json }
 The different data modes in which the client can operate. More...
 
- Public Slots inherited from QtRestClient::RestClient
void setManager (QNetworkAccessManager *manager)
 Sets the network access manager to be used by all requests for this client. More...
 
void setSerializer (QtJsonSerializer::SerializerBase *serializer)
 Sets the json serializer to be used by all requests for this client. More...
 
void setPagingFactory (IPagingFactory *factory)
 Sets the paging factory to be used by all paging requests for this client. More...
 
void setDataMode (DataMode dataMode)
 WRITE accessor for RestClient::dataMode.
 
void setBaseUrl (QUrl baseUrl)
 WRITE accessor for RestClient::baseUrl.
 
void setApiVersion (QVersionNumber apiVersion)
 WRITE accessor for RestClient::apiVersion.
 
void setGlobalHeaders (HeaderHash globalHeaders)
 WRITE accessor for RestClient::globalHeaders.
 
void setGlobalParameters (QUrlQuery globalParameters)
 WRITE accessor for RestClient::globalParameters.
 
void setRequestAttributes (QHash< QNetworkRequest::Attribute, QVariant > requestAttributes)
 WRITE accessor for RestClient::requestAttributes.
 
void setModernAttributes ()
 Sets modern attributes in RestClient::requestAttributes. More...
 
void setThreaded (bool threaded)
 WRITE accessor for RestClient::threaded.
 
void setSslConfiguration (QSslConfiguration sslConfiguration)
 WRITE accessor for RestClient::sslConfiguration.
 
void setAsyncPool (QThreadPool *asyncPool)
 WRITE accessor for RestClient::asyncPool.
 
void addGlobalHeader (const QByteArray &name, const QByteArray &value)
 WRITE accessor for RestClient::globalHeaders.
 
void removeGlobalHeader (const QByteArray &name)
 WRITE accessor for RestClient::globalHeaders.
 
void addGlobalParameter (const QString &name, const QString &value)
 WRITE accessor for RestClient::globalParameters.
 
void removeGlobalParameter (const QString &name)
 WRITE accessor for RestClient::globalParameters.
 
void addRequestAttribute (QNetworkRequest::Attribute attribute, const QVariant &value)
 WRITE accessor for RestClient::requestAttributes.
 
void removeRequestAttribute (QNetworkRequest::Attribute attribute)
 WRITE accessor for RestClient::requestAttributes.
 
- Signals inherited from QtRestClient::RestClient
void dataModeChanged (DataMode dataMode, QPrivateSignal)
 NOTIFY accessor for RestClient::dataMode.
 
void baseUrlChanged (QUrl baseUrl, QPrivateSignal)
 NOTIFY accessor for RestClient::baseUrl.
 
void apiVersionChanged (QVersionNumber apiVersion, QPrivateSignal)
 NOTIFY accessor for RestClient::apiVersion.
 
void globalHeadersChanged (HeaderHash globalHeaders, QPrivateSignal)
 NOTIFY accessor for RestClient::globalHeaders.
 
void globalParametersChanged (QUrlQuery globalParameters, QPrivateSignal)
 NOTIFY accessor for RestClient::globalParameters.
 
void requestAttributesChanged (QHash< QNetworkRequest::Attribute, QVariant > requestAttributes, QPrivateSignal)
 NOTIFY accessor for RestClient::requestAttributes.
 
void threadedChanged (bool threaded, QPrivateSignal)
 NOTIFY accessor for RestClient::threaded.
 
void sslConfigurationChanged (QSslConfiguration sslConfiguration, QPrivateSignal)
 NOTIFY accessor for RestClient::sslConfiguration.
 
void asyncPoolChanged (QThreadPool *asyncPool, QPrivateSignal)
 NOTIFY accessor for RestClient::asyncPool.
 
- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
QObjectsender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
- Properties inherited from QtRestClient::RestClient
DataMode dataMode
 The data mode the client is currently in. More...
 
QUrl baseUrl
 The base URL to be used for every request to that api. More...
 
QVersionNumber apiVersion
 The version number to be appended to the path. More...
 
HeaderHash globalHeaders
 A collection of headers to be added to every request. More...
 
QUrlQuery globalParameters
 A URL Query with parameters to be added to every request. More...
 
QHash< QNetworkRequest::Attribute, QVariantrequestAttributes
 A collection of attributes to be set on every request. More...
 
bool threaded
 Specifies, whether the client can be used in a multithreaded context. More...
 
QSslConfiguration sslConfiguration
 The SSL configuration to be used for HTTPS. More...
 
QThreadPool asyncPool
 Holds a thread pool to be used by all replies created via this clients classes. More...
 
- Properties inherited from QObject
 objectName
 

Detailed Description

An extension of the RestClient that uses a AuthRequestBuilder to create authenticated requests.

Definition at line 13 of file authrestclient.h.

Member Function Documentation

◆ builder()

RequestBuilder QtRestClient::Auth::AuthRestClient::builder ( ) const
overridevirtual

Creates a request builder with all the settings of this client.

Returns
A request builder, prepared with all the settings of the rest client

If you need to set additional properties on the builder, that are not provided by the rest client itself, you can override this function. To preserve all the properties override as follows:

RequestBuilder MyClient::builder() const override {
.set...
}
See also
RestClass::builder

Reimplemented from QtRestClient::RestClient.


The documentation for this class was generated from the following file:
QtRestClient::RestClient::builder
virtual RequestBuilder builder() const
Creates a request builder with all the settings of this client.
Definition: restclient.cpp:144