-
-
Notifications
You must be signed in to change notification settings - Fork 340
/
Copy pathSentryAttachment.h
85 lines (72 loc) · 2.96 KB
/
SentryAttachment.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#if __has_include(<Sentry/Sentry.h>)
# import <Sentry/SentryDefines.h>
#else
# import <SentryWithoutUIKit/SentryDefines.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
* You can use an attachment to store additional files alongside an event.
*/
NS_SWIFT_NAME(Attachment)
@interface SentryAttachment : NSObject
SENTRY_NO_INIT
/**
* Initializes an attachment with data. Sets the content type to @c "application/octet-stream".
* @param data The data for the attachment.
* @param filename The name of the attachment to display in Sentry.
*/
- (instancetype)initWithData:(NSData *)data filename:(NSString *)filename;
/**
* Initializes an attachment with data.
* @param data The data for the attachment.
* @param filename The name of the attachment to display in Sentry.
* @param contentType The content type of the attachment. @c Default is "application/octet-stream".
*/
- (instancetype)initWithData:(NSData *)data
filename:(NSString *)filename
contentType:(nullable NSString *)contentType;
/**
* Initializes an attachment with a path. Uses the last path component of the path as a filename
* and sets the content type to @c "application/octet-stream".
* @discussion The file located at the pathname is read lazily when the SDK captures an event or
* transaction not when the attachment is initialized.
* @param path The path of the file whose contents you want to upload to Sentry.
*/
- (instancetype)initWithPath:(NSString *)path;
/**
* Initializes an attachment with a path. Sets the content type to @c "application/octet-stream".
* @discussion The specified file is read lazily when the SDK captures an event or
* transaction not when the attachment is initialized.
* @param path The path of the file whose contents you want to upload to Sentry.
* @param filename The name of the attachment to display in Sentry.
*/
- (instancetype)initWithPath:(NSString *)path filename:(NSString *)filename;
/**
* Initializes an attachment with a path.
* @discussion The specifid file is read lazily when the SDK captures an event or
* transaction not when the attachment is initialized.
* @param path The path of the file whose contents you want to upload to Sentry.
* @param filename The name of the attachment to display in Sentry.
* @param contentType The content type of the attachment. Default is @c "application/octet-stream".
*/
- (instancetype)initWithPath:(NSString *)path
filename:(NSString *)filename
contentType:(nullable NSString *)contentType;
/**
* The data of the attachment.
*/
@property (readonly, nonatomic, strong, nullable) NSData *data;
/**
* The path of the attachment.
*/
@property (readonly, nonatomic, copy, nullable) NSString *path;
/**
* The filename of the attachment to display in Sentry.
*/
@property (readonly, nonatomic, copy) NSString *filename;
/**
* The content type of the attachment.
*/
@property (readonly, nonatomic, copy, nullable) NSString *contentType;
@end
NS_ASSUME_NONNULL_END