forked from getsentry/sentry-cocoa
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSentryAttachment.h
90 lines (77 loc) · 2.93 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
86
87
88
89
90
#import "SentryDefines.h"
#import "SentrySerializable.h"
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 "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. Default is "application/octet-stream".
*/
- (instancetype)initWithData:(NSData *)data
filename:(NSString *)filename
contentType:(NSString *)contentType;
/**
* Initializes an attachment with a path. Uses the last path compontent of the path as a filename
* and sets the content type to "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 "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.
* @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 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.
* @param filename The name of the attachment to display in Sentry.
* @param contentType The content type of the attachment. Default is "application/octet-stream".
*/
- (instancetype)initWithPath:(NSString *)path
filename:(NSString *)filename
contentType:(NSString *)contentType;
/**
* The data of the attachment.
*/
@property (readonly, nonatomic, strong) NSData *_Nullable data;
/**
* The path of the attachment.
*/
@property (readonly, nonatomic, copy) NSString *_Nullable path;
/**
* The filename of the attachment to display in Sentry.
*/
@property (readonly, nonatomic, copy) NSString *filename;
/**
* The content type of the attachment. Default is "application/octet-stream".
*/
@property (readonly, nonatomic, copy) NSString *contentType;
@end
NS_ASSUME_NONNULL_END