StorageListResult.swift 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. import Foundation
  15. import FirebaseStorageInternal
  16. /** Contains the prefixes and items returned by a `StorageReference.list()` call. */
  17. @objc(FIRStorageListResult) open class StorageListResult: NSObject {
  18. /**
  19. * The prefixes (folders) returned by the `list()` operation.
  20. *
  21. * @return A list of prefixes (folders).
  22. */
  23. @objc public let prefixes: [StorageReference]
  24. /**
  25. * Returns a token that can be used to resume a previous `list()` operation. `nil`
  26. * indicates that there are no more results.
  27. *
  28. * @return A page token if more results are available.
  29. */
  30. @objc public let items: [StorageReference]
  31. /**
  32. * Returns a token that can be used to resume a previous `list()` operation. `nil`
  33. * indicates that there are no more results.
  34. *
  35. * @return A page token if more results are available.
  36. */
  37. @objc public let pageToken: String?
  38. // MARK: - NSObject overrides
  39. @objc override open func copy() -> Any {
  40. return StorageListResult(impl.copy() as! FIRIMPLStorageListResult)
  41. }
  42. // MARK: - Internal APIs
  43. internal let impl: FIRIMPLStorageListResult
  44. internal init(_ impl: FIRIMPLStorageListResult) {
  45. self.impl = impl
  46. prefixes = impl.prefixes.map { StorageReference($0) }
  47. items = impl.items.map { StorageReference($0) }
  48. pageToken = impl.pageToken
  49. }
  50. }