FBSDKGraphRequestDataAttachment.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. /// A container class for data attachments so that additional metadata can be provided about the attachment.
  11. NS_SWIFT_NAME(GraphRequestDataAttachment)
  12. @interface FBSDKGraphRequestDataAttachment : NSObject
  13. - (instancetype)init NS_UNAVAILABLE;
  14. + (instancetype)new NS_UNAVAILABLE;
  15. /**
  16. Initializes the receiver with the attachment data and metadata.
  17. @param data The attachment data (retained, not copied)
  18. @param filename The filename for the attachment
  19. @param contentType The content type for the attachment
  20. */
  21. - (instancetype)initWithData:(NSData *)data
  22. filename:(NSString *)filename
  23. contentType:(NSString *)contentType
  24. NS_DESIGNATED_INITIALIZER;
  25. /// The content type for the attachment.
  26. @property (nonatomic, readonly, copy) NSString *contentType;
  27. /// The attachment data.
  28. @property (nonatomic, readonly, strong) NSData *data;
  29. /// The filename for the attachment.
  30. @property (nonatomic, readonly, copy) NSString *filename;
  31. @end
  32. NS_ASSUME_NONNULL_END