FIRStorageTaskSnapshot_Private.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #import <Foundation/Foundation.h>
  17. #import "FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageTaskSnapshot.h"
  18. #import "FirebaseStorage/Sources/FIRStorageConstants_Private.h"
  19. NS_ASSUME_NONNULL_BEGIN
  20. @class FIRStorageMetadata;
  21. @class FIRStorageReference;
  22. @class FIRStorageTask;
  23. @interface FIRStorageTaskSnapshot ()
  24. @property(readwrite, copy, nonatomic) FIRStorageTask *task;
  25. @property(readwrite, copy, nonatomic) FIRStorageMetadata *metadata;
  26. @property(readwrite, copy, nonatomic) FIRStorageReference *reference;
  27. @property(readwrite, strong, nonatomic) NSProgress *progress;
  28. @property(readwrite, copy, nonatomic) NSError *error;
  29. /**
  30. * Creates a new task snapshot from the given properties.
  31. * @param task The task being represented in this snapshot.
  32. * @param state The current state of the parent task.
  33. * @param metadata The FIRStorageMetadata of a task. Before upload/update, contains the metadata
  34. * to be updated; after, contains the returned metadata. May be nil if no metadata is provided
  35. * or returned.
  36. * @param reference The FIRStorageReference that spawned the task this snapshot is based on.
  37. * @param progress An NSProgress object containing progress of the task this snapshot is based on,
  38. * or nil if the task doesn't report progress.
  39. * @param error An NSError object containing an error that occurred during the task,
  40. * if one occurred.
  41. * @return Returns the constructed snapshot.
  42. */
  43. - (instancetype)initWithTask:(__kindof FIRStorageTask *)task
  44. state:(FIRStorageTaskState)state
  45. metadata:(nullable FIRStorageMetadata *)metadata
  46. reference:(FIRStorageReference *)reference
  47. progress:(nullable NSProgress *)progress
  48. error:(nullable NSError *)error;
  49. @end
  50. NS_ASSUME_NONNULL_END