diff --git a/LeaderboardBackend.Test/Leaderboards.cs b/LeaderboardBackend.Test/Leaderboards.cs index ad98ec61..0e07c6d9 100644 --- a/LeaderboardBackend.Test/Leaderboards.cs +++ b/LeaderboardBackend.Test/Leaderboards.cs @@ -353,27 +353,30 @@ public async Task RestoreLeaderboard_OK() DeletedAt = _clock.GetCurrentInstant() }; + Instant now = Instant.FromUnixTimeSeconds(1); + _clock.Reset(now); + context.Leaderboards.Add(deletedBoard); await context.SaveChangesAsync(); deletedBoard.Id.Should().NotBe(default); - HttpResponseMessage res = await _apiClient.Put($"/leaderboard/{deletedBoard.Id}/restore", new() + _clock.AdvanceMinutes(1); + + LeaderboardViewModel res = await _apiClient.Put($"/leaderboard/{deletedBoard.Id}/restore", new() { Jwt = _jwt }); - res.StatusCode.Should().Be(HttpStatusCode.NoContent); - context.ChangeTracker.Clear(); - Leaderboard? board = await context.Leaderboards.FindAsync(deletedBoard.Id); - board.Should().NotBeNull(); - // TODO: `DeletedAt` is still not null here. Don't know how to fix it. - board!.DeletedAt.Should().BeNull(); + res.Id.Should().Be(deletedBoard.Id); + res.Slug.Should().Be(deletedBoard.Slug); + res.UpdatedAt.Should().Be(res.CreatedAt + Duration.FromMinutes(1)); + res.DeletedAt.Should().BeNull(); } [Test] public async Task RestoreLeaderboard_NotFound() { - Func> act = async () => await _apiClient.Put($"/leaderboard/100/restore", new() + Func> act = async () => await _apiClient.Put($"/leaderboard/100/restore", new() { Jwt = _jwt }); @@ -396,7 +399,7 @@ public async Task RestoreLeaderboard_NotFound_WasNeverDeleted() await context.SaveChangesAsync(); board.Id.Should().NotBe(default); - Func> act = async () => await _apiClient.Put($"/leaderboard/{board.Id}/restore", new() + Func> act = async () => await _apiClient.Put($"/leaderboard/{board.Id}/restore", new() { Jwt = _jwt }); diff --git a/LeaderboardBackend.Test/TestApi/TestApiClient.cs b/LeaderboardBackend.Test/TestApi/TestApiClient.cs index 5c448a0c..d9403dd5 100644 --- a/LeaderboardBackend.Test/TestApi/TestApiClient.cs +++ b/LeaderboardBackend.Test/TestApi/TestApiClient.cs @@ -42,8 +42,8 @@ public async Task Get(string endpoint, HttpRequestInit ini public async Task Post(string endpoint, HttpRequestInit init) => await SendAndRead(endpoint, init with { Method = HttpMethod.Post }); - public async Task Put(string endpoint, HttpRequestInit init) => - await Send(endpoint, init with { Method = HttpMethod.Put }); + public async Task Put(string endpoint, HttpRequestInit init) => + await SendAndRead(endpoint, init with { Method = HttpMethod.Put }); public async Task Delete(string endpoint, HttpRequestInit init) => await Send(endpoint, init with { Method = HttpMethod.Delete }); diff --git a/LeaderboardBackend/Controllers/LeaderboardsController.cs b/LeaderboardBackend/Controllers/LeaderboardsController.cs index 19345a5b..9ecd9292 100644 --- a/LeaderboardBackend/Controllers/LeaderboardsController.cs +++ b/LeaderboardBackend/Controllers/LeaderboardsController.cs @@ -31,7 +31,7 @@ public async Task> GetLeaderboard(long id) [AllowAnonymous] [HttpGet("api/leaderboard")] - [SwaggerOperation("Gets a Leaderboard by its slug.", OperationId = "getLeaderboardBySlug")] + [SwaggerOperation("Gets a leaderboard by its slug.", OperationId = "getLeaderboardBySlug")] [SwaggerResponse(200)] [SwaggerResponse(404)] public async Task> GetLeaderboardBySlug([FromQuery, SwaggerParameter(Required = true)] string slug) @@ -89,18 +89,19 @@ public async Task> CreateLeaderboard( [Authorize(Policy = UserTypes.ADMINISTRATOR)] [HttpPut("leaderboard/{id:long}/restore")] - [SwaggerResponse(201)] + [SwaggerOperation("Restores a deleted leaderboard.", OperationId = "restoreLeaderboard")] + [SwaggerResponse(200)] [SwaggerResponse(401)] [SwaggerResponse(403, "The requesting `User` is unauthorized to restore `Leaderboard`s.")] [SwaggerResponse(404, "The `Leaderboard` was not found, or it wasn't deleted in the first place.")] - public async Task> RestoreLeaderboard( + public async Task> RestoreLeaderboard( long id ) { RestoreLeaderboardResult r = await leaderboardService.RestoreLeaderboard(id); - return r.Match>( - _ => NoContent(), + return r.Match>( + board => Ok(LeaderboardViewModel.MapFrom(board)), notFound => NotFound(), neverDeleted => { diff --git a/LeaderboardBackend/Services/ILeaderboardService.cs b/LeaderboardBackend/Services/ILeaderboardService.cs index 7a02cc3c..46d603c9 100644 --- a/LeaderboardBackend/Services/ILeaderboardService.cs +++ b/LeaderboardBackend/Services/ILeaderboardService.cs @@ -18,4 +18,4 @@ public interface ILeaderboardService public partial class CreateLeaderboardResult : OneOfBase; [GenerateOneOf] -public partial class RestoreLeaderboardResult : OneOfBase; +public partial class RestoreLeaderboardResult : OneOfBase; diff --git a/LeaderboardBackend/Services/Impl/LeaderboardService.cs b/LeaderboardBackend/Services/Impl/LeaderboardService.cs index 5258a6ab..a8902c77 100644 --- a/LeaderboardBackend/Services/Impl/LeaderboardService.cs +++ b/LeaderboardBackend/Services/Impl/LeaderboardService.cs @@ -2,11 +2,12 @@ using LeaderboardBackend.Models.Requests; using LeaderboardBackend.Result; using Microsoft.EntityFrameworkCore; +using NodaTime; using Npgsql; namespace LeaderboardBackend.Services; -public class LeaderboardService(ApplicationContext applicationContext) : ILeaderboardService +public class LeaderboardService(ApplicationContext applicationContext, IClock clock) : ILeaderboardService { public async Task GetLeaderboard(long id) => await applicationContext.Leaderboards.FindAsync(id); @@ -69,10 +70,11 @@ public async Task RestoreLeaderboard(long id) applicationContext.Leaderboards.Update(lb); + lb.UpdatedAt = clock.GetCurrentInstant(); lb.DeletedAt = null; await applicationContext.SaveChangesAsync(); - return Task.CompletedTask; + return lb; } } diff --git a/LeaderboardBackend/openapi.json b/LeaderboardBackend/openapi.json index e47afc29..255897f5 100644 --- a/LeaderboardBackend/openapi.json +++ b/LeaderboardBackend/openapi.json @@ -515,7 +515,7 @@ "tags": [ "Leaderboards" ], - "summary": "Gets a Leaderboard by its slug.", + "summary": "Gets a leaderboard by its slug.", "operationId": "getLeaderboardBySlug", "parameters": [ { @@ -682,6 +682,8 @@ "tags": [ "Leaderboards" ], + "summary": "Restores a deleted leaderboard.", + "operationId": "restoreLeaderboard", "parameters": [ { "name": "id", @@ -707,12 +709,12 @@ "500": { "description": "Internal Server Error" }, - "201": { - "description": "Created", + "200": { + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestoreLeaderboardResult" + "$ref": "#/components/schemas/LeaderboardViewModel" } } } @@ -980,154 +982,6 @@ }, "components": { "schemas": { - "AggregateException": { - "type": "object", - "properties": { - "targetSite": { - "$ref": "#/components/schemas/MethodBase" - }, - "data": { - "type": "object", - "additionalProperties": { }, - "readOnly": true - }, - "innerException": { - "$ref": "#/components/schemas/Exception" - }, - "helpLink": { - "type": "string", - "nullable": true - }, - "source": { - "type": "string", - "nullable": true - }, - "hResult": { - "type": "integer", - "format": "int32" - }, - "stackTrace": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "innerExceptions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Exception" - }, - "readOnly": true - }, - "message": { - "type": "string", - "readOnly": true - } - }, - "additionalProperties": false - }, - "Assembly": { - "type": "object", - "properties": { - "definedTypes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TypeInfo" - }, - "readOnly": true - }, - "exportedTypes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "readOnly": true - }, - "codeBase": { - "type": "string", - "nullable": true, - "readOnly": true, - "deprecated": true - }, - "entryPoint": { - "$ref": "#/components/schemas/MethodInfo" - }, - "fullName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "imageRuntimeVersion": { - "type": "string", - "readOnly": true - }, - "isDynamic": { - "type": "boolean", - "readOnly": true - }, - "location": { - "type": "string", - "readOnly": true - }, - "reflectionOnly": { - "type": "boolean", - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "isFullyTrusted": { - "type": "boolean", - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "escapedCodeBase": { - "type": "string", - "readOnly": true, - "deprecated": true - }, - "manifestModule": { - "$ref": "#/components/schemas/Module" - }, - "modules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Module" - }, - "readOnly": true - }, - "globalAssemblyCache": { - "type": "boolean", - "readOnly": true, - "deprecated": true - }, - "hostContext": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "securityRuleSet": { - "$ref": "#/components/schemas/SecurityRuleSet" - } - }, - "additionalProperties": false - }, - "CallingConventions": { - "enum": [ - "Standard", - "VarArgs", - "Any", - "HasThis", - "ExplicitThis" - ], - "type": "string" - }, "CategoryViewModel": { "required": [ "createdAt", @@ -1203,136 +1057,6 @@ }, "additionalProperties": false }, - "ConstructorInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "attributes": { - "$ref": "#/components/schemas/MethodAttributes" - }, - "methodImplementationFlags": { - "$ref": "#/components/schemas/MethodImplAttributes" - }, - "callingConvention": { - "$ref": "#/components/schemas/CallingConventions" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isConstructor": { - "type": "boolean", - "readOnly": true - }, - "isFinal": { - "type": "boolean", - "readOnly": true - }, - "isHideBySig": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isVirtual": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodDefinition": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "methodHandle": { - "$ref": "#/components/schemas/RuntimeMethodHandle" - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - } - }, - "additionalProperties": false - }, "CreateCategoryRequest": { "required": [ "info", @@ -1434,2066 +1158,310 @@ "additionalProperties": false, "description": "This request object is sent when creating a `Run`." }, - "CustomAttributeData": { + "LeaderboardViewModel": { + "required": [ + "categories", + "createdAt", + "deletedAt", + "id", + "info", + "name", + "slug", + "updatedAt" + ], "type": "object", "properties": { - "attributeType": { - "$ref": "#/components/schemas/Type" + "id": { + "type": "integer", + "description": "The unique identifier of the `Leaderboard`.\n\r\nGenerated on creation.", + "format": "int64" }, - "constructor": { - "$ref": "#/components/schemas/ConstructorInfo" + "name": { + "type": "string", + "description": "The display name of the `Leaderboard` to create.", + "example": "Foo Bar" }, - "constructorArguments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeTypedArgument" - }, - "readOnly": true + "slug": { + "type": "string", + "description": "The URL-scoped unique identifier of the `Leaderboard`.\n\r\nMust be [2, 80] in length and consist only of alphanumeric characters and hyphens.", + "example": "foo-bar" + }, + "info": { + "type": "string", + "description": "The general information for the Leaderboard.", + "nullable": true, + "example": "Timer starts on selecting New Game and ends when the final boss is beaten." + }, + "createdAt": { + "type": "string", + "description": "The time the Leaderboard was created.", + "format": "date-time", + "example": "1984-01-01T00:00:00Z" }, - "namedArguments": { + "updatedAt": { + "type": "string", + "description": "The last time the Leaderboard was updated or null.", + "format": "date-time", + "nullable": true, + "example": "1984-01-01T00:00:00Z" + }, + "deletedAt": { + "type": "string", + "description": "The time at which the Leaderboard was deleted, or null if the Leaderboard has not been deleted.", + "format": "date-time", + "nullable": true, + "example": "1984-01-01T00:00:00Z" + }, + "categories": { "type": "array", "items": { - "$ref": "#/components/schemas/CustomAttributeNamedArgument" + "$ref": "#/components/schemas/CategoryViewModel" }, - "readOnly": true + "description": "A collection of `Category` entities for the `Leaderboard`." } }, - "additionalProperties": false + "additionalProperties": false, + "description": "Represents a collection of `Leaderboard` entities." }, - "CustomAttributeNamedArgument": { + "LoginRequest": { + "required": [ + "email", + "password" + ], "type": "object", "properties": { - "memberInfo": { - "$ref": "#/components/schemas/MemberInfo" - }, - "typedValue": { - "$ref": "#/components/schemas/CustomAttributeTypedArgument" - }, - "memberName": { + "email": { + "minLength": 1, "type": "string", - "readOnly": true + "description": "The `User`'s email address.", + "format": "email", + "example": "john.doe@example.com" }, - "isField": { - "type": "boolean", - "readOnly": true + "password": { + "minLength": 1, + "type": "string", + "description": "The `User`'s password. It:\r\n
  • supports Unicode;
  • must be [8, 80] in length;
  • must have at least:
    • one uppercase letter;
    • one lowercase letter; and
    • one number.
", + "example": "P4ssword" } }, - "additionalProperties": false + "additionalProperties": false, + "description": "This request object is sent when a `User` is attempting to log in." }, - "CustomAttributeTypedArgument": { + "LoginResponse": { + "required": [ + "token" + ], "type": "object", "properties": { - "argumentType": { - "$ref": "#/components/schemas/Type" - }, - "value": { - "nullable": true + "token": { + "minLength": 1, + "type": "string", + "description": "A JSON Web Token to authenticate and authorize queries with." } }, - "additionalProperties": false - }, - "EventAttributes": { - "enum": [ - "None", - "SpecialName", - "RTSpecialName" - ], - "type": "string" + "additionalProperties": false, + "description": "This response object is received upon a successful log-in request." }, - "EventInfo": { + "ProblemDetails": { "type": "object", "properties": { - "name": { + "type": { "type": "string", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true + "nullable": true }, - "isCollectible": { - "type": "boolean", - "readOnly": true + "title": { + "type": "string", + "nullable": true }, - "metadataToken": { + "status": { "type": "integer", "format": "int32", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "attributes": { - "$ref": "#/components/schemas/EventAttributes" - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "addMethod": { - "$ref": "#/components/schemas/MethodInfo" - }, - "removeMethod": { - "$ref": "#/components/schemas/MethodInfo" - }, - "raiseMethod": { - "$ref": "#/components/schemas/MethodInfo" + "nullable": true }, - "isMulticast": { - "type": "boolean", - "readOnly": true + "detail": { + "type": "string", + "nullable": true }, - "eventHandlerType": { - "$ref": "#/components/schemas/Type" + "instance": { + "type": "string", + "nullable": true } }, - "additionalProperties": false + "additionalProperties": { } }, - "Exception": { + "RecoverAccountRequest": { + "required": [ + "email", + "username" + ], "type": "object", "properties": { - "targetSite": { - "$ref": "#/components/schemas/MethodBase" - }, - "message": { + "username": { + "minLength": 1, "type": "string", - "readOnly": true + "description": "The user's name." }, - "data": { - "type": "object", - "additionalProperties": { }, - "readOnly": true - }, - "innerException": { - "$ref": "#/components/schemas/Exception" - }, - "helpLink": { - "type": "string", - "nullable": true - }, - "source": { - "type": "string", - "nullable": true - }, - "hResult": { - "type": "integer", - "format": "int32" - }, - "stackTrace": { + "email": { + "minLength": 1, "type": "string", - "nullable": true, - "readOnly": true + "description": "The user's email address.", + "format": "email" } }, "additionalProperties": false }, - "FieldAttributes": { - "enum": [ - "PrivateScope", - "Private", - "FamANDAssem", - "Assembly", - "Family", - "FamORAssem", - "Public", - "FieldAccessMask", - "Static", - "InitOnly", - "Literal", - "NotSerialized", - "HasFieldRVA", - "SpecialName", - "RTSpecialName", - "HasFieldMarshal", - "PinvokeImpl", - "HasDefault", - "ReservedMask" + "RegisterRequest": { + "required": [ + "email", + "password", + "username" ], - "type": "string" - }, - "FieldInfo": { "type": "object", "properties": { - "name": { + "username": { + "minLength": 1, "type": "string", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "attributes": { - "$ref": "#/components/schemas/FieldAttributes" - }, - "fieldType": { - "$ref": "#/components/schemas/Type" - }, - "isInitOnly": { - "type": "boolean", - "readOnly": true - }, - "isLiteral": { - "type": "boolean", - "readOnly": true - }, - "isNotSerialized": { - "type": "boolean", - "readOnly": true, - "deprecated": true - }, - "isPinvokeImpl": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true + "description": "The username of the `User`. It:\r\n
  • must be [2, 25] in length;
  • must be made up of letters sandwiching zero or one of:
    • hyphen;
    • underscore; or
    • apostrophe
\r\nUsernames are saved case-sensitively, but matched against case-insensitively.\r\nA `User` may not register with the name 'Cool' when another `User` with the name 'cool'\r\nexists.", + "example": "J'on-Doe" }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true + "email": { + "minLength": 1, + "type": "string", + "description": "The `User`'s email address.", + "example": "john.doe@example.com" }, - "fieldHandle": { - "$ref": "#/components/schemas/RuntimeFieldHandle" + "password": { + "minLength": 1, + "type": "string", + "description": "The `User`'s password. It:\r\n
  • supports Unicode;
  • must be [8, 80] in length;
  • must have at least:
    • one uppercase letter;
    • one lowercase letter; and
    • one number.
", + "example": "P4ssword" } }, - "additionalProperties": false - }, - "GenericParameterAttributes": { - "enum": [ - "None", - "Covariant", - "Contravariant", - "VarianceMask", - "ReferenceTypeConstraint", - "NotNullableValueTypeConstraint", - "DefaultConstructorConstraint", - "SpecialConstraintMask" - ], - "type": "string" - }, - "ICustomAttributeProvider": { - "type": "object", - "additionalProperties": false - }, - "IntPtr": { - "type": "object", - "additionalProperties": false + "additionalProperties": false, + "description": "This request object is sent when a `User` is attempting to register." }, - "LayoutKind": { + "RunType": { "enum": [ - "Sequential", - "Explicit", - "Auto" + "Time", + "Score" ], "type": "string" }, - "LeaderboardNeverDeleted": { - "type": "object", - "additionalProperties": false - }, - "LeaderboardNotFound": { - "type": "object", - "additionalProperties": false - }, - "LeaderboardViewModel": { + "RunViewModel": { "required": [ - "categories", + "$type", + "categoryId", "createdAt", "deletedAt", "id", "info", - "name", - "slug", - "updatedAt" + "updatedAt", + "userId" ], "type": "object", "properties": { - "id": { - "type": "integer", - "description": "The unique identifier of the `Leaderboard`.\n\r\nGenerated on creation.", - "format": "int64" - }, - "name": { - "type": "string", - "description": "The display name of the `Leaderboard` to create.", - "example": "Foo Bar" + "$type": { + "type": "string" }, - "slug": { + "id": { + "pattern": "^[a-zA-Z0-9-_]{22}$", "type": "string", - "description": "The URL-scoped unique identifier of the `Leaderboard`.\n\r\nMust be [2, 80] in length and consist only of alphanumeric characters and hyphens.", - "example": "foo-bar" + "description": "The unique identifier of the `Run`.\n\r\nGenerated on creation." }, "info": { "type": "string", - "description": "The general information for the Leaderboard.", - "nullable": true, - "example": "Timer starts on selecting New Game and ends when the final boss is beaten." + "description": "User-provided details about the run.", + "nullable": true }, "createdAt": { "type": "string", - "description": "The time the Leaderboard was created.", + "description": "The time the run was created.", "format": "date-time", "example": "1984-01-01T00:00:00Z" }, "updatedAt": { "type": "string", - "description": "The last time the Leaderboard was updated or null.", + "description": "The last time the run was updated or null.", "format": "date-time", "nullable": true, "example": "1984-01-01T00:00:00Z" }, "deletedAt": { "type": "string", - "description": "The time at which the Leaderboard was deleted, or null if the Leaderboard has not been deleted.", + "description": "The time at which the run was deleted, or null if the run has not been deleted.", "format": "date-time", "nullable": true, "example": "1984-01-01T00:00:00Z" }, - "categories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CategoryViewModel" - }, - "description": "A collection of `Category` entities for the `Leaderboard`." - } - }, - "additionalProperties": false, - "description": "Represents a collection of `Leaderboard` entities." - }, - "LoginRequest": { - "required": [ - "email", - "password" - ], - "type": "object", - "properties": { - "email": { - "minLength": 1, - "type": "string", - "description": "The `User`'s email address.", - "format": "email", - "example": "john.doe@example.com" + "categoryId": { + "type": "integer", + "description": "The ID of the `Category` for `Run`.", + "format": "int64" }, - "password": { - "minLength": 1, + "userId": { + "pattern": "^[a-zA-Z0-9-_]{22}$", "type": "string", - "description": "The `User`'s password. It:\r\n
  • supports Unicode;
  • must be [8, 80] in length;
  • must have at least:
    • one uppercase letter;
    • one lowercase letter; and
    • one number.
", - "example": "P4ssword" + "description": "The ID of the LeaderboardBackend.Models.Entities.User who submitted this run." } }, "additionalProperties": false, - "description": "This request object is sent when a `User` is attempting to log in." - }, - "LoginResponse": { - "required": [ - "token" - ], - "type": "object", - "properties": { - "token": { - "minLength": 1, - "type": "string", - "description": "A JSON Web Token to authenticate and authorize queries with." + "discriminator": { + "propertyName": "$type", + "mapping": { + "Time": "#/components/schemas/TimedRunViewModel", + "Score": "#/components/schemas/ScoredRunViewModel" } - }, - "additionalProperties": false, - "description": "This response object is received upon a successful log-in request." + } }, - "MemberInfo": { - "type": "object", - "properties": { - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "name": { - "type": "string", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" + "ScoredRunViewModel": { + "allOf": [ + { + "$ref": "#/components/schemas/RunViewModel" }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" + { + "required": [ + "score" + ], + "type": "object", + "properties": { + "score": { + "type": "integer", + "description": "The score achieved during the run.", + "format": "int64" + } }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true + "additionalProperties": false } - }, - "additionalProperties": false - }, - "MemberTypes": { - "enum": [ - "Constructor", - "Event", - "Field", - "Method", - "Property", - "TypeInfo", - "Custom", - "NestedType", - "All" - ], - "type": "string" + ] }, - "MethodAttributes": { + "SortDirection": { "enum": [ - "PrivateScope", - "Private", - "FamANDAssem", - "Assembly", - "Family", - "FamORAssem", - "Public", - "MemberAccessMask", - "UnmanagedExport", - "Static", - "Final", - "Virtual", - "HideBySig", - "NewSlot", - "CheckAccessOnOverride", - "Abstract", - "SpecialName", - "RTSpecialName", - "PinvokeImpl", - "HasSecurity", - "RequireSecObject", - "ReservedMask" + "Ascending", + "Descending" ], "type": "string" }, - "MethodBase": { - "type": "object", - "properties": { - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "name": { - "type": "string", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" + "TimedRunViewModel": { + "allOf": [ + { + "$ref": "#/components/schemas/RunViewModel" }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "attributes": { - "$ref": "#/components/schemas/MethodAttributes" - }, - "methodImplementationFlags": { - "$ref": "#/components/schemas/MethodImplAttributes" - }, - "callingConvention": { - "$ref": "#/components/schemas/CallingConventions" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isConstructor": { - "type": "boolean", - "readOnly": true - }, - "isFinal": { - "type": "boolean", - "readOnly": true - }, - "isHideBySig": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isVirtual": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodDefinition": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "methodHandle": { - "$ref": "#/components/schemas/RuntimeMethodHandle" - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - } - }, - "additionalProperties": false - }, - "MethodImplAttributes": { - "enum": [ - "IL", - "Native", - "OPTIL", - "CodeTypeMask", - "ManagedMask", - "NoInlining", - "ForwardRef", - "Synchronized", - "NoOptimization", - "PreserveSig", - "AggressiveInlining", - "AggressiveOptimization", - "InternalCall", - "MaxMethodImplVal" - ], - "type": "string" - }, - "MethodInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "attributes": { - "$ref": "#/components/schemas/MethodAttributes" - }, - "methodImplementationFlags": { - "$ref": "#/components/schemas/MethodImplAttributes" - }, - "callingConvention": { - "$ref": "#/components/schemas/CallingConventions" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isConstructor": { - "type": "boolean", - "readOnly": true - }, - "isFinal": { - "type": "boolean", - "readOnly": true - }, - "isHideBySig": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isVirtual": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodDefinition": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "methodHandle": { - "$ref": "#/components/schemas/RuntimeMethodHandle" - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "returnParameter": { - "$ref": "#/components/schemas/ParameterInfo" - }, - "returnType": { - "$ref": "#/components/schemas/Type" - }, - "returnTypeCustomAttributes": { - "$ref": "#/components/schemas/ICustomAttributeProvider" - } - }, - "additionalProperties": false - }, - "Module": { - "type": "object", - "properties": { - "assembly": { - "$ref": "#/components/schemas/Assembly" - }, - "fullyQualifiedName": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "readOnly": true - }, - "mdStreamVersion": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "moduleVersionId": { - "pattern": "^[a-zA-Z0-9-_]{22}$", - "type": "string", - "readOnly": true - }, - "scopeName": { - "type": "string", - "readOnly": true - }, - "moduleHandle": { - "$ref": "#/components/schemas/ModuleHandle" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - } - }, - "additionalProperties": false - }, - "ModuleHandle": { - "type": "object", - "properties": { - "mdStreamVersion": { - "type": "integer", - "format": "int32", - "readOnly": true - } - }, - "additionalProperties": false - }, - "ParameterAttributes": { - "enum": [ - "None", - "In", - "Out", - "Lcid", - "Retval", - "Optional", - "HasDefault", - "HasFieldMarshal", - "Reserved3", - "Reserved4", - "ReservedMask" - ], - "type": "string" - }, - "ParameterInfo": { - "type": "object", - "properties": { - "attributes": { - "$ref": "#/components/schemas/ParameterAttributes" - }, - "member": { - "$ref": "#/components/schemas/MemberInfo" - }, - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "parameterType": { - "$ref": "#/components/schemas/Type" - }, - "position": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "isIn": { - "type": "boolean", - "readOnly": true - }, - "isLcid": { - "type": "boolean", - "readOnly": true - }, - "isOptional": { - "type": "boolean", - "readOnly": true - }, - "isOut": { - "type": "boolean", - "readOnly": true - }, - "isRetval": { - "type": "boolean", - "readOnly": true - }, - "defaultValue": { - "nullable": true, - "readOnly": true - }, - "rawDefaultValue": { - "nullable": true, - "readOnly": true - }, - "hasDefaultValue": { - "type": "boolean", - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - } - }, - "additionalProperties": false - }, - "ProblemDetails": { - "type": "object", - "properties": { - "type": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "status": { - "type": "integer", - "format": "int32", - "nullable": true - }, - "detail": { - "type": "string", - "nullable": true - }, - "instance": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": { } - }, - "PropertyAttributes": { - "enum": [ - "None", - "SpecialName", - "RTSpecialName", - "HasDefault", - "Reserved2", - "Reserved3", - "Reserved4", - "ReservedMask" - ], - "type": "string" - }, - "PropertyInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "propertyType": { - "$ref": "#/components/schemas/Type" - }, - "attributes": { - "$ref": "#/components/schemas/PropertyAttributes" - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "canRead": { - "type": "boolean", - "readOnly": true - }, - "canWrite": { - "type": "boolean", - "readOnly": true - }, - "getMethod": { - "$ref": "#/components/schemas/MethodInfo" - }, - "setMethod": { - "$ref": "#/components/schemas/MethodInfo" - } - }, - "additionalProperties": false - }, - "RecoverAccountRequest": { - "required": [ - "email", - "username" - ], - "type": "object", - "properties": { - "username": { - "minLength": 1, - "type": "string", - "description": "The user's name." - }, - "email": { - "minLength": 1, - "type": "string", - "description": "The user's email address.", - "format": "email" - } - }, - "additionalProperties": false - }, - "RegisterRequest": { - "required": [ - "email", - "password", - "username" - ], - "type": "object", - "properties": { - "username": { - "minLength": 1, - "type": "string", - "description": "The username of the `User`. It:\r\n
  • must be [2, 25] in length;
  • must be made up of letters sandwiching zero or one of:
    • hyphen;
    • underscore; or
    • apostrophe
\r\nUsernames are saved case-sensitively, but matched against case-insensitively.\r\nA `User` may not register with the name 'Cool' when another `User` with the name 'cool'\r\nexists.", - "example": "J'on-Doe" - }, - "email": { - "minLength": 1, - "type": "string", - "description": "The `User`'s email address.", - "example": "john.doe@example.com" - }, - "password": { - "minLength": 1, - "type": "string", - "description": "The `User`'s password. It:\r\n
  • supports Unicode;
  • must be [8, 80] in length;
  • must have at least:
    • one uppercase letter;
    • one lowercase letter; and
    • one number.
", - "example": "P4ssword" - } - }, - "additionalProperties": false, - "description": "This request object is sent when a `User` is attempting to register." - }, - "RestoreLeaderboardResult": { - "type": "object", - "properties": { - "value": { - "nullable": true, - "readOnly": true - }, - "index": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "isT0": { - "type": "boolean", - "readOnly": true - }, - "isT1": { - "type": "boolean", - "readOnly": true - }, - "isT2": { - "type": "boolean", - "readOnly": true - }, - "asT0": { - "$ref": "#/components/schemas/Task" - }, - "asT1": { - "$ref": "#/components/schemas/LeaderboardNotFound" - }, - "asT2": { - "$ref": "#/components/schemas/LeaderboardNeverDeleted" - } - }, - "additionalProperties": false - }, - "RunType": { - "enum": [ - "Time", - "Score" - ], - "type": "string" - }, - "RunViewModel": { - "required": [ - "$type", - "categoryId", - "createdAt", - "deletedAt", - "id", - "info", - "updatedAt", - "userId" - ], - "type": "object", - "properties": { - "$type": { - "type": "string" - }, - "id": { - "pattern": "^[a-zA-Z0-9-_]{22}$", - "type": "string", - "description": "The unique identifier of the `Run`.\n\r\nGenerated on creation." - }, - "info": { - "type": "string", - "description": "User-provided details about the run.", - "nullable": true - }, - "createdAt": { - "type": "string", - "description": "The time the run was created.", - "format": "date-time", - "example": "1984-01-01T00:00:00Z" - }, - "updatedAt": { - "type": "string", - "description": "The last time the run was updated or null.", - "format": "date-time", - "nullable": true, - "example": "1984-01-01T00:00:00Z" - }, - "deletedAt": { - "type": "string", - "description": "The time at which the run was deleted, or null if the run has not been deleted.", - "format": "date-time", - "nullable": true, - "example": "1984-01-01T00:00:00Z" - }, - "categoryId": { - "type": "integer", - "description": "The ID of the `Category` for `Run`.", - "format": "int64" - }, - "userId": { - "pattern": "^[a-zA-Z0-9-_]{22}$", - "type": "string", - "description": "The ID of the LeaderboardBackend.Models.Entities.User who submitted this run." - } - }, - "additionalProperties": false, - "discriminator": { - "propertyName": "$type", - "mapping": { - "Time": "#/components/schemas/TimedRunViewModel", - "Score": "#/components/schemas/ScoredRunViewModel" - } - } - }, - "RuntimeFieldHandle": { - "type": "object", - "properties": { - "value": { - "$ref": "#/components/schemas/IntPtr" - } - }, - "additionalProperties": false - }, - "RuntimeMethodHandle": { - "type": "object", - "properties": { - "value": { - "$ref": "#/components/schemas/IntPtr" - } - }, - "additionalProperties": false - }, - "RuntimeTypeHandle": { - "type": "object", - "properties": { - "value": { - "$ref": "#/components/schemas/IntPtr" - } - }, - "additionalProperties": false - }, - "ScoredRunViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/RunViewModel" - }, - { - "required": [ - "score" - ], - "type": "object", - "properties": { - "score": { - "type": "integer", - "description": "The score achieved during the run.", - "format": "int64" - } - }, - "additionalProperties": false - } - ] - }, - "SecurityRuleSet": { - "enum": [ - "None", - "Level1", - "Level2" - ], - "type": "string" - }, - "SortDirection": { - "enum": [ - "Ascending", - "Descending" - ], - "type": "string" - }, - "StructLayoutAttribute": { - "type": "object", - "properties": { - "typeId": { - "readOnly": true - }, - "value": { - "$ref": "#/components/schemas/LayoutKind" - } - }, - "additionalProperties": false - }, - "Task": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "exception": { - "$ref": "#/components/schemas/AggregateException" - }, - "status": { - "$ref": "#/components/schemas/TaskStatus" - }, - "isCanceled": { - "type": "boolean", - "readOnly": true - }, - "isCompleted": { - "type": "boolean", - "readOnly": true - }, - "isCompletedSuccessfully": { - "type": "boolean", - "readOnly": true - }, - "creationOptions": { - "$ref": "#/components/schemas/TaskCreationOptions" - }, - "asyncState": { - "nullable": true, - "readOnly": true - }, - "isFaulted": { - "type": "boolean", - "readOnly": true - } - }, - "additionalProperties": false - }, - "TaskCreationOptions": { - "enum": [ - "None", - "PreferFairness", - "LongRunning", - "AttachedToParent", - "DenyChildAttach", - "HideScheduler", - "RunContinuationsAsynchronously" - ], - "type": "string" - }, - "TaskStatus": { - "enum": [ - "Created", - "WaitingForActivation", - "WaitingToRun", - "Running", - "WaitingForChildrenToComplete", - "RanToCompletion", - "Canceled", - "Faulted" - ], - "type": "string" - }, - "TimedRunViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/RunViewModel" - }, - { - "required": [ - "time" - ], - "type": "object", - "properties": { - "time": { - "type": "string", - "description": "The duration of the run.", - "example": "25:01:01.001" - } + { + "required": [ + "time" + ], + "type": "object", + "properties": { + "time": { + "type": "string", + "description": "The duration of the run.", + "example": "25:01:01.001" + } }, "additionalProperties": false } ] }, - "Type": { - "type": "object", - "properties": { - "name": { - "type": "string", - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "isInterface": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "namespace": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assemblyQualifiedName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "fullName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assembly": { - "$ref": "#/components/schemas/Assembly" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "isNested": { - "type": "boolean", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "declaringMethod": { - "$ref": "#/components/schemas/MethodBase" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "underlyingSystemType": { - "$ref": "#/components/schemas/Type" - }, - "isTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isArray": { - "type": "boolean", - "readOnly": true - }, - "isByRef": { - "type": "boolean", - "readOnly": true - }, - "isPointer": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isSZArray": { - "type": "boolean", - "readOnly": true - }, - "isVariableBoundArray": { - "type": "boolean", - "readOnly": true - }, - "isByRefLike": { - "type": "boolean", - "readOnly": true - }, - "isFunctionPointer": { - "type": "boolean", - "readOnly": true - }, - "isUnmanagedFunctionPointer": { - "type": "boolean", - "readOnly": true - }, - "hasElementType": { - "type": "boolean", - "readOnly": true - }, - "genericTypeArguments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "readOnly": true - }, - "genericParameterPosition": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "genericParameterAttributes": { - "$ref": "#/components/schemas/GenericParameterAttributes" - }, - "attributes": { - "$ref": "#/components/schemas/TypeAttributes" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isImport": { - "type": "boolean", - "readOnly": true - }, - "isSealed": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isClass": { - "type": "boolean", - "readOnly": true - }, - "isNestedAssembly": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamANDAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamily": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamORAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedPrivate": { - "type": "boolean", - "readOnly": true - }, - "isNestedPublic": { - "type": "boolean", - "readOnly": true - }, - "isNotPublic": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isAutoLayout": { - "type": "boolean", - "readOnly": true - }, - "isExplicitLayout": { - "type": "boolean", - "readOnly": true - }, - "isLayoutSequential": { - "type": "boolean", - "readOnly": true - }, - "isAnsiClass": { - "type": "boolean", - "readOnly": true - }, - "isAutoClass": { - "type": "boolean", - "readOnly": true - }, - "isUnicodeClass": { - "type": "boolean", - "readOnly": true - }, - "isCOMObject": { - "type": "boolean", - "readOnly": true - }, - "isContextful": { - "type": "boolean", - "readOnly": true - }, - "isEnum": { - "type": "boolean", - "readOnly": true - }, - "isMarshalByRef": { - "type": "boolean", - "readOnly": true - }, - "isPrimitive": { - "type": "boolean", - "readOnly": true - }, - "isValueType": { - "type": "boolean", - "readOnly": true - }, - "isSignatureType": { - "type": "boolean", - "readOnly": true - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "structLayoutAttribute": { - "$ref": "#/components/schemas/StructLayoutAttribute" - }, - "typeInitializer": { - "$ref": "#/components/schemas/ConstructorInfo" - }, - "typeHandle": { - "$ref": "#/components/schemas/RuntimeTypeHandle" - }, - "guid": { - "pattern": "^[a-zA-Z0-9-_]{22}$", - "type": "string", - "readOnly": true - }, - "baseType": { - "$ref": "#/components/schemas/Type" - }, - "isSerializable": { - "type": "boolean", - "readOnly": true, - "deprecated": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "isVisible": { - "type": "boolean", - "readOnly": true - } - }, - "additionalProperties": false - }, - "TypeAttributes": { - "enum": [ - "NotPublic", - "Public", - "NestedPublic", - "NestedPrivate", - "NestedFamily", - "NestedAssembly", - "NestedFamANDAssem", - "VisibilityMask", - "SequentialLayout", - "ExplicitLayout", - "LayoutMask", - "Interface", - "Abstract", - "Sealed", - "SpecialName", - "RTSpecialName", - "Import", - "Serializable", - "WindowsRuntime", - "UnicodeClass", - "AutoClass", - "StringFormatMask", - "HasSecurity", - "ReservedMask", - "BeforeFieldInit", - "CustomFormatMask" - ], - "type": "string" - }, - "TypeInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "isInterface": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "namespace": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assemblyQualifiedName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "fullName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assembly": { - "$ref": "#/components/schemas/Assembly" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "isNested": { - "type": "boolean", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "declaringMethod": { - "$ref": "#/components/schemas/MethodBase" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "underlyingSystemType": { - "$ref": "#/components/schemas/Type" - }, - "isTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isArray": { - "type": "boolean", - "readOnly": true - }, - "isByRef": { - "type": "boolean", - "readOnly": true - }, - "isPointer": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isSZArray": { - "type": "boolean", - "readOnly": true - }, - "isVariableBoundArray": { - "type": "boolean", - "readOnly": true - }, - "isByRefLike": { - "type": "boolean", - "readOnly": true - }, - "isFunctionPointer": { - "type": "boolean", - "readOnly": true - }, - "isUnmanagedFunctionPointer": { - "type": "boolean", - "readOnly": true - }, - "hasElementType": { - "type": "boolean", - "readOnly": true - }, - "genericTypeArguments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "readOnly": true - }, - "genericParameterPosition": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "genericParameterAttributes": { - "$ref": "#/components/schemas/GenericParameterAttributes" - }, - "attributes": { - "$ref": "#/components/schemas/TypeAttributes" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isImport": { - "type": "boolean", - "readOnly": true - }, - "isSealed": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isClass": { - "type": "boolean", - "readOnly": true - }, - "isNestedAssembly": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamANDAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamily": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamORAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedPrivate": { - "type": "boolean", - "readOnly": true - }, - "isNestedPublic": { - "type": "boolean", - "readOnly": true - }, - "isNotPublic": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isAutoLayout": { - "type": "boolean", - "readOnly": true - }, - "isExplicitLayout": { - "type": "boolean", - "readOnly": true - }, - "isLayoutSequential": { - "type": "boolean", - "readOnly": true - }, - "isAnsiClass": { - "type": "boolean", - "readOnly": true - }, - "isAutoClass": { - "type": "boolean", - "readOnly": true - }, - "isUnicodeClass": { - "type": "boolean", - "readOnly": true - }, - "isCOMObject": { - "type": "boolean", - "readOnly": true - }, - "isContextful": { - "type": "boolean", - "readOnly": true - }, - "isEnum": { - "type": "boolean", - "readOnly": true - }, - "isMarshalByRef": { - "type": "boolean", - "readOnly": true - }, - "isPrimitive": { - "type": "boolean", - "readOnly": true - }, - "isValueType": { - "type": "boolean", - "readOnly": true - }, - "isSignatureType": { - "type": "boolean", - "readOnly": true - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "structLayoutAttribute": { - "$ref": "#/components/schemas/StructLayoutAttribute" - }, - "typeInitializer": { - "$ref": "#/components/schemas/ConstructorInfo" - }, - "typeHandle": { - "$ref": "#/components/schemas/RuntimeTypeHandle" - }, - "guid": { - "pattern": "^[a-zA-Z0-9-_]{22}$", - "type": "string", - "readOnly": true - }, - "baseType": { - "$ref": "#/components/schemas/Type" - }, - "isSerializable": { - "type": "boolean", - "readOnly": true, - "deprecated": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "isVisible": { - "type": "boolean", - "readOnly": true - }, - "genericTypeParameters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "readOnly": true - }, - "declaredConstructors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConstructorInfo" - }, - "readOnly": true - }, - "declaredEvents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EventInfo" - }, - "readOnly": true - }, - "declaredFields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FieldInfo" - }, - "readOnly": true - }, - "declaredMembers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MemberInfo" - }, - "readOnly": true - }, - "declaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodInfo" - }, - "readOnly": true - }, - "declaredNestedTypes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TypeInfo" - }, - "readOnly": true - }, - "declaredProperties": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PropertyInfo" - }, - "readOnly": true - }, - "implementedInterfaces": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "readOnly": true - } - }, - "additionalProperties": false - }, "UserRole": { "enum": [ "Registered",