Skip to content

Commit 5f36bbf

Browse files
Fix code factor warnings
1 parent 3ed25e8 commit 5f36bbf

File tree

4 files changed

+53
-46
lines changed

4 files changed

+53
-46
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.IO;
2+
3+
namespace Notion.Client
4+
{
5+
public class FileData
6+
{
7+
/// <summary>
8+
/// The name of the file being uploaded.
9+
/// </summary>
10+
public string FileName { get; set; }
11+
12+
/// <summary>
13+
/// The content of the file being uploaded.
14+
/// </summary>
15+
public Stream Data { get; set; }
16+
17+
/// <summary>
18+
/// The MIME type of the file being uploaded.
19+
/// </summary>
20+
public string ContentType { get; set; }
21+
}
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
public interface ISendFileUploadFormDataParameters
6+
{
7+
8+
/// <summary>
9+
/// The raw binary file contents to upload.
10+
/// </summary>
11+
FileData File { get; }
12+
13+
/// <summary>
14+
/// When using a mode=multi_part File Upload to send files greater than 20 MB in parts, this is the current part number.
15+
/// Must be an integer between 1 and 1000 provided as a string form field.
16+
/// </summary>
17+
[JsonProperty("part_number")]
18+
string PartNumber { get; }
19+
}
20+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace Notion.Client
2+
{
3+
public interface ISendFileUploadPathParameters
4+
{
5+
/// <summary>
6+
/// The `file_upload_id` obtained from the `id` of the Create File Upload API response.
7+
/// </summary>
8+
string FileUploadId { get; }
9+
}
10+
}
Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System.IO;
2-
using Newtonsoft.Json;
3-
41
namespace Notion.Client
52
{
63
public class SendFileUploadRequest : ISendFileUploadFormDataParameters, ISendFileUploadPathParameters
@@ -21,46 +18,4 @@ public static SendFileUploadRequest Create(string fileUploadId, FileData file, s
2118
};
2219
}
2320
}
24-
25-
public interface ISendFileUploadFormDataParameters
26-
{
27-
28-
/// <summary>
29-
/// The raw binary file contents to upload.
30-
/// </summary>
31-
FileData File { get; }
32-
33-
/// <summary>
34-
/// When using a mode=multi_part File Upload to send files greater than 20 MB in parts, this is the current part number.
35-
/// Must be an integer between 1 and 1000 provided as a string form field.
36-
/// </summary>
37-
[JsonProperty("part_number")]
38-
string PartNumber { get; }
39-
}
40-
41-
public class FileData
42-
{
43-
/// <summary>
44-
/// The name of the file being uploaded.
45-
/// </summary>
46-
public string FileName { get; set; }
47-
48-
/// <summary>
49-
/// The content of the file being uploaded.
50-
/// </summary>
51-
public Stream Data { get; set; }
52-
53-
/// <summary>
54-
/// The MIME type of the file being uploaded.
55-
/// </summary>
56-
public string ContentType { get; set; }
57-
}
58-
59-
public interface ISendFileUploadPathParameters
60-
{
61-
/// <summary>
62-
/// The `file_upload_id` obtained from the `id` of the Create File Upload API response.
63-
/// </summary>
64-
string FileUploadId { get; }
65-
}
66-
}
21+
}

0 commit comments

Comments
 (0)