const std = @import("std");
pub const FileAccessType = enum {
Public,
Team,
Private,
};
pub const FileSystemFile = struct {
id: i32 = 0,
fileName: ?[]const u8 = null,
filePath: ?[]const u8 = null,
contentType: ?[]const u8 = null,
contentLength: i64 = 0,
// @References(typeof(FileSystemItem))
fileSystemItemId: i32 = 0,
};
pub const FileSystemItem = struct {
id: i32 = 0,
fileAccessType: ?FileAccessType = null,
file: ?FileSystemFile = null,
appUserId: ?[]const u8 = null,
};
pub const CreateFileSystemItem = struct {
fileAccessType: ?FileAccessType = null,
file: ?FileSystemFile = null,
};
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/CreateFileSystemItem HTTP/1.1
Host: blazor-gallery.servicestack.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
fileAccessType: Public,
file:
{
id: 0,
fileName: String,
filePath: String,
contentType: String,
contentLength: 0,
fileSystemItemId: 0
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
fileAccessType: Public,
file:
{
id: 0,
fileName: String,
filePath: String,
contentType: String,
contentLength: 0,
fileSystemItemId: 0
},
appUserId: String
}