From c7f651ddf9a7aff62cdbb28efc1eb7e0be6abe1c Mon Sep 17 00:00:00 2001 From: Jared McCannon Date: Thu, 21 Dec 2023 09:01:52 -0600 Subject: [PATCH] adding-events-endpoint (#99) * Split ApplicationEvent to separate file. Changed Events to readonlylist --- src/Passwordless/Models/ApplicationEvent.cs | 40 +++++++++++++++++++ .../Models/GetEventLogResponse.cs | 40 +------------------ 2 files changed, 41 insertions(+), 39 deletions(-) create mode 100644 src/Passwordless/Models/ApplicationEvent.cs diff --git a/src/Passwordless/Models/ApplicationEvent.cs b/src/Passwordless/Models/ApplicationEvent.cs new file mode 100644 index 0000000..8feaca8 --- /dev/null +++ b/src/Passwordless/Models/ApplicationEvent.cs @@ -0,0 +1,40 @@ +using System; + +namespace Passwordless.Models; + +/// +/// An event that occured using Passwordless library. +/// +public class ApplicationEvent +{ + public Guid Id { get; set; } + /// + /// When the record was performed. This will be in UTC. + /// + public DateTime PerformedAt { get; set; } + + /// + /// The type of event + /// + public string EventType { get; set; } = string.Empty; + + /// + /// Description of the event + /// + public string Message { get; set; } = string.Empty; + + /// + /// Severity of the event + /// + public string Severity { get; set; } = string.Empty; + + /// + /// The target of the event. Can be in reference to a user or the application. + /// + public string Subject { get; set; } = string.Empty; + + /// + /// Last 4 characters of the api key (public/secret) used to perform the event. + /// + public string ApiKeyId { get; set; } = string.Empty; +} \ No newline at end of file diff --git a/src/Passwordless/Models/GetEventLogResponse.cs b/src/Passwordless/Models/GetEventLogResponse.cs index 716e7d2..e1a0755 100644 --- a/src/Passwordless/Models/GetEventLogResponse.cs +++ b/src/Passwordless/Models/GetEventLogResponse.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; namespace Passwordless.Models; @@ -15,46 +14,9 @@ public class GetEventLogResponse /// /// List of events for the application based on the request pagination parameters. This will always be sorted by PerformedAt in descending order. /// - public IEnumerable Events { get; set; } = new List(); + public IReadOnlyList Events { get; set; } = new List(); /// /// Total number of events for the application. /// public int TotalEventCount { get; set; } -} - -/// -/// An event that occured using Passwordless library. -/// -public class ApplicationEvent -{ - public Guid Id { get; set; } - /// - /// When the record was performed. This will be in UTC. - /// - public DateTime PerformedAt { get; set; } - - /// - /// The type of event - /// - public string EventType { get; set; } = string.Empty; - - /// - /// Description of the event - /// - public string Message { get; set; } = string.Empty; - - /// - /// Severity of the event - /// - public string Severity { get; set; } = string.Empty; - - /// - /// The target of the event. Can be in reference to a user or the application. - /// - public string Subject { get; set; } = string.Empty; - - /// - /// Last 4 characters of the api key (public/secret) used to perform the event. - /// - public string ApiKeyId { get; set; } = string.Empty; } \ No newline at end of file