27 #include <boost/optional/optional.hpp>
29 #include <olp/core/CoreApi.h>
30 #include <olp/core/http/NetworkTypes.h>
39 using MicroSeconds = std::chrono::duration<uint32_t, std::micro>;
54 std::array<MicroSeconds, Count>
timings{};
184 uint64_t bytes_uploaded_{0};
186 uint64_t bytes_downloaded_{0};
188 boost::optional<Diagnostics> diagnostics_;
A network response abstraction for the HTTP request.
Definition: NetworkResponse.h:63
int GetStatus() const
Gets the HTTP response code.
NetworkResponse & WithBytesDownloaded(uint64_t bytes_downloaded)
Sets the number of bytes downloaded during the associated network request.
const std::string & GetError() const
Gets the human-readable error message if the associated request failed.
uint64_t GetBytesUploaded() const
Gets the number of bytes uploaded during the associated network request.
NetworkResponse & WithStatus(int status)
Sets the HTTP response code.
NetworkResponse & WithRequestId(RequestId id)
Sets the ID of the associated network request.
NetworkResponse & WithError(std::string error)
Sets the human-readable error message if the associated request failed.
bool IsCancelled() const
Checks if the associated request was canceled.
RequestId GetRequestId() const
Gets the ID of 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.
const boost::optional< Diagnostics > & GetDiagnostics() const
Gets the optional diagnostics if set.
NetworkResponse & WithDiagnostics(Diagnostics diagnostics)
Sets the request diagnostics.
std::uint64_t RequestId
A unique request ID.
Definition: NetworkTypes.h:41
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24
Network request timings.
Definition: NetworkResponse.h:38
std::bitset< Count > available_timings
Availability flag, specify which timing is available.
Definition: NetworkResponse.h:57
std::array< MicroSeconds, Count > timings
Timing values.
Definition: NetworkResponse.h:54