6
6
7
7
namespace CouchDB . Driver . Types
8
8
{
9
+ /// <summary>
10
+ /// Represents an attachment for a document.
11
+ /// </summary>
9
12
public sealed class CouchAttachment
10
13
{
11
14
[ JsonIgnore ]
@@ -26,25 +29,78 @@ public sealed class CouchAttachment
26
29
[ JsonIgnore ]
27
30
public Uri Uri { get ; internal set ; }
28
31
32
+ /// <summary>
33
+ /// Gets whether the attachment object contains stub info and no content.
34
+ /// </summary>
29
35
[ DataMember ]
30
36
[ JsonProperty ( "stub" ) ]
31
37
public bool Stub { get ; set ; }
32
38
39
+ /// <summary>
40
+ /// Gets the attachment MIME type.
41
+ /// </summary>
33
42
[ DataMember ]
34
43
[ JsonProperty ( "content_type" ) ]
35
44
public string ContentType { get ; set ; }
36
45
46
+ /// <summary>
47
+ /// Gets the content hash digest. It starts with prefix which announce hash type (md5-) and continues with
48
+ /// Base64-encoded hash digest.
49
+ /// </summary>
37
50
[ DataMember ]
38
51
[ JsonProperty ( "digest" ) ]
39
52
public string Digest { get ; private set ; }
40
53
54
+ /// <summary>
55
+ /// Gets the real attachment size in bytes. Not available if attachment content requested.
56
+ /// </summary>
41
57
[ DataMember ]
42
58
[ JsonProperty ( "length" ) ]
43
- public int ? Length { get ; private set ; }
59
+ public long ? Length { get ; private set ; }
44
60
61
+ /// <summary>
62
+ /// Gets the revision number when attachment was added.
63
+ /// </summary>
45
64
[ DataMember ]
46
65
[ JsonProperty ( "revpos" ) ]
47
66
public int ? RevPos { get ; private set ; }
67
+
68
+ /// <summary>
69
+ /// Gets the compressed attachment size in bytes.
70
+ /// </summary>
71
+ /// <remarks>
72
+ /// Available if content_type is in list of compressible types when the attachment was added and the following query
73
+ /// parameters are specified:
74
+ /// <list type="bullet">
75
+ /// <item>
76
+ /// <description>att_encoding_info=true when querying a document</description>
77
+ /// </item>
78
+ /// <item>
79
+ /// <description>att_encoding_info=true&include_docs=true when querying a changes feed or a view</description>
80
+ /// </item>
81
+ /// </list>
82
+ /// </remarks>
83
+ [ DataMember ]
84
+ [ JsonProperty ( "encoded_length" ) ]
85
+ public long ? EncodedLength { get ; private set ; }
86
+
87
+ /// <summary>
88
+ /// Gets the Base64-encoded content. Only populated if queried for and <see cref="Stub"/> is false.
89
+ /// </summary>
90
+ /// <remarks>
91
+ /// Base64-encoded content. Available if attachment content is requested by using the following query parameters:
92
+ /// <list type="bullet">
93
+ /// <item>
94
+ /// <description>attachments=true when querying a document</description>
95
+ /// </item>
96
+ /// <item>
97
+ /// <description>attachments=true&include_docs=true when querying a changes feed or a view</description>
98
+ /// </item>
99
+ /// </list>
100
+ /// </remarks>
101
+ [ DataMember ]
102
+ [ JsonProperty ( "data" ) ]
103
+ public string Data { get ; private set ; }
48
104
}
49
105
}
50
106
#nullable restore
0 commit comments