MBXDownloadStatus.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <MapboxCommon/MBXDownloadState.h>
  4. @class MBXExpected<__covariant Value, __covariant Error>;
  5. @class MBXDownloadError;
  6. @class MBXDownloadOptions;
  7. @class MBXHttpRequestError;
  8. @class MBXHttpResponseData;
  9. /** Structure to hold current status information about ongoing download session. */
  10. NS_SWIFT_NAME(DownloadStatus)
  11. __attribute__((visibility ("default")))
  12. @interface MBXDownloadStatus : NSObject
  13. // This class provides custom init which should be called
  14. - (nonnull instancetype)init NS_UNAVAILABLE;
  15. // This class provides custom init which should be called
  16. + (nonnull instancetype)new NS_UNAVAILABLE;
  17. /** Download id which was created by download request. */
  18. @property (nonatomic, readwrite) uint64_t downloadId;
  19. /** State of download request. */
  20. @property (nonatomic, readwrite) MBXDownloadState state;
  21. /** The optional which contains error information in case of failure when state is set to DownloadState::Failed. */
  22. @property (nonatomic, readwrite, nullable) MBXDownloadError *error;
  23. /** Total amount of bytes to receive. In some cases this value is unknown until we get final part of the file. */
  24. @property (nonatomic, readwrite, nullable) NSNumber *totalBytes NS_REFINED_FOR_SWIFT;
  25. /**
  26. * Amount of bytes already received and saved on the disk. Includes previous download attempts for a resumed
  27. * download.
  28. */
  29. @property (nonatomic, readwrite) uint64_t receivedBytes;
  30. /**
  31. * Amount of bytes received during the current resume attempt. For downloads that weren't resumed,
  32. * this value will be the same as receivedBytes.
  33. */
  34. @property (nonatomic, readwrite) uint64_t transferredBytes;
  35. /** Download options used to send the download request. */
  36. @property (nonatomic, readwrite, nonnull) MBXDownloadOptions *downloadOptions;
  37. @end