|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | | -using Newtonsoft.Json; |
| 3 | +using System.Text.Json.Serialization; |
4 | 4 |
|
5 | 5 | namespace Supabase.Storage |
6 | 6 | { |
| 7 | + /// <summary> |
| 8 | + /// Represents a file object in Supabase Storage with its associated metadata and properties. |
| 9 | + /// This class is used for version 2 of the Storage API. |
| 10 | + /// </summary> |
7 | 11 | public class FileObjectV2 |
8 | 12 | { |
9 | 13 |
|
10 | | - [JsonProperty("id")] |
| 14 | + /// <summary> |
| 15 | + /// The unique identifier of the file. |
| 16 | + /// </summary> |
| 17 | + [JsonPropertyName("id")] |
11 | 18 | public string Id { get; set; } |
12 | | - |
13 | | - [JsonProperty("version")] |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// The version of the file. |
| 22 | + /// </summary> |
| 23 | + [JsonPropertyName("version")] |
14 | 24 | public string Version { get; set; } |
15 | | - |
16 | | - [JsonProperty("name")] |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// The name of the file. |
| 28 | + /// </summary> |
| 29 | + [JsonPropertyName("name")] |
17 | 30 | public string? Name { get; set; } |
18 | 31 |
|
19 | | - [JsonProperty("bucket_id")] |
| 32 | + /// <summary> |
| 33 | + /// The identifier of the bucket containing the file. |
| 34 | + /// </summary> |
| 35 | + [JsonPropertyName("bucket_id")] |
20 | 36 | public string? BucketId { get; set; } |
21 | 37 |
|
22 | | - [JsonProperty("updated_at")] |
| 38 | + /// <summary> |
| 39 | + /// The timestamp when the file was last updated. |
| 40 | + /// </summary> |
| 41 | + [JsonPropertyName("updated_at")] |
23 | 42 | public DateTime? UpdatedAt { get; set; } |
24 | 43 |
|
25 | | - [JsonProperty("created_at")] |
| 44 | + /// <summary> |
| 45 | + /// The timestamp when the file was created. |
| 46 | + /// </summary> |
| 47 | + [JsonPropertyName("created_at")] |
26 | 48 | public DateTime? CreatedAt { get; set; } |
27 | 49 |
|
28 | | - [JsonProperty("last_accessed_at")] |
| 50 | + /// <summary> |
| 51 | + /// The timestamp when the file was last accessed. |
| 52 | + /// </summary> |
| 53 | + [JsonPropertyName("last_accessed_at")] |
29 | 54 | public DateTime? LastAccessedAt { get; set; } |
30 | | - |
31 | | - [JsonProperty("size")] |
| 55 | + |
| 56 | + /// <summary> |
| 57 | + /// The size of the file in bytes. |
| 58 | + /// </summary> |
| 59 | + [JsonPropertyName("size")] |
32 | 60 | public int? Size { get; set; } |
33 | | - |
34 | | - [JsonProperty("cache_control")] |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// The cache control directives for the file. |
| 64 | + /// </summary> |
| 65 | + [JsonPropertyName("cache_control")] |
35 | 66 | public string? CacheControl { get; set; } |
36 | | - |
37 | | - [JsonProperty("content_type")] |
| 67 | + |
| 68 | + /// <summary> |
| 69 | + /// The MIME type of the file. |
| 70 | + /// </summary> |
| 71 | + [JsonPropertyName("content_type")] |
38 | 72 | public string? ContentType { get; set; } |
39 | | - |
40 | | - [JsonProperty("etag")] |
| 73 | + |
| 74 | + /// <summary> |
| 75 | + /// The ETag of the file for caching purposes. |
| 76 | + /// </summary> |
| 77 | + [JsonPropertyName("etag")] |
41 | 78 | public string? Etag { get; set; } |
42 | | - |
43 | | - [JsonProperty("last_modified")] |
| 79 | + |
| 80 | + /// <summary> |
| 81 | + /// The timestamp when the file was last modified. |
| 82 | + /// </summary> |
| 83 | + [JsonPropertyName("last_modified")] |
44 | 84 | public DateTime? LastModified { get; set; } |
45 | | - |
46 | | - [JsonProperty("metadata")] |
| 85 | + |
| 86 | + /// <summary> |
| 87 | + /// The custom metadata associated with the file. |
| 88 | + /// </summary> |
| 89 | + [JsonPropertyName("metadata")] |
47 | 90 | public Dictionary<string, string>? Metadata { get; set; } |
48 | 91 | } |
49 | 92 | } |
0 commit comments