This repository was archived by the owner on Apr 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathOneDriveItem.cs
More file actions
174 lines (146 loc) · 6.51 KB
/
OneDriveItem.cs
File metadata and controls
174 lines (146 loc) · 6.51 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
using System;
using KoenZomers.OneDrive.Api.Enums;
using System.Text.Json.Serialization;
namespace KoenZomers.OneDrive.Api.Entities
{
/// <summary>
/// The Item resource type represents metadata for an item in OneDrive. All top-level filesystem objects in OneDrive are Item resources. If an item is a Folder or File facet, the Item resource will contain a value for either the folder or file property, respectively.
/// </summary>
public class OneDriveItem : OneDriveItemBase
{
/// <summary>
/// The unique identifier of the item within the Drive. Read-only.
/// </summary>
[JsonPropertyName("id")]
public string Id { get; set; }
/// <summary>
/// The name of the item (filename and extension). Writable.
/// </summary>
[JsonPropertyName("name")]
public string Name { get; set; }
/// <summary>
/// eTag for the entire item (metadata + content). Read-only.
/// </summary>
[JsonPropertyName("etag")]
public string ETag { get; set; }
/// <summary>
/// An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Read-only.
/// </summary>
[JsonPropertyName("ctag")]
public string CTag { get; set; }
/// <summary>
/// Identity of the user, device, and application which created the item. Read-only.
/// </summary>
[JsonPropertyName("createdBy")]
public OneDriveIdentitySet CreatedBy { get; set; }
/// <summary>
/// Date and time of item creation. Read-only.
/// </summary>
[JsonPropertyName("createdDateTime")]
public DateTimeOffset CreatedDateTime { get; set; }
/// <summary>
/// Identity of the user, device, and application which last modified the item. Read-only.
/// </summary>
[JsonPropertyName("lastModifiedBy")]
public OneDriveIdentitySet LastModifiedBy { get; set; }
/// <summary>
/// Date and time the item was last modified. Read-only.
/// </summary>
[JsonPropertyName("lastModifiedDateTime")]
public DateTimeOffset LastModifiedDateTime { get; set; }
/// <summary>
/// Size of the item in bytes. Read-only.
/// </summary>
[JsonPropertyName("size")]
public long Size { get; set; }
/// <summary>
/// URL that displays the resource in the browser. Read-only.
/// </summary>
[JsonPropertyName("webUrl")]
public string WebUrl { get; set; }
/// <summary>
/// Parent information, if the item has a parent. Writeable
/// </summary>
[JsonPropertyName("parentReference")]
public OneDriveItemReference ParentReference { get; set; }
/// <summary>
/// Folder metadata, if the item is a folder. Read-only.
/// </summary>
[JsonPropertyName("folder")]
public OneDriveFolderFacet Folder { get; set; }
/// <summary>
/// File metadata, if the item is a file. Read-only.
/// </summary>
[JsonPropertyName("file")]
public OneDriveFileFacet File { get; set; }
/// <summary>
/// Image metadata, if the item is an image. Read-only.
/// </summary>
[JsonPropertyName("image")]
public OneDriveImageFacet Image { get; set; }
/// <summary>
/// Photo metadata, if the item is a photo. Read-only.
/// </summary>
[JsonPropertyName("photo")]
public OneDrivePhotoFacet Photo { get; set; }
/// <summary>
/// Audio metadata, if the item is an audio file. Read-only.
/// </summary>
[JsonPropertyName("audio")]
public OneDriveAudioFacet Audio { get; set; }
/// <summary>
/// Video metadata, if the item is a video. Read-only.
/// </summary>
[JsonPropertyName("video")]
public OneDriveVideoFacet Video { get; set; }
/// <summary>
/// Location metadata, if the item has location data. Read-only.
/// </summary>
[JsonPropertyName("location")]
public OneDriveLocationFacet Location { get; set; }
/// <summary>
/// Information about the deleted state of the item. Read-only.
/// </summary>
[JsonPropertyName("deleted")]
public OneDriveTombstoneFacet Deleted { get; set; }
[JsonPropertyName("specialFolder")]
public OneDriveSpecialFolderFacet SpecialFolder { get; set; }
/// <summary>
/// The conflict resolution behavior for actions that create a new item. An item will never be returned with this annotation. Write-only.
/// </summary>
[JsonPropertyName("@microsoft.graph.conflictBehavior")]
public NameConflictBehavior? NameConflictBehahiorAnnotation { get; set; }
/// <summary>
/// A Url that can be used to download this file's content. Authentication is not required with this URL. Read-only.
/// </summary>
[JsonPropertyName("@content.downloadUrl")]
public string DownloadUrlAnnotation { get; set; }
/// <summary>
/// When issuing a PUT request, this instance annotation can be used to instruct the service to download the contents of the URL, and store it as the file. Write-only.
/// </summary>
[JsonPropertyName("@content.sourceUrl")]
public string SourceUrlAnnotation { get; set; }
[JsonPropertyName("children@odata.nextLink")]
public string ChildrenNextLinkAnnotation { get; set; }
/// <summary>
/// Collection containing ThumbnailSet objects associated with the item. For more info, see getting thumbnails.
/// </summary>
[JsonPropertyName("thumbnails")]
public OneDriveThumbnailSet[] Thumbnails { get; set; }
/// <summary>
/// Collection containing Item objects for the immediate children of Item. Only items representing folders have children.
/// </summary>
[JsonPropertyName("children")]
public OneDriveItem[] Children { get; set; }
/// <summary>
/// If containing information, it regards a OneDriveItem stored on another OneDrive but linked by the current OneDrive
/// </summary>
[JsonPropertyName("remoteItem")]
public OneDriveRemoteItem RemoteItem{ get; set; }
/// <summary>
/// Information about the owner of a shared item
/// </summary>
[JsonPropertyName("shared")]
public OneDriveSharedItem Shared { get; set; }
}
}