StorageListResult.swift 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. internal init(_ impl: FIRIMPLStorageListResult) {
  39. prefixes = impl.prefixes.map { StorageReference($0) }
  40. items = impl.items.map { StorageReference($0) }
  41. pageToken = impl.pageToken
  42. }
  43. }