olp-cpp-sdk 1.25.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olp::http::NetworkResponse Class Referencefinal

A network response abstraction for the HTTP request. More...

#include <NetworkResponse.h>

Public Member Functions

bool IsCancelled () const
 Checks if the associated request was canceled.
 
int GetStatus () const
 Gets the HTTP response code.
 
NetworkResponse & WithStatus (int status)
 Sets the HTTP response code.
 
const std::string & GetError () const
 Gets the human-readable error message if the associated request failed.
 
NetworkResponse & WithError (std::string error)
 Sets the human-readable error message if the associated request failed.
 
RequestId GetRequestId () const
 Gets the ID of the associated network request.
 
NetworkResponse & WithRequestId (RequestId id)
 Sets the ID of the associated network request.
 
uint64_t GetBytesUploaded () const
 Gets the number of bytes uploaded during the associated network request.
 
NetworkResponse & WithBytesUploaded (uint64_t bytes_uploaded)
 Sets the number of bytes uploaded during the associated network request.
 
uint64_t GetBytesDownloaded () const
 Gets the number of bytes downloaded during the associated network request.
 
NetworkResponse & WithBytesDownloaded (uint64_t bytes_downloaded)
 Sets the number of bytes downloaded during the associated network request.
 
const porting::optional< Diagnostics > & GetDiagnostics () const
 Gets the optional diagnostics if set.
 
NetworkResponse & WithDiagnostics (Diagnostics diagnostics)
 Sets the request diagnostics.
 

Detailed Description

A network response abstraction for the HTTP request.

Member Function Documentation

◆ GetBytesDownloaded()

uint64_t olp::http::NetworkResponse::GetBytesDownloaded ( ) const

Gets the number of bytes downloaded during the associated network request.

Returns
The number of bytes downloaded during the associated network request.

◆ GetBytesUploaded()

uint64_t olp::http::NetworkResponse::GetBytesUploaded ( ) const

Gets the number of bytes uploaded during the associated network request.

Returns
The number of bytes uploaded during the associated network request.

◆ GetDiagnostics()

const porting::optional< Diagnostics > & olp::http::NetworkResponse::GetDiagnostics ( ) const

Gets the optional diagnostics if set.

Returns
Diagnostic values.

◆ GetError()

const std::string & olp::http::NetworkResponse::GetError ( ) const

Gets the human-readable error message if the associated request failed.

Returns
The human-readable error message if the associated request failed.

◆ GetRequestId()

RequestId olp::http::NetworkResponse::GetRequestId ( ) const

Gets the ID of the associated network request.

Returns
The ID of the associated network request.

◆ GetStatus()

int olp::http::NetworkResponse::GetStatus ( ) const

Gets the HTTP response code.

Returns
The HTTP response code.

◆ IsCancelled()

bool olp::http::NetworkResponse::IsCancelled ( ) const

Checks if the associated request was canceled.

Returns
True if the associated request was canceled; false otherwise.

◆ WithBytesDownloaded()

NetworkResponse & olp::http::NetworkResponse::WithBytesDownloaded ( uint64_t  bytes_downloaded)

Sets the number of bytes downloaded during the associated network request.

Parameters
[in]bytes_downloadedThe number of downloaded bytes.
Returns
A reference to *this.

◆ WithBytesUploaded()

NetworkResponse & olp::http::NetworkResponse::WithBytesUploaded ( uint64_t  bytes_uploaded)

Sets the number of bytes uploaded during the associated network request.

Parameters
[in]bytes_uploadedThe number of uploaded bytes.
Returns
A reference to *this.

◆ WithDiagnostics()

NetworkResponse & olp::http::NetworkResponse::WithDiagnostics ( Diagnostics  diagnostics)

Sets the request diagnostics.

Parameters
diagnosticsDiagnostics values.
Returns
A reference to *this.

◆ WithError()

NetworkResponse & olp::http::NetworkResponse::WithError ( std::string  error)

Sets the human-readable error message if the associated request failed.

Parameters
[in]errorThe human-readable error message if the associated request failed.
Returns
A reference to *this.

◆ WithRequestId()

NetworkResponse & olp::http::NetworkResponse::WithRequestId ( RequestId  id)

Sets the ID of the associated network request.

Parameters
[in]idThe ID of the associated network request.
Returns
A reference to *this.

◆ WithStatus()

NetworkResponse & olp::http::NetworkResponse::WithStatus ( int  status)

Sets the HTTP response code.

Parameters
[in]statusThe HTTP response code.
Returns
A reference to *this.

The documentation for this class was generated from the following file: