Attica 5.109.0
Public Types | Public Member Functions | List of all members
Attica::Metadata

Status messages from the server. More...

#include <Attica/Metadata>

Public Types

enum  Error { NoError = 0 , NetworkError , OcsError }
 

Public Member Functions

 Metadata (const Metadata &other)
 
Error error () const
 Check if the job was successful.
 
QList< QNetworkReply::RawHeaderPair > headers () const
 The http headers for the most recent network action in the case of a network error Use this to further inspect the error condition if the OCS status code and string is not enough to work out precisely what has happened (for example in case of a HTTP 503 status, which would suggest the service is down for maintenance for an expected duration which might be read from the Retry-After header).
 
int itemsPerPage ()
 The number of items per page the server was asked for.
 
QString message ()
 An optional additional message from the server.
 
Metadataoperator= (const Metadata &other)
 
QString resultingId ()
 The resulting ID when a PostJob created a new item.
 
void setError (Error error)
 
void setHeaders (const QList< QNetworkReply::RawHeaderPair > &headers)
 Sets the http headers read by headers()
 
void setItemsPerPage (int itemsPerPage)
 
void setMessage (const QString &message)
 
void setResultingId (const QString &id)
 
void setStatusCode (int code)
 
void setStatusString (const QString &status)
 
void setTotalItems (int items)
 
int statusCode () const
 The status as integer.
 
QString statusString () const
 The status of the job, for example "Ok".
 
int totalItems ()
 The number of items returned by this job (only relevant for list jobs)
 

Detailed Description

Status messages from the server.

Member Function Documentation

◆ error()

Error Attica::Metadata::error ( ) const

Check if the job was successful.

Returns
the error state enum returns the type of error (network or ocs)

◆ headers()

QList< QNetworkReply::RawHeaderPair > Attica::Metadata::headers ( ) const

The http headers for the most recent network action in the case of a network error Use this to further inspect the error condition if the OCS status code and string is not enough to work out precisely what has happened (for example in case of a HTTP 503 status, which would suggest the service is down for maintenance for an expected duration which might be read from the Retry-After header).

Returns
The list of raw headers (equivalent to a QNetworkReply::rawHeaderPairs call)
Since
5.83

◆ itemsPerPage()

int Attica::Metadata::itemsPerPage ( )

The number of items per page the server was asked for.

◆ message()

QString Attica::Metadata::message ( )

An optional additional message from the server.

◆ resultingId()

QString Attica::Metadata::resultingId ( )

The resulting ID when a PostJob created a new item.

◆ setHeaders()

void Attica::Metadata::setHeaders ( const QList< QNetworkReply::RawHeaderPair > &  headers)

Sets the http headers read by headers()

Parameters
headersThe new list of raw headers
Since
5.83

◆ statusCode()

int Attica::Metadata::statusCode ( ) const

The status as integer.

If the error is an OCS error, refer to http://www.freedesktop.org/wiki/Specifications/open-collaboration-services in any other case it is the network return code.

◆ statusString()

QString Attica::Metadata::statusString ( ) const

The status of the job, for example "Ok".

◆ totalItems()

int Attica::Metadata::totalItems ( )

The number of items returned by this job (only relevant for list jobs)