FIRStorageTaskSnapshot_Private.h 2.2 KB

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