FIRStorageUploadTask_Private.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright 2017 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. @class GTMSessionUploadFetcher;
  17. NS_ASSUME_NONNULL_BEGIN
  18. @interface FIRStorageUploadTask ()
  19. /**
  20. * The data to be uploaded (if uploading bytes).
  21. */
  22. @property(readonly, copy, nonatomic, nullable) NSData *uploadData;
  23. /**
  24. * The name of a file on disk to be uploaded (if uploading from a file).
  25. */
  26. @property(readonly, copy, nonatomic, nullable) NSURL *fileURL;
  27. /**
  28. * The FIRStorageMetadata about the object being uploaded.
  29. */
  30. @property(readonly, copy, nonatomic) FIRStorageMetadata *uploadMetadata;
  31. /**
  32. * GTMSessionUploadFetcher used by all uploads.
  33. */
  34. @property(strong, atomic) GTMSessionUploadFetcher *uploadFetcher;
  35. /**
  36. * Initializes an upload task with a base FIRStorageReference and GTMSessionFetcherService.
  37. * @param reference The base FIRStorageReference which fetchers use for configuration.
  38. * @param service The GTMSessionFetcherService which will create fetchers.
  39. * @param uploadData The NSData object to be uploaded.
  40. * @return Returns an instance of FIRStorageUploadTask.
  41. */
  42. - (instancetype)initWithReference:(FIRStorageReference *)reference
  43. fetcherService:(GTMSessionFetcherService *)service
  44. data:(NSData *)uploadData
  45. metadata:(FIRStorageMetadata *)metadata;
  46. /**
  47. * Initializes an upload task with a base FIRStorageReference and GTMSessionFetcherService.
  48. * @param reference The base FIRStorageReference which fetchers use for configuration.
  49. * @param service The GTMSessionFetcherService which will create fetchers.
  50. * @param fileURL The system file URL to upload from.
  51. * @return Returns an instance of FIRStorageUploadTask.
  52. */
  53. - (instancetype)initWithReference:(FIRStorageReference *)reference
  54. fetcherService:(GTMSessionFetcherService *)service
  55. file:(NSURL *)fileURL
  56. metadata:(FIRStorageMetadata *)metadata;
  57. @end
  58. NS_ASSUME_NONNULL_END