From 07e243964f8268e60a3c20d034ad27ed69856786 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 8 Oct 2026 21:18:58 +0330 Subject: [PATCH] last ... --- Extensions/XModelExtensions.cs | 14 ++++++++++++++ Models/XCreateApiKeyRequest.cs | 16 ++++++++++++++++ Models/XRotateApiKeyRequest.cs | 12 ++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 Models/XCreateApiKeyRequest.cs create mode 100644 Models/XRotateApiKeyRequest.cs diff --git a/Extensions/XModelExtensions.cs b/Extensions/XModelExtensions.cs index 5d55da1..b1504ee 100644 --- a/Extensions/XModelExtensions.cs +++ b/Extensions/XModelExtensions.cs @@ -157,6 +157,20 @@ namespace xIdentityModels.Extensions return result; } + /// + /// Validate ... + /// + /// + /// + public static bool IsValid(this XCreateApiKeyRequest source) + { + // + var result = !source.IsNull(); + + // + return result; + } + /// /// Validate Item for Add or Update ... /// diff --git a/Models/XCreateApiKeyRequest.cs b/Models/XCreateApiKeyRequest.cs new file mode 100644 index 0000000..b8e081d --- /dev/null +++ b/Models/XCreateApiKeyRequest.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace xIdentityModels.Models +{ + /// + /// Create Specified Api Key ... + /// + public class XCreateApiKeyRequest + { + public int? RateLimit {get; set;} = null; + public TimeSpan? Expiration {get; set;} = null; + public IEnumerable Scopes {get; set;} = null; + public IEnumerable AllowedIPs {get; set;} = null; + } +} \ No newline at end of file diff --git a/Models/XRotateApiKeyRequest.cs b/Models/XRotateApiKeyRequest.cs new file mode 100644 index 0000000..e01b8dc --- /dev/null +++ b/Models/XRotateApiKeyRequest.cs @@ -0,0 +1,12 @@ +using System; + +namespace xIdentityModels.Models +{ + /// + /// Rotate Specified Api Key ... + /// + public class XRotateApiKeyRequest + { + public TimeSpan? NewExpiration { get; set; } = null; + } +} \ No newline at end of file