|
|
@ -36,7 +36,7 @@ public partial record Attachment
|
|
|
|
var url = json.GetProperty("url").GetNonWhiteSpaceString();
|
|
|
|
var url = json.GetProperty("url").GetNonWhiteSpaceString();
|
|
|
|
var width = json.GetPropertyOrNull("width")?.GetInt32OrNull();
|
|
|
|
var width = json.GetPropertyOrNull("width")?.GetInt32OrNull();
|
|
|
|
var height = json.GetPropertyOrNull("height")?.GetInt32OrNull();
|
|
|
|
var height = json.GetPropertyOrNull("height")?.GetInt32OrNull();
|
|
|
|
var fileName = json.GetProperty("filename").GetNonWhiteSpaceString();
|
|
|
|
var fileName = json.GetProperty("filename").GetNonNullString();
|
|
|
|
var fileSize = json.GetProperty("size").GetInt64().Pipe(FileSize.FromBytes);
|
|
|
|
var fileSize = json.GetProperty("size").GetInt64().Pipe(FileSize.FromBytes);
|
|
|
|
|
|
|
|
|
|
|
|
return new Attachment(id, url, fileName, width, height, fileSize);
|
|
|
|
return new Attachment(id, url, fileName, width, height, fileSize);
|
|
|
|