From ac493d78baeed267a24b7f710e8a03b6c9664729 Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Tue, 24 Feb 2026 10:01:21 +0000 Subject: [PATCH 01/11] Upgraded to dotnet 10 --- .github/workflows/build-test-template.yml | 4 +- .github/workflows/pack-template.yml | 2 +- Directory.Build.props | 4 +- Dockerfile | 6 +- .../DfE.ExternalApplications.Api.csproj | 33 +- .../Middleware/TenantResolutionMiddleware.cs | 2 +- .../AuthenticationHeaderOperationFilter.cs | 13 +- .../Swagger/SwaggerOptions.cs | 9 +- .../Swagger/TenantHeaderOperationFilter.cs | 14 +- ...fE.ExternalApplications.Application.csproj | 9 +- .../DfE.ExternalApplications.Domain.csproj | 4 +- ...ExternalApplications.Infrastructure.csproj | 18 +- .../DfE.ExternalApplications.Utils.csproj | 4 +- .../Generated/Client.g.cs | 476 +- .../Generated/Contracts.g.cs | 34 +- .../Generated/swagger.json | 6 +- ...Dfe.ExternalApplications.Api.Client.csproj | 22 +- .../nswag.json | 4 +- ...lApplications.Api.Tests.Integration.csproj | 4 +- ...ernalApplications.Application.Tests.csproj | 2 +- ...E.ExternalApplications.Tests.Common.csproj | 8 +- swagger_https.json | 6147 +++++++++++++++++ 22 files changed, 6565 insertions(+), 260 deletions(-) create mode 100644 swagger_https.json diff --git a/.github/workflows/build-test-template.yml b/.github/workflows/build-test-template.yml index 9fc20c09..0203b2c2 100644 --- a/.github/workflows/build-test-template.yml +++ b/.github/workflows/build-test-template.yml @@ -20,8 +20,8 @@ on: SONAR_TOKEN: required: true env: - DOTNET_VERSION: '8.0.x' - EF_VERSION: '6.0.5' + DOTNET_VERSION: '10.0.x' + EF_VERSION: '10.0.0' JAVA_VERSION: '17' jobs: diff --git a/.github/workflows/pack-template.yml b/.github/workflows/pack-template.yml index c45580ad..121642de 100644 --- a/.github/workflows/pack-template.yml +++ b/.github/workflows/pack-template.yml @@ -31,7 +31,7 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: '10.0.x' - name: Install GitVersion (v5) uses: gittools/actions/gitversion/setup@v0.9 diff --git a/Directory.Build.props b/Directory.Build.props index 478c7272..a26d7858 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - + - net8.0 + net10.0 enable enable diff --git a/Dockerfile b/Dockerfile index 9473b9e6..45d8b4ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG DOTNET_VERSION=8.0 +ARG DOTNET_VERSION=10.0 # ============================================================ # Stage 1 - Build + Install Playwright (Ubuntu SDK) @@ -37,7 +37,7 @@ WORKDIR /build ENV PATH=$PATH:/root/.dotnet/tools ENV DOTNET_ROOT=/usr/share/dotnet -RUN dotnet tool install --global dotnet-ef --version 8.* +RUN dotnet tool install --global dotnet-ef --version 10.* RUN mkdir /sql @@ -105,4 +105,4 @@ RUN chmod +x /app/docker-entrypoint.sh ENV ASPNETCORE_URLS=http://+:8080 USER $APP_UID -ENTRYPOINT ["/app/docker-entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/app/docker-entrypoint.sh"] diff --git a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj index eb2d436d..b8dbeb27 100644 --- a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj +++ b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj @@ -1,9 +1,9 @@ - + true $(NoWarn);1591 - net8.0 + net10.0 f714ca7a-fc08-46ff-b0cc-373d6f04cf4c 1.1.4 1.1.4 @@ -16,28 +16,29 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + + @@ -61,7 +62,7 @@ - + diff --git a/src/DfE.ExternalApplications.Api/Middleware/TenantResolutionMiddleware.cs b/src/DfE.ExternalApplications.Api/Middleware/TenantResolutionMiddleware.cs index a3e748f7..d7613c5a 100644 --- a/src/DfE.ExternalApplications.Api/Middleware/TenantResolutionMiddleware.cs +++ b/src/DfE.ExternalApplications.Api/Middleware/TenantResolutionMiddleware.cs @@ -11,7 +11,7 @@ public class TenantResolutionMiddleware { public const string TenantIdHeader = "X-Tenant-ID"; - private static readonly string[] BypassPaths = { "/swagger", "/health", "/_" }; + private static readonly string[] BypassPaths = { "/swagger", "/health", "/_", "/favicon.ico" }; private readonly RequestDelegate _next; private readonly ITenantConfigurationProvider _tenantConfigurationProvider; diff --git a/src/DfE.ExternalApplications.Api/Swagger/AuthenticationHeaderOperationFilter.cs b/src/DfE.ExternalApplications.Api/Swagger/AuthenticationHeaderOperationFilter.cs index ed3d2eb3..749441dd 100644 --- a/src/DfE.ExternalApplications.Api/Swagger/AuthenticationHeaderOperationFilter.cs +++ b/src/DfE.ExternalApplications.Api/Swagger/AuthenticationHeaderOperationFilter.cs @@ -1,4 +1,4 @@ -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace DfE.ExternalApplications.Api.Swagger @@ -9,17 +9,10 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) { operation.Security ??= new List(); - var userScheme = new OpenApiSecurityScheme - { - Reference = new OpenApiReference - { - Type = ReferenceType.SecurityScheme, - Id = "Bearer" - } - }; + var userScheme = new OpenApiSecuritySchemeReference("Bearer"); operation.Security.Add(new OpenApiSecurityRequirement { - [userScheme] = Array.Empty() + [userScheme] = new List() }); } } diff --git a/src/DfE.ExternalApplications.Api/Swagger/SwaggerOptions.cs b/src/DfE.ExternalApplications.Api/Swagger/SwaggerOptions.cs index 03cf2e0f..5e1aa9ef 100644 --- a/src/DfE.ExternalApplications.Api/Swagger/SwaggerOptions.cs +++ b/src/DfE.ExternalApplications.Api/Swagger/SwaggerOptions.cs @@ -1,7 +1,7 @@ using Asp.Versioning.ApiExplorer; using DfE.ExternalApplications.Domain.Tenancy; using Microsoft.Extensions.Options; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace DfE.ExternalApplications.Api.Swagger @@ -52,12 +52,7 @@ public void Configure(SwaggerGenOptions options) In = ParameterLocation.Header, Type = SecuritySchemeType.Http, Scheme = "bearer", - BearerFormat = "JWT", - Reference = new OpenApiReference - { - Type = ReferenceType.SecurityScheme, - Id = "Bearer" - } + BearerFormat = "JWT" }); options.OperationFilter(); options.OperationFilter(_tenantConfigurationProvider); diff --git a/src/DfE.ExternalApplications.Api/Swagger/TenantHeaderOperationFilter.cs b/src/DfE.ExternalApplications.Api/Swagger/TenantHeaderOperationFilter.cs index fdc83b70..77789aea 100644 --- a/src/DfE.ExternalApplications.Api/Swagger/TenantHeaderOperationFilter.cs +++ b/src/DfE.ExternalApplications.Api/Swagger/TenantHeaderOperationFilter.cs @@ -1,7 +1,7 @@ +using System.Text.Json.Nodes; using DfE.ExternalApplications.Api.Middleware; using DfE.ExternalApplications.Domain.Tenancy; -using Microsoft.OpenApi.Any; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace DfE.ExternalApplications.Api.Swagger; @@ -20,17 +20,14 @@ public TenantHeaderOperationFilter(ITenantConfigurationProvider tenantConfigurat public void Apply(OpenApiOperation operation, OperationFilterContext context) { - operation.Parameters ??= new List(); + operation.Parameters ??= new List(); var tenants = _tenantConfigurationProvider.GetAllTenants(); - // Create enum values for the dropdown var tenantOptions = tenants - .Select(t => new OpenApiString(t.Id.ToString())) - .Cast() + .Select(t => (JsonNode)JsonValue.Create(t.Id.ToString())!) .ToList(); - // Build description with tenant names for reference var tenantDescriptions = string.Join("\n", tenants.Select(t => $"- `{t.Id}` = {t.Name}")); @@ -42,7 +39,7 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) Description = $"Tenant identifier (GUID). Available tenants:\n{tenantDescriptions}", Schema = new OpenApiSchema { - Type = "string", + Type = JsonSchemaType.String, Format = "uuid", Enum = tenantOptions.Any() ? tenantOptions : null, Default = tenantOptions.FirstOrDefault() @@ -52,4 +49,3 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) operation.Parameters.Insert(0, parameter); } } - diff --git a/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj b/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj index 6fbd7763..1746a0c2 100644 --- a/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj +++ b/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj @@ -1,7 +1,7 @@ - + - net8.0 + net10.0 @@ -27,9 +27,8 @@ - - - + + diff --git a/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj b/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj index 1200c9a2..af2a86b0 100644 --- a/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj +++ b/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 @@ -9,7 +9,7 @@ - + diff --git a/src/DfE.ExternalApplications.Infrastructure/DfE.ExternalApplications.Infrastructure.csproj b/src/DfE.ExternalApplications.Infrastructure/DfE.ExternalApplications.Infrastructure.csproj index 638659cb..c4233e19 100644 --- a/src/DfE.ExternalApplications.Infrastructure/DfE.ExternalApplications.Infrastructure.csproj +++ b/src/DfE.ExternalApplications.Infrastructure/DfE.ExternalApplications.Infrastructure.csproj @@ -1,21 +1,21 @@ - + - net8.0 + net10.0 - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/src/DfE.ExternalApplications.Utils/DfE.ExternalApplications.Utils.csproj b/src/DfE.ExternalApplications.Utils/DfE.ExternalApplications.Utils.csproj index cdb04b6f..f1b1427e 100644 --- a/src/DfE.ExternalApplications.Utils/DfE.ExternalApplications.Utils.csproj +++ b/src/DfE.ExternalApplications.Utils/DfE.ExternalApplications.Utils.csproj @@ -1,11 +1,11 @@ - net8.0 + net10.0 - + diff --git a/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Client.g.cs b/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Client.g.cs index 12298ed2..5c5f2324 100644 --- a/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Client.g.cs +++ b/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Client.g.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- @@ -24,6 +24,8 @@ #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" #pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type" +#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference" #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" #pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" #pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" @@ -33,7 +35,7 @@ namespace GovUK.Dfe.ExternalApplications.Api.Client { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ApplicationsClient : IApplicationsClient { #pragma warning disable 8618 @@ -176,28 +178,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -322,28 +324,28 @@ public string BaseUrl throw new ExternalApplicationsException("Application not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -467,7 +469,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -596,7 +598,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -724,7 +726,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -843,28 +845,28 @@ public string BaseUrl throw new ExternalApplicationsException("Application not found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -999,7 +1001,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1124,28 +1126,28 @@ public string BaseUrl throw new ExternalApplicationsException("Application not found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1272,7 +1274,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1413,24 +1415,24 @@ public string BaseUrl throw new ExternalApplicationsException("Application not found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 409) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Conflict Error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 409) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Conflict Error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 500) @@ -1444,7 +1446,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1573,7 +1575,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1648,7 +1650,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200 || status_ == 206) { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); + var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await ReadAsStreamAsync(response_.Content, cancellationToken).ConfigureAwait(false); var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; @@ -1705,7 +1707,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1838,7 +1840,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1908,7 +1910,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200 || status_ == 206) { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); + var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await ReadAsStreamAsync(response_.Content, cancellationToken).ConfigureAwait(false); var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; @@ -1965,7 +1967,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -1996,6 +1998,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -2007,7 +2029,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -2023,7 +2045,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -2049,10 +2071,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -2092,7 +2114,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class DiagnosticsClient : IDiagnosticsClient { #pragma warning disable 8618 @@ -2186,14 +2208,14 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200 || status_ == 206) { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); + var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await ReadAsStreamAsync(response_.Content, cancellationToken).ConfigureAwait(false); var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2224,6 +2246,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -2235,7 +2277,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -2251,7 +2293,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -2277,10 +2319,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -2320,7 +2362,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class NotificationsClient : INotificationsClient { #pragma warning disable 8618 @@ -2463,28 +2505,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2608,7 +2650,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2732,7 +2774,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2856,7 +2898,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -2963,28 +3005,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3108,7 +3150,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3227,28 +3269,28 @@ public string BaseUrl throw new ExternalApplicationsException("Notification not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3362,28 +3404,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3500,28 +3542,28 @@ public string BaseUrl throw new ExternalApplicationsException("Notification not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3624,28 +3666,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3752,28 +3794,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -3804,6 +3846,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -3815,7 +3877,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -3831,7 +3893,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -3857,10 +3919,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -3900,7 +3962,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TemplatesClient : ITemplatesClient { #pragma warning disable 8618 @@ -4062,7 +4124,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4187,28 +4249,28 @@ public string BaseUrl throw new ExternalApplicationsException("Template not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4239,6 +4301,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -4250,7 +4332,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -4266,7 +4348,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -4292,10 +4374,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -4335,7 +4417,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TokensClient : ITokensClient { #pragma warning disable 8618 @@ -4479,7 +4561,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4510,6 +4592,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -4521,7 +4623,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -4537,7 +4639,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -4563,10 +4665,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -4606,7 +4708,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserFeedbackClient : IUserFeedbackClient { #pragma warning disable 8618 @@ -4720,28 +4822,28 @@ public string BaseUrl throw new ExternalApplicationsException("Invalid request data.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too many requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too many requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -4772,6 +4874,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -4783,7 +4905,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -4799,7 +4921,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -4825,10 +4947,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -4868,7 +4990,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UsersClient : IUsersClient { #pragma warning disable 8618 @@ -5015,7 +5137,7 @@ public string BaseUrl } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5115,28 +5237,28 @@ public string BaseUrl throw new ExternalApplicationsException("Unauthorized - no valid user token", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5167,6 +5289,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -5178,7 +5320,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -5194,7 +5336,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -5220,10 +5362,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -5263,7 +5405,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class HubAuthClient : IHubAuthClient { #pragma warning disable 8618 @@ -5397,28 +5539,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5517,28 +5659,28 @@ public string BaseUrl throw new ExternalApplicationsException("Forbidden - user does not have required permissions", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 429) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 429) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ExternalApplicationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new ExternalApplicationsException("Too Many Requests.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new ExternalApplicationsException("Internal server error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseData_ = response_.Content == null ? null : await ReadAsStringAsync(response_.Content, cancellationToken).ConfigureAwait(false); throw new ExternalApplicationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } @@ -5569,6 +5711,26 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStringAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStringAsync(cancellationToken); + #else + return content.ReadAsStringAsync(); + #endif + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private static System.Threading.Tasks.Task ReadAsStreamAsync(System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken) + { + #if NET5_0_OR_GREATER + return content.ReadAsStreamAsync(cancellationToken); + #else + return content.ReadAsStreamAsync(); + #endif + } + public bool ReadResponseAsString { get; set; } protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) @@ -5580,7 +5742,7 @@ protected virtual async System.Threading.Tasks.Task> Rea if (ReadResponseAsString) { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var responseText = await ReadAsStringAsync(response.Content, cancellationToken).ConfigureAwait(false); try { var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); @@ -5596,7 +5758,7 @@ protected virtual async System.Threading.Tasks.Task> Rea { try { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var responseStream = await ReadAsStreamAsync(response.Content, cancellationToken).ConfigureAwait(false)) { var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); return new ObjectResponseResult(typedBody, string.Empty); @@ -5622,10 +5784,10 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu var name = System.Enum.GetName(value.GetType(), value); if (name != null) { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) + var field_ = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field_ != null) { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field_, typeof(System.Runtime.Serialization.EnumMemberAttribute)) as System.Runtime.Serialization.EnumMemberAttribute; if (attribute != null) { @@ -5671,10 +5833,14 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu #pragma warning restore 114 #pragma warning restore 472 #pragma warning restore 612 +#pragma warning restore 649 #pragma warning restore 1573 #pragma warning restore 1591 #pragma warning restore 8073 #pragma warning restore 3016 +#pragma warning restore 8600 +#pragma warning restore 8602 #pragma warning restore 8603 #pragma warning restore 8604 -#pragma warning restore 8625 \ No newline at end of file +#pragma warning restore 8625 +#pragma warning restore 8765 \ No newline at end of file diff --git a/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Contracts.g.cs b/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Contracts.g.cs index 10e5a446..c3bb17b1 100644 --- a/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Contracts.g.cs +++ b/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/Contracts.g.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- @@ -18,6 +18,8 @@ #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" #pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type" +#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference" #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" #pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" #pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" @@ -27,7 +29,7 @@ namespace GovUK.Dfe.ExternalApplications.Api.Client.Contracts { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IApplicationsClient { @@ -145,7 +147,7 @@ public partial interface IApplicationsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IDiagnosticsClient { @@ -155,7 +157,7 @@ public partial interface IDiagnosticsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface INotificationsClient { @@ -249,7 +251,7 @@ public partial interface INotificationsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ITemplatesClient { @@ -271,7 +273,7 @@ public partial interface ITemplatesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ITokensClient { @@ -285,7 +287,7 @@ public partial interface ITokensClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IUserFeedbackClient { @@ -296,7 +298,7 @@ public partial interface IUserFeedbackClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IUsersClient { @@ -318,7 +320,7 @@ public partial interface IUsersClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IHubAuthClient { @@ -335,7 +337,7 @@ public partial interface IHubAuthClient - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FileParameter { public FileParameter(System.IO.Stream data) @@ -362,7 +364,7 @@ public FileParameter(System.IO.Stream data, string fileName, string contentType) public string ContentType { get; private set; } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FileResponse : System.IDisposable { private System.IDisposable _client; @@ -399,7 +401,7 @@ public void Dispose() } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ExternalApplicationsException : System.Exception { public int StatusCode { get; private set; } @@ -422,7 +424,7 @@ public override string ToString() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ExternalApplicationsException : ExternalApplicationsException { public TResult Result { get; private set; } @@ -440,10 +442,14 @@ public ExternalApplicationsException(string message, int statusCode, string resp #pragma warning restore 114 #pragma warning restore 472 #pragma warning restore 612 +#pragma warning restore 649 #pragma warning restore 1573 #pragma warning restore 1591 #pragma warning restore 8073 #pragma warning restore 3016 +#pragma warning restore 8600 +#pragma warning restore 8602 #pragma warning restore 8603 #pragma warning restore 8604 -#pragma warning restore 8625 \ No newline at end of file +#pragma warning restore 8625 +#pragma warning restore 8765 \ No newline at end of file diff --git a/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/swagger.json b/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/swagger.json index 7310c889..77643722 100644 --- a/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/swagger.json +++ b/src/GovUK.Dfe.ExternalApplications.Api.Client/Generated/swagger.json @@ -1,5 +1,5 @@ { - "x-generator": "NSwag v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))", + "x-generator": "NSwag v14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))", "openapi": "3.0.0", "info": { "title": "Api", @@ -2914,6 +2914,10 @@ "InProgress", "Submitted" ], + "x-enum-descriptions": [ + "In progress", + "Submitted" + ], "enum": [ "InProgress", "Submitted" diff --git a/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj b/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj index 10e7a23d..7b167c50 100644 --- a/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj +++ b/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj @@ -9,11 +9,11 @@ API Client The API description. DFE-Digital - net8.0 + net10.0 - + @@ -22,18 +22,16 @@ + - - - - - - - - - - + + + + + + + diff --git a/src/GovUK.Dfe.ExternalApplications.Api.Client/nswag.json b/src/GovUK.Dfe.ExternalApplications.Api.Client/nswag.json index 612d5fb1..e01a6644 100644 --- a/src/GovUK.Dfe.ExternalApplications.Api.Client/nswag.json +++ b/src/GovUK.Dfe.ExternalApplications.Api.Client/nswag.json @@ -1,5 +1,5 @@ { - "runtime": "Net80", + "runtime": "Net90", "defaultVariables": "CSharpOutputPath=../GovUK.Dfe.ExternalApplications.Api.Client", "documentGenerator": { "aspNetCoreToOpenApi": { @@ -7,7 +7,7 @@ "msBuildProjectExtensionsPath": null, "configuration": "Debug", "runtime": "", - "targetFramework": "net8.0", + "targetFramework": "net10.0", "noBuild": true, "verbose": true, "workingDirectory": "../DfE.ExternalApplications.Api", diff --git a/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj b/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj index ebbdbe0e..41b8bbd0 100644 --- a/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj +++ b/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj @@ -14,12 +14,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj b/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj index 6d15f8ba..ed75332c 100644 --- a/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj +++ b/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj b/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj index 463acf2c..866fbc03 100644 --- a/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj +++ b/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj @@ -17,10 +17,10 @@ - - - - + + + + diff --git a/swagger_https.json b/swagger_https.json new file mode 100644 index 00000000..edb79d32 --- /dev/null +++ b/swagger_https.json @@ -0,0 +1,6147 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "API", + "contact": { + "name": "Support", + "email": "update_to_contact_email_here" + }, + "version": "1.0" + }, + "paths": { + "/v1/Applications": { + "post": { + "tags": [ + "Applications" + ], + "summary": "Creates a new application with initial response.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateApplicationRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateApplicationRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CreateApplicationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The created application.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/{applicationId}/responses": { + "post": { + "tags": [ + "Applications" + ], + "summary": "Adds a new response version to an existing application.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddApplicationResponseRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AddApplicationResponseRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/AddApplicationResponseRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Response version created.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ApplicationResponseDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationResponseDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationResponseDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to update this application.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/me/applications": { + "get": { + "tags": [ + "Applications" + ], + "summary": "Returns all applications the current user can access.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "includeSchema", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "templateId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "A list of applications accessible to the user.", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Users/{email}/applications": { + "get": { + "tags": [ + "Applications" + ], + "summary": "Returns all applications for the user by {email}.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "email", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeSchema", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "templateId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Applications for the user.", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + } + } + }, + "400": { + "description": "Email cannot be null or empty.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/reference/{applicationReference}": { + "get": { + "tags": [ + "Applications" + ], + "summary": "Returns application details with its latest response by application reference.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationReference", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Application details with latest response.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + } + }, + "400": { + "description": "Invalid application reference or application not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to read this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/{applicationId}/submit": { + "post": { + "tags": [ + "Applications" + ], + "summary": "Submits an application, changing its status to Submitted.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Application submitted successfully.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationDto" + } + } + } + }, + "400": { + "description": "Invalid request data or application already submitted.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to submit this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/{applicationId}/contributors": { + "get": { + "tags": [ + "Applications" + ], + "summary": "Gets all contributors for a specific application.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includePermissionDetails", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "List of contributors for the application.", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to read this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + }, + "post": { + "tags": [ + "Applications" + ], + "summary": "Adds a contributor to an application.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddContributorRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AddContributorRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/AddContributorRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Contributor added successfully.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "400": { + "description": "Invalid request data or contributor already exists.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to manage contributors for this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/{applicationId}/contributors/{userId}": { + "delete": { + "tags": [ + "Applications" + ], + "summary": "Removes a contributor from an application.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Contributor removed successfully." + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to manage contributors for this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application or contributor not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/{applicationId}/files": { + "post": { + "tags": [ + "Applications" + ], + "summary": "Uploads a file for a specific application.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "name": { + "style": "form" + }, + "description": { + "style": "form" + }, + "file": { + "style": "form" + } + } + } + } + }, + "responses": { + "201": { + "description": "File uploaded successfully.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UploadDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UploadDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UploadDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to manage files for this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "409": { + "description": "Conflict Error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + }, + "get": { + "tags": [ + "Applications" + ], + "summary": "Gets all files for a specific application.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "List of files for the application.", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UploadDto" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UploadDto" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UploadDto" + } + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to manage files for this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/{applicationId}/files/{fileId}/download": { + "get": { + "tags": [ + "Applications" + ], + "summary": "Downloads a file by fileId.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "fileId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "File stream.", + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to manage files for this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "File not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/{applicationId}/files/{fileId}": { + "delete": { + "tags": [ + "Applications" + ], + "summary": "Deletes a file by fileId.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "fileId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "applicationId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "File deleted successfully.", + "content": { + "text/plain": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to manage files for this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "File not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Applications/reference/{applicationReference}/preview/download": { + "get": { + "tags": [ + "Applications" + ], + "summary": "Generates and downloads a static HTML preview of the application by reference.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "applicationReference", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Static HTML file.", + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "User does not have permission to read this application", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Application not found", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/diagnostics": { + "get": { + "tags": [ + "Diagnostics" + ], + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { } + ] + } + }, + "/auth/hub-ticket": { + "post": { + "tags": [ + "HubAuth" + ], + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "responses": { + "200": { + "description": "The created ticket.", + "content": { + "text/plain": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "text/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/auth/hub-cookie": { + "get": { + "tags": [ + "HubAuth" + ], + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "ticket", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications": { + "post": { + "tags": [ + "Notifications" + ], + "summary": "Creates a new notification for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddNotificationRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AddNotificationRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/AddNotificationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The created notification.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/NotificationDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/NotificationDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + }, + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets all notifications (read and unread) for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "context", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "category", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of all notifications.", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/unread": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets all unread notifications for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "context", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "category", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of unread notifications.", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/category/{category}": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets notifications filtered by category.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "category", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "unreadOnly", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "List of notifications for the specified category.", + "content": { + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Clears notifications by category for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "category", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Notifications cleared successfully.", + "content": { + "text/plain": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/unread/count": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Gets the count of unread notifications for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "context", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "category", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Count of unread notifications.", + "content": { + "text/plain": { + "schema": { + "type": "integer", + "format": "int32" + } + }, + "application/json": { + "schema": { + "type": "integer", + "format": "int32" + } + }, + "text/json": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/{notificationId}/read": { + "put": { + "tags": [ + "Notifications" + ], + "summary": "Marks a specific notification as read.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "notificationId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Notification marked as read successfully.", + "content": { + "text/plain": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Notification not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/read-all": { + "put": { + "tags": [ + "Notifications" + ], + "summary": "Marks all notifications as read for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "context", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "category", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "All notifications marked as read successfully.", + "content": { + "text/plain": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/{notificationId}": { + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Removes a specific notification.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "notificationId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Notification removed successfully.", + "content": { + "text/plain": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Notification not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/clear-all": { + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Clears all notifications for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "responses": { + "200": { + "description": "All notifications cleared successfully.", + "content": { + "text/plain": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Notifications/context/{context}": { + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Clears notifications by context for the current user.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "context", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Notifications cleared successfully.", + "content": { + "text/plain": { + "schema": { + "type": "boolean" + } + }, + "application/json": { + "schema": { + "type": "boolean" + } + }, + "text/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Templates/{templateId}/schema": { + "get": { + "tags": [ + "Templates" + ], + "summary": "Returns the latest template schema for the specified template name if the user has access.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "templateId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "The latest template schema.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/TemplateSchemaDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/TemplateSchemaDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/TemplateSchemaDto" + } + } + } + }, + "400": { + "description": "Request was invalid or template not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Access denied.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Template not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Templates/{templateId}/versions": { + "post": { + "tags": [ + "Templates" + ], + "summary": "Creates a new schema version for the specified template.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + }, + { + "name": "templateId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTemplateVersionRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/CreateTemplateVersionRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/CreateTemplateVersionRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Template version created successfully.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/TemplateSchemaDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/TemplateSchemaDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/TemplateSchemaDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Access denied.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "404": { + "description": "Template not found.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Tokens/exchange": { + "post": { + "tags": [ + "Tokens" + ], + "summary": "Exchanges an DSI token for our ExternalApplications InternalUser JWT.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeTokenRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeTokenRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/ExchangeTokenRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Token exchanged successfully.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExchangeTokenDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeTokenDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeTokenDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/UserFeedback": { + "post": { + "tags": [ + "UserFeedback" + ], + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/BugReport" + }, + { + "$ref": "#/components/schemas/SupportRequest" + }, + { + "$ref": "#/components/schemas/FeedbackOrSuggestion" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/BugReport" + }, + { + "$ref": "#/components/schemas/SupportRequest" + }, + { + "$ref": "#/components/schemas/FeedbackOrSuggestion" + } + ] + } + }, + "application/*+json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/BugReport" + }, + { + "$ref": "#/components/schemas/SupportRequest" + }, + { + "$ref": "#/components/schemas/FeedbackOrSuggestion" + } + ] + } + } + } + }, + "responses": { + "202": { + "description": "User feedback was submitted successfully." + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too many requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/me/permissions": { + "get": { + "tags": [ + "Users" + ], + "summary": "Returns all my permissions.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "responses": { + "200": { + "description": "A UserAuthorizationDto object representing the User's Permissions and Roles.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UserAuthorizationDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserAuthorizationDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UserAuthorizationDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "403": { + "description": "Forbidden - user does not have required permissions", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + }, + "/v1/Users/register": { + "post": { + "tags": [ + "Users" + ], + "summary": "Create and registers a new user using the data in the provided External-IDP token.", + "parameters": [ + { + "name": "X-Tenant-ID", + "in": "header", + "description": "Tenant identifier (GUID). Available tenants:\n- `22222222-2222-4222-8222-222222222222` = Lsrp\n- `11111111-1111-4111-8111-111111111111` = Transfers", + "required": true, + "schema": { + "enum": [ + "22222222-2222-4222-8222-222222222222", + "11111111-1111-4111-8111-111111111111" + ], + "type": "string", + "format": "uuid", + "default": "22222222-2222-4222-8222-222222222222" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterUserRequest" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/RegisterUserRequest" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/RegisterUserRequest" + } + } + } + }, + "responses": { + "200": { + "description": "User registered successfully.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "400": { + "description": "Invalid request data.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - no valid user token", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + }, + "429": { + "description": "Too Many Requests.", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ExceptionResponse" + } + } + } + } + }, + "security": [ + { } + ] + } + } + }, + "components": { + "schemas": { + "AccessType": { + "enum": [ + "Read", + "Write", + "Delete" + ], + "type": "string" + }, + "AddApplicationResponseRequest": { + "required": [ + "responseBody" + ], + "type": "object", + "properties": { + "responseBody": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AddContributorRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AddNotificationRequest": { + "required": [ + "message", + "type" + ], + "type": "object", + "properties": { + "message": { + "maxLength": 1000, + "minLength": 1, + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/NotificationType" + }, + "category": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "context": { + "maxLength": 100, + "type": "string", + "nullable": true + }, + "autoDismiss": { + "type": "boolean", + "nullable": true + }, + "autoDismissSeconds": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "actionUrl": { + "maxLength": 500, + "type": "string", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { }, + "nullable": true + }, + "priority": { + "$ref": "#/components/schemas/NotificationPriority" + }, + "replaceExistingContext": { + "type": "boolean", + "nullable": true + }, + "userId": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "ApplicationDto": { + "type": "object", + "properties": { + "applicationId": { + "type": "string", + "format": "uuid" + }, + "applicationReference": { + "type": "string", + "nullable": true + }, + "templateVersionId": { + "type": "string", + "format": "uuid" + }, + "templateName": { + "type": "string", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ApplicationStatus" + }, + "dateCreated": { + "type": "string", + "format": "date-time" + }, + "dateSubmitted": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "createdBy": { + "$ref": "#/components/schemas/UserDto" + }, + "latestResponse": { + "$ref": "#/components/schemas/ApplicationResponseDetailsDto" + }, + "templateSchema": { + "$ref": "#/components/schemas/TemplateSchemaDto" + } + }, + "additionalProperties": false + }, + "ApplicationResponseDetailsDto": { + "type": "object", + "properties": { + "responseId": { + "type": "string", + "format": "uuid" + }, + "responseBody": { + "type": "string", + "nullable": true + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "string", + "format": "uuid" + }, + "lastModifiedOn": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "lastModifiedBy": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "ApplicationResponseDto": { + "type": "object", + "properties": { + "responseId": { + "type": "string", + "format": "uuid" + }, + "applicationReference": { + "type": "string", + "nullable": true + }, + "applicationId": { + "type": "string", + "format": "uuid" + }, + "responseBody": { + "type": "string", + "nullable": true + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "createdBy": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "ApplicationStatus": { + "enum": [ + "InProgress", + "Submitted" + ], + "type": "string" + }, + "BugReport": { + "allOf": [ + { + "$ref": "#/components/schemas/UserFeedbackRequest" + }, + { + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + ] + }, + "CreateApplicationRequest": { + "required": [ + "initialResponseBody", + "templateId" + ], + "type": "object", + "properties": { + "templateId": { + "type": "string", + "format": "uuid" + }, + "initialResponseBody": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "CreateTemplateVersionRequest": { + "type": "object", + "properties": { + "versionNumber": { + "type": "string", + "nullable": true + }, + "jsonSchema": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExceptionResponse": { + "type": "object", + "properties": { + "errorId": { + "type": "string", + "nullable": true + }, + "statusCode": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "string", + "nullable": true + }, + "exceptionType": { + "type": "string", + "nullable": true + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "correlationId": { + "type": "string", + "nullable": true + }, + "context": { + "type": "object", + "additionalProperties": { }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ExchangeTokenDto": { + "type": "object", + "properties": { + "access_token": { + "type": "string", + "nullable": true + }, + "token_type": { + "type": "string", + "nullable": true + }, + "expires_in": { + "type": "integer", + "format": "int32" + }, + "refresh_token": { + "type": "string", + "nullable": true + }, + "scope": { + "type": "string", + "nullable": true + }, + "id_token": { + "type": "string", + "nullable": true + }, + "refresh_expires_in": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExchangeTokenRequest": { + "type": "object", + "properties": { + "accessToken": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "FeedbackOrSuggestion": { + "allOf": [ + { + "$ref": "#/components/schemas/UserFeedbackRequest" + }, + { + "type": "object", + "properties": { + "satisfactionScore": { + "$ref": "#/components/schemas/SatisfactionScore" + } + }, + "additionalProperties": false + } + ] + }, + "NotificationDto": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/NotificationType" + }, + "category": { + "type": "string", + "nullable": true + }, + "context": { + "type": "string", + "nullable": true + }, + "isRead": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "autoDismiss": { + "type": "boolean" + }, + "autoDismissSeconds": { + "type": "integer", + "format": "int32" + }, + "userId": { + "type": "string", + "nullable": true + }, + "actionUrl": { + "type": "string", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { }, + "nullable": true + }, + "priority": { + "$ref": "#/components/schemas/NotificationPriority" + } + }, + "additionalProperties": false + }, + "NotificationPriority": { + "enum": [ + "Low", + "Normal", + "High", + "Critical" + ], + "type": "string" + }, + "NotificationType": { + "enum": [ + "Success", + "Error", + "Info", + "Warning" + ], + "type": "string" + }, + "RegisterUserRequest": { + "type": "object", + "properties": { + "accessToken": { + "type": "string", + "nullable": true + }, + "templateId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "ResourceType": { + "enum": [ + "Application", + "User", + "Template", + "TaskGroup", + "Task", + "Page", + "Field", + "ApplicationFiles", + "File", + "Notifications" + ], + "type": "string" + }, + "SatisfactionScore": { + "enum": [ + "VerySatisfied", + "Satisfied", + "NeitherSatisfiedOrDissatisfied", + "Dissatisfied", + "VeryDissatisfied" + ], + "type": "string" + }, + "SupportRequest": { + "allOf": [ + { + "$ref": "#/components/schemas/UserFeedbackRequest" + }, + { + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + ] + }, + "TemplateSchemaDto": { + "required": [ + "jsonSchema", + "templateId", + "templateVersionId", + "versionNumber" + ], + "type": "object", + "properties": { + "templateId": { + "type": "string", + "format": "uuid" + }, + "templateVersionId": { + "type": "string", + "format": "uuid" + }, + "versionNumber": { + "type": "string", + "nullable": true + }, + "jsonSchema": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "UploadDto": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "applicationId": { + "type": "string", + "format": "uuid" + }, + "uploadedBy": { + "type": "string", + "format": "uuid" + }, + "uploadedByUser": { + "$ref": "#/components/schemas/UserDto" + }, + "name": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "originalFileName": { + "type": "string", + "nullable": true + }, + "fileName": { + "type": "string", + "nullable": true + }, + "fileSize": { + "type": "integer", + "format": "int64" + }, + "uploadedOn": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false + }, + "UserAuthorizationDto": { + "required": [ + "permissions", + "roles" + ], + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserPermissionDto" + }, + "nullable": true + }, + "roles": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "UserDto": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "nullable": true + }, + "roleId": { + "type": "string", + "format": "uuid" + }, + "authorization": { + "$ref": "#/components/schemas/UserAuthorizationDto" + } + }, + "additionalProperties": false + }, + "UserFeedbackRequest": { + "required": [ + "$type" + ], + "type": "object", + "properties": { + "$type": { + "type": "string" + }, + "message": { + "type": "string", + "nullable": true + }, + "referenceNumber": { + "type": "string", + "nullable": true + }, + "templateId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "$type", + "mapping": { + "BugReport": "#/components/schemas/BugReport", + "SupportRequest": "#/components/schemas/SupportRequest", + "FeedbackOrSuggestion": "#/components/schemas/FeedbackOrSuggestion" + } + } + }, + "UserPermissionDto": { + "required": [ + "accessType", + "resourceType" + ], + "type": "object", + "properties": { + "applicationId": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "resourceKey": { + "type": "string", + "nullable": true + }, + "resourceType": { + "$ref": "#/components/schemas/ResourceType" + }, + "accessType": { + "$ref": "#/components/schemas/AccessType" + } + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "Bearer": { + "type": "http", + "description": "User JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + }, + "tags": [ + { + "name": "Applications" + }, + { + "name": "Diagnostics" + }, + { + "name": "HubAuth" + }, + { + "name": "Notifications" + }, + { + "name": "Templates" + }, + { + "name": "Tokens" + }, + { + "name": "UserFeedback" + }, + { + "name": "Users" + } + ] +} \ No newline at end of file From 8eca9afa121af461d64e2c9b19d9c2ba0118b8db Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Tue, 24 Feb 2026 16:23:39 +0000 Subject: [PATCH 02/11] Fixed packages --- .../DfE.ExternalApplications.Api.csproj | 8 +------- .../DfE.ExternalApplications.Application.csproj | 2 -- .../DfE.ExternalApplications.Domain.csproj | 7 ++++--- .../GovUK.Dfe.ExternalApplications.Api.Client.csproj | 6 ------ .../DfE.ExternalApplications.Api.Tests.Integration.csproj | 1 - .../DfE.ExternalApplications.Application.Tests.csproj | 1 - 6 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj index b8dbeb27..7d58dbf2 100644 --- a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj +++ b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj @@ -1,4 +1,4 @@ - + true @@ -13,7 +13,6 @@ - @@ -21,10 +20,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -40,7 +35,6 @@ - diff --git a/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj b/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj index 1746a0c2..2ec34491 100644 --- a/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj +++ b/src/DfE.ExternalApplications.Application/DfE.ExternalApplications.Application.csproj @@ -16,8 +16,6 @@ - - diff --git a/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj b/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj index af2a86b0..6d7240ec 100644 --- a/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj +++ b/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj @@ -5,11 +5,12 @@ - - + + - + + diff --git a/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj b/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj index 7b167c50..cf013970 100644 --- a/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj +++ b/src/GovUK.Dfe.ExternalApplications.Api.Client/GovUK.Dfe.ExternalApplications.Api.Client.csproj @@ -26,12 +26,6 @@ - - - - - - diff --git a/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj b/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj index 41b8bbd0..7ee8ee8c 100644 --- a/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj +++ b/src/Tests/DfE.ExternalApplications.Api.Tests.Integration/DfE.ExternalApplications.Api.Tests.Integration.csproj @@ -8,7 +8,6 @@ - all diff --git a/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj b/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj index ed75332c..77957269 100644 --- a/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj +++ b/src/Tests/DfE.ExternalApplications.Application.Tests/DfE.ExternalApplications.Application.Tests.csproj @@ -11,7 +11,6 @@ - runtime; build; native; contentfiles; analyzers; buildtransitive all From 6d3f3b03d3fe6aaa2a649f4a0a7454220447532d Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Tue, 24 Feb 2026 16:55:21 +0000 Subject: [PATCH 03/11] Updated CoreLibs Testing package reference --- .../DfE.ExternalApplications.Tests.Common.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj b/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj index 866fbc03..327e4a71 100644 --- a/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj +++ b/src/Tests/DfE.ExternalApplications.Tests.Common/DfE.ExternalApplications.Tests.Common.csproj @@ -16,7 +16,7 @@ - + From 35a2c57a9d695891f9b55364c598863e3db4bb97 Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Thu, 5 Mar 2026 16:09:08 +0000 Subject: [PATCH 04/11] Updated the docker dotnet image --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45d8b4ab..615cb3c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG DOTNET_VERSION=10.0 # ============================================================ # Stage 1 - Build + Install Playwright (Ubuntu SDK) # ============================================================ -FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-jammy AS build +FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-noble AS build WORKDIR /build ARG CI ENV CI=${CI} @@ -64,7 +64,7 @@ COPY --from=build /app/appsettings* /DfE.ExternalApplications.Api/ # Stage 4 - Final Runtime (Ubuntu) + Playwright Runtime Support # ============================================================ -FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION}-jammy AS final +FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION}-noble AS final WORKDIR /app # Install Playwright required system dependencies From c884dacd517d5261ec472e211ffd10b60d9eaa05 Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Thu, 5 Mar 2026 16:14:22 +0000 Subject: [PATCH 05/11] Renamed ubuntu packages --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 615cb3c1..b5746e07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,23 +71,23 @@ WORKDIR /app RUN apt-get update && \ apt-get install -y \ libnss3 \ - libatk1.0-0 \ - libatk-bridge2.0-0 \ - libcups2 \ + libatk1.0-0t64 \ + libatk-bridge2.0-0t64 \ + libcups2t64 \ libdbus-1-3 \ libdrm2 \ libxcomposite1 \ libxdamage1 \ libxrandr2 \ libgbm1 \ - libasound2 \ + libasound2t64 \ libxshmfence1 \ libxkbcommon0 \ libxext6 \ libxfixes3 \ libx11-6 \ libx11-xcb1 \ - libglib2.0-0 \ + libglib2.0-0t64 \ libgl1 \ libpango-1.0-0 \ libpangocairo-1.0-0 \ From 9360e2ea8f34a9d7ed5eb7a13faaa59b1d4b705e Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Thu, 5 Mar 2026 16:19:37 +0000 Subject: [PATCH 06/11] Updated package references --- .../DfE.ExternalApplications.Api.csproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj index 7d58dbf2..5d4e3b29 100644 --- a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj +++ b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj @@ -1,4 +1,4 @@ - + true @@ -20,6 +20,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From f4a03a5114311f6e515db24bfb8cc404e74a953a Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Thu, 5 Mar 2026 16:28:31 +0000 Subject: [PATCH 07/11] Downgraded MediatR --- .../DfE.ExternalApplications.Domain.csproj | 2 +- .../Database/ExternalApplicationsContext.cs | 7 +++- .../Database/GenericDbContextFactory.cs | 38 ------------------- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj b/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj index 6d7240ec..392666ba 100644 --- a/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj +++ b/src/DfE.ExternalApplications.Domain/DfE.ExternalApplications.Domain.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/DfE.ExternalApplications.Infrastructure/Database/ExternalApplicationsContext.cs b/src/DfE.ExternalApplications.Infrastructure/Database/ExternalApplicationsContext.cs index 1971c2ba..71ce8ad7 100644 --- a/src/DfE.ExternalApplications.Infrastructure/Database/ExternalApplicationsContext.cs +++ b/src/DfE.ExternalApplications.Infrastructure/Database/ExternalApplicationsContext.cs @@ -50,8 +50,11 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) optionsBuilder.UseSqlServer(connectionString); } - var mediator = _serviceProvider.GetRequiredService(); - optionsBuilder.AddInterceptors(new DomainEventDispatcherInterceptor(mediator)); + var mediator = _serviceProvider?.GetService(); + if (mediator != null) + { + optionsBuilder.AddInterceptors(new DomainEventDispatcherInterceptor(mediator)); + } } protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/src/DfE.ExternalApplications.Infrastructure/Database/GenericDbContextFactory.cs b/src/DfE.ExternalApplications.Infrastructure/Database/GenericDbContextFactory.cs index eba9ee03..786aa999 100644 --- a/src/DfE.ExternalApplications.Infrastructure/Database/GenericDbContextFactory.cs +++ b/src/DfE.ExternalApplications.Infrastructure/Database/GenericDbContextFactory.cs @@ -2,8 +2,6 @@ using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using System.Reflection; -using System.Linq; using DfE.ExternalApplications.Infrastructure.Services; namespace DfE.ExternalApplications.Infrastructure.Database @@ -33,42 +31,6 @@ public TContext CreateDbContext(string[] args) var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlServer(connectionString); - // Try to add MediatR for runtime, but don't fail if the Application assembly isn't available - try - { - // First, try to build the Application project to ensure the assembly is available - var applicationProjectPath = Path.Combine(Directory.GetCurrentDirectory(), "../DfE.ExternalApplications.Application"); - if (Directory.Exists(applicationProjectPath)) - { - var buildProcess = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo - { - FileName = "dotnet", - Arguments = $"build \"{applicationProjectPath}\"", - UseShellExecute = false, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true - }); - - if (buildProcess != null) - { - buildProcess.WaitForExit(); - } - } - - var appAssembly = Assembly.Load("DfE.ExternalApplications.Application"); - services.AddMediatR(cfg => - { - cfg.RegisterServicesFromAssembly(appAssembly); - }); - } - catch (Exception) - { - // If we can't load the Application assembly, create a minimal MediatR setup - // This is acceptable for design-time operations like migrations - services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(GenericDbContextFactory<>).Assembly)); - } - var serviceProvider = services.BuildServiceProvider(); return (TContext)Activator.CreateInstance( From c9632a61594a7ef4ee9ea07ad0e89892e4afa4d3 Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Thu, 5 Mar 2026 16:31:19 +0000 Subject: [PATCH 08/11] Trigger build --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b5746e07..7ec14287 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,4 +105,4 @@ RUN chmod +x /app/docker-entrypoint.sh ENV ASPNETCORE_URLS=http://+:8080 USER $APP_UID -ENTRYPOINT ["/app/docker-entrypoint.sh"] +ENTRYPOINT ["/app/docker-entrypoint.sh"] \ No newline at end of file From 24f632be68451a4daff5bcc64886e8236d8b9808 Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Fri, 6 Mar 2026 09:54:08 +0000 Subject: [PATCH 09/11] Updated the trivy library --- .github/workflows/docker-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 651e4052..4f3a1932 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -44,7 +44,7 @@ jobs: run: docker save -o ${{ steps.build.outputs.imageid }}.tar ${{ steps.build.outputs.imageid }} - name: Scan Docker image for CVEs - uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # 0.30.0 + uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2 with: input: ${{ steps.build.outputs.imageid }}.tar format: 'sarif' @@ -56,6 +56,6 @@ jobs: - name: Upload scan results to GitHub Security uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3 - if: always() + if: always() && hashFiles('trivy-results.sarif') != '' with: sarif_file: 'trivy-results.sarif' From fd74e34f732c09a6adf61d5dfc9d9298ea8f39c5 Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Fri, 6 Mar 2026 16:01:02 +0000 Subject: [PATCH 10/11] Updated versions --- CHANGELOG.md | 6 +++++- .../DfE.ExternalApplications.Api.csproj | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ba36c05..5d9bc198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,4 +37,8 @@ All notable changes to this service will be documented in this file. ## [1.1.4] – Public Beta ### Notes -- Updated CoreLibs Security package to support ExtIdentityValidator for multi-tenancy. \ No newline at end of file +- Updated CoreLibs Security package to support ExtIdentityValidator for multi-tenancy. + +## [1.1.5] – Public Beta +### Notes +- Upgraded to .NET10 \ No newline at end of file diff --git a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj index 5d4e3b29..e9e5d9bc 100644 --- a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj +++ b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj @@ -5,8 +5,8 @@ $(NoWarn);1591 net10.0 f714ca7a-fc08-46ff-b0cc-373d6f04cf4c - 1.1.4 - 1.1.4 + 1.1.5 + 1.1.5 @@ -20,10 +20,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - From 650733cb184dead2c94fdf486aba501dfdbd5520 Mon Sep 17 00:00:00 2001 From: FrostyApeOne Date: Fri, 6 Mar 2026 16:11:17 +0000 Subject: [PATCH 11/11] Added entity framework design --- .../DfE.ExternalApplications.Api.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj index e9e5d9bc..76943a0b 100644 --- a/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj +++ b/src/DfE.ExternalApplications.Api/DfE.ExternalApplications.Api.csproj @@ -20,6 +20,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive +