FIRStorageListTask.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright 2019 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageListResult.h"
  17. #import "FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageTask.h"
  18. @class GTMSessionFetcherService;
  19. NS_ASSUME_NONNULL_BEGIN
  20. /**
  21. * Block typedef typically used in `list()` and `listAll()`.
  22. * @param listResult The FIRIMPLStorageListResult returned by the operation, if it exists.
  23. * @param error The error describing failure, if one occurred.
  24. */
  25. typedef void (^FIRStorageVoidListError)(FIRIMPLStorageListResult *_Nullable listResult,
  26. NSError *_Nullable error);
  27. /** A Task that lists the entries under a {@link StorageReference} */
  28. @interface FIRStorageListTask : FIRIMPLStorageTask <FIRIMPLStorageTaskManagement>
  29. /**
  30. * Initializes a new List Task.
  31. *
  32. * To schedule the task, invoke `[FIRStorageListTask enqueue]`.
  33. *
  34. * @param reference The location to invoke List on.
  35. * @param service GTMSessionFetcherService to use for the RPC.
  36. * @param queue The queue to schedule the List operation on.
  37. * @param pageSize An optional pageSize, denoting the maximum size of the result set. If
  38. * set to `nil`, the backend will use the default page size.
  39. * @param previousPageToken An optional pageToken, used to resume a previous invocation.
  40. * @param completion The completion handler to be called with the FIRIMPLStorageListResult.
  41. */
  42. - (instancetype)initWithReference:(FIRIMPLStorageReference *)reference
  43. fetcherService:(GTMSessionFetcherService *)service
  44. dispatchQueue:(dispatch_queue_t)queue
  45. pageSize:(nullable NSNumber *)pageSize
  46. previousPageToken:(nullable NSString *)previousPageToken
  47. completion:(FIRStorageVoidListError)completion;
  48. @end
  49. NS_ASSUME_NONNULL_END