StorageTaskState.swift 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * Enum representing the internal state of an upload or download task.
  16. */
  17. enum StorageTaskState {
  18. /**
  19. * Unknown task state
  20. */
  21. case unknown
  22. /**
  23. * Task is being queued is ready to run
  24. */
  25. case queueing
  26. /**
  27. * Task is resuming from a paused state
  28. */
  29. case resuming
  30. /**
  31. * Task is currently running
  32. */
  33. case running
  34. /**
  35. * Task reporting a progress event
  36. */
  37. case progress
  38. /**
  39. * Task is pausing
  40. */
  41. case pausing
  42. /**
  43. * Task is completing successfully
  44. */
  45. case completing
  46. /**
  47. * Task is failing unrecoverably
  48. */
  49. case failing
  50. /**
  51. * Task paused successfully
  52. */
  53. case paused
  54. /**
  55. * Task cancelled successfully
  56. */
  57. case cancelled
  58. /**
  59. * Task completed successfully
  60. */
  61. case success
  62. /**
  63. * Task failed unrecoverably
  64. */
  65. case failed
  66. }