27#include <olp/core/CoreApi.h>
28#include <olp/core/http/NetworkTypes.h>
29#include <olp/core/porting/optional.h>
38 using MicroSeconds = std::chrono::duration<uint32_t, std::micro>;
53 std::array<MicroSeconds, Count>
timings{};
183 uint64_t bytes_uploaded_{0};
185 uint64_t bytes_downloaded_{0};
187 porting::optional<Diagnostics> diagnostics_;
A network response abstraction for the HTTP request.
Definition NetworkResponse.h:62
int GetStatus() const
Gets the HTTP response code.
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.
NetworkResponse & WithDiagnostics(Diagnostics diagnostics)
Sets the request diagnostics.
bool IsCancelled() const
Checks if the associated request was canceled.
RequestId GetRequestId() const
Gets the ID of the associated network request.
const std::string & GetError() const
Gets the human-readable error message if the associated request failed.
const porting::optional< Diagnostics > & GetDiagnostics() const
Gets the optional diagnostics if set.
NetworkResponse & WithBytesDownloaded(uint64_t bytes_downloaded)
Sets the number of bytes downloaded during the associated network request.
uint64_t GetBytesDownloaded() const
Gets the number of bytes downloaded during the associated network request.
NetworkResponse & WithStatus(int status)
Sets the HTTP response code.
NetworkResponse & WithError(std::string error)
Sets the human-readable error message if the associated request failed.
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:37
std::bitset< Count > available_timings
Availability flag, specify which timing is available.
Definition NetworkResponse.h:56
std::array< MicroSeconds, Count > timings
Timing values.
Definition NetworkResponse.h:53