olp-cpp-sdk  1.19.0
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. More...
 
int GetStatus () const
 Gets the HTTP response code. More...
 
NetworkResponseWithStatus (int status)
 Sets the HTTP response code. More...
 
const std::string & GetError () const
 Gets the human-readable error message if the associated request failed. More...
 
NetworkResponseWithError (std::string error)
 Sets the human-readable error message if the associated request failed. More...
 
RequestId GetRequestId () const
 Gets the ID of the associated network request. More...
 
NetworkResponseWithRequestId (RequestId id)
 Sets the ID of the associated network request. More...
 
uint64_t GetBytesUploaded () const
 Gets the number of bytes uploaded during the associated network request. More...
 
NetworkResponseWithBytesUploaded (uint64_t bytes_uploaded)
 Sets the number of bytes uploaded during the associated network request. More...
 
uint64_t GetBytesDownloaded () const
 Gets the number of bytes downloaded during the associated network request. More...
 
NetworkResponseWithBytesDownloaded (uint64_t bytes_downloaded)
 Sets the number of bytes downloaded during the associated network request. More...
 

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.

◆ 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.

◆ 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: