summary refs log tree commit diff
path: root/extra/admin-api/Models
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-08-02 01:00:21 +0200
committerRory& <root@rory.gay>2026-08-02 01:00:21 +0200
commitffd7f00336b65d52b0a4587421b4393ce67e717c (patch)
treeb1e5585e5049851ca502d92776569295ce9389e0 /extra/admin-api/Models
parentBasic retry logic for UnixSocketWriter connections before unlinking sockets (diff)
downloadserver-ts-ffd7f00336b65d52b0a4587421b4393ce67e717c.tar.xz
Add attachment list API
Diffstat (limited to 'extra/admin-api/Models')
-rw-r--r--extra/admin-api/Models/Spacebar.Models.Api/CreateAttachmentRequest.cs17
-rw-r--r--extra/admin-api/Models/Spacebar.Models.Api/Spacebar.Models.Api.csproj5
2 files changed, 22 insertions, 0 deletions
diff --git a/extra/admin-api/Models/Spacebar.Models.Api/CreateAttachmentRequest.cs b/extra/admin-api/Models/Spacebar.Models.Api/CreateAttachmentRequest.cs

index 8bc4a2d8c..be04cd4e8 100644 --- a/extra/admin-api/Models/Spacebar.Models.Api/CreateAttachmentRequest.cs +++ b/extra/admin-api/Models/Spacebar.Models.Api/CreateAttachmentRequest.cs
@@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using Spacebar.Models.Generic; namespace Spacebar.Models.Api; @@ -38,4 +39,20 @@ public class CreateAttachmentResponse { [JsonPropertyName("original_content_type")] public string? OriginalContentType { get; set; } } +} + +public class AttachmentListResponse { + [JsonPropertyName("total")] + public int Total { get; set; } + + [JsonPropertyName("items")] + public List<Entry> Items { get; set; } + + public class Entry { + [JsonPropertyName("attachment")] + public MessageAttachment Attachment { get; set; } + + [JsonPropertyName("message_reference")] + public MessageReference MessageReference { get; set; } + } } \ No newline at end of file diff --git a/extra/admin-api/Models/Spacebar.Models.Api/Spacebar.Models.Api.csproj b/extra/admin-api/Models/Spacebar.Models.Api/Spacebar.Models.Api.csproj
index 237d66167..ac6bad9f0 100644 --- a/extra/admin-api/Models/Spacebar.Models.Api/Spacebar.Models.Api.csproj +++ b/extra/admin-api/Models/Spacebar.Models.Api/Spacebar.Models.Api.csproj
@@ -6,4 +6,9 @@ <Nullable>enable</Nullable> </PropertyGroup> + <ItemGroup> + <ProjectReference Include="..\Spacebar.Models.Generic\Spacebar.Models.Generic.csproj" Condition="'$(ContinuousIntegrationBuild)'!='true'"/> + <PackageReference Include="Spacebar.Models.Generic" Version="*-preview*" Condition="'$(ContinuousIntegrationBuild)'=='true'"/> + </ItemGroup> + </Project>