diff --git a/Constraints.cs b/Constraints.cs
index 21d36eb..5e1d971 100644
--- a/Constraints.cs
+++ b/Constraints.cs
@@ -1,8 +1,11 @@
namespace E5Renewer
{
+ /// Constraints container.
public static class Constraints
{
+ /// The time format in log.
public const string loggingTimeFormat = "yyyy-MM-dd HH:mm:ss ";
+ /// The log level.
public static LogLevel loggingLevel = LogLevel.Information;
}
}
diff --git a/E5Renewer.Config/Config.cs b/E5Renewer.Config/Config.cs
index d482237..bda396b 100644
--- a/E5Renewer.Config/Config.cs
+++ b/E5Renewer.Config/Config.cs
@@ -1,24 +1,48 @@
namespace E5Renewer.Config
{
+ /// Runtime used Config.
public class RuntimeConfig : ICheckable
{
+ /// Enable debug mode.
public bool debug { get; set; }
+ /// Authentication token.
public string authToken { get; set; }
+ /// HTTP json api listen address.
public string listenAddr { get; set; }
+ /// HTTP json api listen port.
public uint listenPort { get; set; }
+ ///
+ /// Use Unix Domain Socket instead TCP for HTTP json api.
+ ///
+ /// Only available when HTTP listen failed and your plaform supports Unix Domain Socket.
+ ///
+ ///
public string listenSocket { get; set; }
+ ///
+ /// The permission of Unix Domain Socket.
+ ///
+ /// In octal number like 777 or 644.
+ ///
+ ///
public uint listenSocketPermission { get; set; }
+ /// The list of users to access msgraph apis.
+ ///
public List users { get; set; }
+ /// If this object is valid.
+ ///
public bool check
{
get
{
- return this.authToken != "" &&
+ return !string.IsNullOrEmpty(this.authToken) &&
users.All(
(GraphUser user) => user.check
);
}
}
+ ///
+ /// Default constructor of RuntimeConfig
+ ///
public RuntimeConfig()
{
this.debug = false;
diff --git a/E5Renewer.Config/ConfigParser.cs b/E5Renewer.Config/ConfigParser.cs
index ec32a36..182cdd0 100644
--- a/E5Renewer.Config/ConfigParser.cs
+++ b/E5Renewer.Config/ConfigParser.cs
@@ -3,10 +3,14 @@
namespace E5Renewer.Config
{
+ /// Utils for parsing config.
public static class ConfigParser
{
private static readonly List parsers = ModulesLoader.GetRegisteredModules();
private static RuntimeConfig? parsedConfig;
+ /// Parse config.
+ /// The config path in FileInfo object.
+ /// The result of parsed config.
public static async Task ParseConfig(FileInfo fileInfo)
{
if (ConfigParser.parsedConfig != null)
diff --git a/E5Renewer.Config/GraphUser.cs b/E5Renewer.Config/GraphUser.cs
index b1de045..9cf0481 100644
--- a/E5Renewer.Config/GraphUser.cs
+++ b/E5Renewer.Config/GraphUser.cs
@@ -1,14 +1,20 @@
namespace E5Renewer.Config
{
+ /// The class stores info to access msgraph apis.
public class GraphUser : ICheckable
{
private const uint calmDownMinMilliSeconds = 300000;
private const uint calmDownMaxMilliSeconds = 500000;
private readonly TimeOnly[] privateTimes = new TimeOnly[2];
+ /// The name of user.
public string name { get; set; }
+ /// The tenant id of user.
public string tenantId { get; set; }
+ /// The client id of user.
public string clientId { get; set; }
+ /// The secret of user.
public string secret { get; set; }
+ /// When to start the user.
public TimeOnly fromTime
{
get
@@ -23,6 +29,7 @@ public TimeOnly fromTime
}
}
}
+ /// When to stop the user.
public TimeOnly toTime
{
get
@@ -37,7 +44,9 @@ public TimeOnly toTime
}
}
}
+ /// Which days are allowed to start the user.
public List days { get; set; }
+ /// If the user is allowed to start.
public bool enabled
{
get
@@ -59,6 +68,8 @@ public bool enabled
now.CompareTo(toTime) < 0;
}
}
+ /// Check if GraphUser is valid.
+ ///
public bool check
{
get
@@ -69,6 +80,8 @@ public bool check
this.secret != "";
}
}
+ /// How many milliseconds until next call.
+ /// If is allowed to start, will give the user a rest.
public int milliSecondsUntilNextStarting
{
get
@@ -103,6 +116,9 @@ public int milliSecondsUntilNextStarting
}
}
+ ///
+ /// Default constructor of GraphUser
+ ///
public GraphUser()
{
this.name = "";
diff --git a/E5Renewer.Config/ICheckable.cs b/E5Renewer.Config/ICheckable.cs
index 9d99c19..3294e71 100644
--- a/E5Renewer.Config/ICheckable.cs
+++ b/E5Renewer.Config/ICheckable.cs
@@ -1,7 +1,12 @@
namespace E5Renewer.Config
{
+ /// The interface of object has a bool property named check.
public interface ICheckable
{
+ ///
+ /// The check property.
+ /// It shows that if this object is correct.
+ ///
public bool check { get; }
}
}
diff --git a/E5Renewer.Config/IConfigParser.cs b/E5Renewer.Config/IConfigParser.cs
index 0c92f18..10c9f80 100644
--- a/E5Renewer.Config/IConfigParser.cs
+++ b/E5Renewer.Config/IConfigParser.cs
@@ -2,9 +2,17 @@
namespace E5Renewer.Config
{
+ /// The api interface of ConfigParser.
+ ///
public interface IConfigParser : IModule
{
+ /// If given is supported by the parser.
+ /// The path of config file.
+ /// If the path given is supported.
public bool IsSupported(string path);
+ /// Parse and returns parsed result.
+ /// The path of config file.
+ /// The parsed result.
public Task ParseConfig(string path);
}
}
diff --git a/E5Renewer.Config/JsonParser.cs b/E5Renewer.Config/JsonParser.cs
index ff0d1ea..7a7f5f1 100644
--- a/E5Renewer.Config/JsonParser.cs
+++ b/E5Renewer.Config/JsonParser.cs
@@ -2,14 +2,20 @@
using E5Renewer.Config;
namespace E5Renewer.Modules.ConfigParsers
{
+ /// Json config parser.
[Module]
public class JsonParser : IConfigParser
{
+ ///
public string name { get => "JsonParser"; }
+ ///
public string author { get => "E5Renewer"; }
+ ///
public SemVer apiVersion { get => new(0, 1, 0); }
+ ///
public bool IsSupported(string path) => path.EndsWith(".json");
+ ///
public async Task ParseConfig(string path)
{
RuntimeConfig? runtimeConfig;
diff --git a/E5Renewer.Config/TomlParser.cs b/E5Renewer.Config/TomlParser.cs
index 50e1faa..a561a44 100644
--- a/E5Renewer.Config/TomlParser.cs
+++ b/E5Renewer.Config/TomlParser.cs
@@ -4,13 +4,19 @@
namespace E5Renewer.Modules.ConfigParsers
{
+ /// Toml config parser.
[Module]
public class TomlParser : IConfigParser
{
+ ///
public string name { get => "TomlParser"; }
+ ///
public string author { get => "E5Renewer"; }
+ ///
public SemVer apiVersion { get => new(0, 1, 0); }
+ ///
public bool IsSupported(string path) => path.EndsWith(".toml");
+ ///
public async Task ParseConfig(string path)
{
RuntimeConfig runtimeConfig;
diff --git a/E5Renewer.Config/YamlParser.cs b/E5Renewer.Config/YamlParser.cs
index b4dc450..e145c02 100644
--- a/E5Renewer.Config/YamlParser.cs
+++ b/E5Renewer.Config/YamlParser.cs
@@ -4,13 +4,19 @@
namespace E5Renewer.Modules.ConfigParsers
{
+ /// Yaml config parser.
[Module]
public class YamlParser : IConfigParser
{
+ ///
public string name { get => "YamlParser"; }
+ ///
public string author { get => "E5Renewer"; }
+ ///
public SemVer apiVersion { get => new(0, 1, 0); }
+ ///
public bool IsSupported(string path) => path.EndsWith(".yaml") || path.EndsWith(".yml");
+ ///
public async Task ParseConfig(string path)
{
RuntimeConfig runtimeConfig;
diff --git a/E5Renewer.Exceptions/InvalidConfigException.cs b/E5Renewer.Exceptions/InvalidConfigException.cs
index fc69646..335ba8a 100644
--- a/E5Renewer.Exceptions/InvalidConfigException.cs
+++ b/E5Renewer.Exceptions/InvalidConfigException.cs
@@ -1,7 +1,9 @@
namespace E5Renewer.Exceptions
{
+ /// The Exception that is thown when config is invalid.
public class InvalidConfigException : ArgumentException
{
+ /// Initialize InvalidConfigException by using message.
public InvalidConfigException(string msg) : base(msg) { }
}
}
diff --git a/E5Renewer.Exceptions/NoParserFoundException.cs b/E5Renewer.Exceptions/NoParserFoundException.cs
index 43ce690..e49be15 100644
--- a/E5Renewer.Exceptions/NoParserFoundException.cs
+++ b/E5Renewer.Exceptions/NoParserFoundException.cs
@@ -1,7 +1,9 @@
namespace E5Renewer.Exceptions
{
+ /// The Exception is thown when no ConfigParser is found for config path given.
public class NoParserFoundException : Exception
{
+ /// Initialize NoParserFoundException from config path.
public NoParserFoundException(string configName) : base(string.Format("No Parser found for config {0}", configName)) { }
}
}
diff --git a/E5Renewer.Exceptions/RuntimeException.cs b/E5Renewer.Exceptions/RuntimeException.cs
index c48d618..dd3c48b 100644
--- a/E5Renewer.Exceptions/RuntimeException.cs
+++ b/E5Renewer.Exceptions/RuntimeException.cs
@@ -1,7 +1,9 @@
namespace E5Renewer.Exceptions
{
+ /// The Exception is thown when generic runtime error happend.
public class RuntimeException : Exception
{
+ /// Initialize RuntimeException from message.
public RuntimeException(string msg) : base(msg) { }
}
}
diff --git a/E5Renewer.Modules/IModule.cs b/E5Renewer.Modules/IModule.cs
index f47bac3..4947dea 100644
--- a/E5Renewer.Modules/IModule.cs
+++ b/E5Renewer.Modules/IModule.cs
@@ -1,11 +1,16 @@
namespace E5Renewer.Modules
{
+ /// The api interface of loadable module.
public interface IModule
{
- private readonly static SemVer targetSemVer = new SemVer(0,1,0);
- public string name{ get; }
- public string author{ get; }
+ private readonly static SemVer targetSemVer = new SemVer(0, 1, 0);
+ /// The name of the module.
+ public string name { get; }
+ /// The author of the module.
+ public string author { get; }
+ /// The api version of the module.
public SemVer apiVersion { get; }
- public bool IsDeprecated { get => apiVersion < targetSemVer; }
+ /// If the module is deprecated.
+ public bool isDeprecated { get => !apiVersion.IsCompatibleTo(targetSemVer); }
}
}
diff --git a/E5Renewer.Modules/ModuleAttribute.cs b/E5Renewer.Modules/ModuleAttribute.cs
index a9c7059..8f6a10c 100644
--- a/E5Renewer.Modules/ModuleAttribute.cs
+++ b/E5Renewer.Modules/ModuleAttribute.cs
@@ -1,5 +1,6 @@
namespace E5Renewer.Modules
{
+ /// The attribute to mark module class.
[AttributeUsage(AttributeTargets.Class)]
- public class ModuleAttribute : Attribute {}
+ public class ModuleAttribute : Attribute { }
}
diff --git a/E5Renewer.Modules/ModulesLoader.cs b/E5Renewer.Modules/ModulesLoader.cs
index 83f835c..865ebee 100644
--- a/E5Renewer.Modules/ModulesLoader.cs
+++ b/E5Renewer.Modules/ModulesLoader.cs
@@ -2,6 +2,7 @@
namespace E5Renewer.Modules
{
+ /// Utils to load modules.
public static class ModulesLoader
{
private static readonly ILogger logger = LoggerFactory.Create(
@@ -36,7 +37,7 @@ private static List GetModulesInAssembly(Assembly assembly)
{
modules.Add(module);
logger.LogInformation("Loaded module {0} by {1}", module.name, module.author);
- if (module.IsDeprecated)
+ if (module.isDeprecated)
{
logger.LogWarning("You are using a deprecated module!");
}
@@ -51,6 +52,7 @@ private static List GetModulesInAssembly(Assembly assembly)
}
return modules;
}
+ /// Load all modules.
public static void LoadModules()
{
modules.AddRange(GetModulesInAssembly(Assembly.GetExecutingAssembly()));
@@ -61,6 +63,9 @@ public static void LoadModules()
modules.AddRange(GetModulesInAssembly(Assembly.Load(Path.GetFileNameWithoutExtension(fileInfo.FullName))));
}
}
+ /// Get registered modules.
+ /// The modules of type T in a List.
+ /// The type to filter modules.
public static List GetRegisteredModules()
where T : class, IModule
{
diff --git a/E5Renewer.Modules/SemVer.cs b/E5Renewer.Modules/SemVer.cs
index a925370..dc3e75a 100644
--- a/E5Renewer.Modules/SemVer.cs
+++ b/E5Renewer.Modules/SemVer.cs
@@ -1,20 +1,32 @@
namespace E5Renewer.Modules
{
+ /// The struct represents a version
+ /// SemVer
+ /// This only supports major.minor.patch pattern.
public struct SemVer
{
+ /// Make a SemVer by major, minor, and patch.
+ /// The major version number.
+ /// The minor version number.
+ /// The patch version number.
public SemVer(uint major, uint minor, uint patch)
{
this.major = major;
this.minor = minor;
this.patch = patch;
}
+ /// The major number.
public uint major { get; }
+ /// The minor number.
public uint minor { get; }
+ /// The patch number.
public uint patch { get; }
+ /// Convert SemVer to string in major.minor.patch format.
public override string ToString()
{
return $"{this.major}.{this.minor}.{this.patch}";
}
+ ///
public static SemVer operator +(SemVer a, SemVer b)
{
return new SemVer(
@@ -23,6 +35,7 @@ public override string ToString()
a.patch + b.patch
);
}
+ ///
public static SemVer operator -(SemVer a, SemVer b)
{
uint major = a.major > b.major ? a.major - b.major : 0;
@@ -30,32 +43,41 @@ public override string ToString()
uint patch = a.patch > b.patch ? a.patch - b.patch : 0;
return new SemVer(major, minor, patch);
}
+ ///
public static bool operator >(SemVer a, SemVer b)
{
return a.major > b.major ||
a.minor > b.minor ||
a.patch > b.patch;
}
+ ///
public static bool operator <(SemVer a, SemVer b)
{
return a.major < b.major ||
a.minor < b.minor ||
a.patch < b.patch;
}
+ ///
public static bool operator ==(SemVer a, SemVer b)
{
return a.major == b.major &&
a.minor == b.minor &&
a.patch == b.patch;
}
+ ///
public static bool operator !=(SemVer a, SemVer b)
{
return a.major != b.major ||
a.minor != b.minor ||
a.patch != b.patch;
}
+ ///
public override bool Equals(object? obj) => obj is SemVer semVerObj && this.Equals(semVerObj);
+ ///
public override int GetHashCode() => this.ToString().GetHashCode();
+ /// Is the SemVer compatible to another SemVer given.
+ /// The SemVer to compare.
+ /// If the SemVer is compatible to target.
public bool IsCompatibleTo(SemVer target)
{
return this.major == target.major &&
diff --git a/E5Renewer.Processor/APIAttribute.cs b/E5Renewer.Processor/APIAttribute.cs
index 7a36aea..6da760e 100644
--- a/E5Renewer.Processor/APIAttribute.cs
+++ b/E5Renewer.Processor/APIAttribute.cs
@@ -1,9 +1,13 @@
namespace E5Renewer.Processor
{
+ /// The attribute to mark functions calling msgraph apis.
[AttributeUsage(AttributeTargets.Method)]
public class APIAttribute : Attribute
{
+ /// The name of the api function.
public string name { get; private set; }
+ /// Initialize an APIAttribute by name.
+ /// The name of the api function.
public APIAttribute(string name)
{
this.name = name;
diff --git a/E5Renewer.Processor/APICallResult.cs b/E5Renewer.Processor/APICallResult.cs
index b60c63b..5d7ff19 100644
--- a/E5Renewer.Processor/APICallResult.cs
+++ b/E5Renewer.Processor/APICallResult.cs
@@ -1,22 +1,38 @@
namespace E5Renewer.Processor
{
- public struct APICallResult
+ /// The struct stores result of api request.
+ public readonly struct APICallResult
{
private const string connector = "-";
+ /// The APICallResult shows an error result.
public static readonly APICallResult errorResult = new(-1, "ERROR");
- public int code;
- public string msg;
- public object? rawResult;
+ /// The response code.
+ /// -1 means failed to send request.
+ public readonly int code;
+ /// The response message.
+ /// ERROR means failed to send request.
+ public readonly string msg;
+ /// The raw result of msgraph api request.
+ public readonly object? rawResult;
+ /// Initialize a APICallResult by code, message and api request result.
+ /// The response code.
+ /// The response message.
+ /// The result of request.
public APICallResult(int code = 200, string msg = "OK", object? rawResult = null)
{
this.code = code;
this.msg = msg;
this.rawResult = rawResult;
}
+ ///
public override string ToString()
{
return string.Join(connector, new object[2] { code, msg });
}
+ /// Convert rawResult to type given.
+ /// The type to convert.
+ /// The rawResult in type T. null if failed to convert.
+ ///
public T? CastRawResultTo()
where T : class
{
diff --git a/E5Renewer.Processor/APIContainerAttribute.cs b/E5Renewer.Processor/APIContainerAttribute.cs
index 0ec67ee..b86cb66 100644
--- a/E5Renewer.Processor/APIContainerAttribute.cs
+++ b/E5Renewer.Processor/APIContainerAttribute.cs
@@ -1,5 +1,7 @@
namespace E5Renewer.Processor
{
+ /// The attribute to mark class contains APIFunction.
+ ///
[AttributeUsage(AttributeTargets.Class)]
public class APIContainerAttribute : Attribute { }
}
diff --git a/E5Renewer.Processor/APIFunction.cs b/E5Renewer.Processor/APIFunction.cs
new file mode 100644
index 0000000..d3b3438
--- /dev/null
+++ b/E5Renewer.Processor/APIFunction.cs
@@ -0,0 +1,9 @@
+using Microsoft.Graph;
+
+namespace E5Renewer.Processor
+{
+ /// The delegate which accepts GraphServiceClient as input and returns Task<APICallResult>.
+ ///
+ ///
+ public delegate Task APIFunction(GraphServiceClient client);
+}
diff --git a/E5Renewer.Processor/APIHelper.cs b/E5Renewer.Processor/APIHelper.cs
index 476a0ee..b9b16f9 100644
--- a/E5Renewer.Processor/APIHelper.cs
+++ b/E5Renewer.Processor/APIHelper.cs
@@ -5,6 +5,7 @@
namespace E5Renewer.Processor
{
+ /// Helper class for processing APIFunction.
public static class APIHelper
{
private static readonly ILogger logger = LoggerFactory.Create(
@@ -17,7 +18,8 @@ public static class APIHelper
).SetMinimumLevel(E5Renewer.Constraints.loggingLevel)).CreateLogger(typeof(APIHelper));
private static readonly Dictionary cachedFunctions = new();
private static readonly Dictionary> cachedFunctionsMap = new();
- public delegate Task APIFunction(GraphServiceClient client);
+ /// Get all APIFunction.
+ /// All APIFunction with their name.
public static Dictionary GetAPIFunctions()
{
if (cachedFunctions.Count() > 0)
@@ -43,6 +45,9 @@ public static Dictionary GetAPIFunctions()
}
return results;
}
+ /// Get all APIFunction in type given.
+ /// The type of class to search APIFunction
+ /// All APIFunction with their name.
public static Dictionary GetAPIFunctions(Type type)
{
if (cachedFunctionsMap.ContainsKey(type))
diff --git a/E5Renewer.Processor/GraphAPIsGet.cs b/E5Renewer.Processor/GraphAPIsGet.cs
index 9456154..2c78309 100644
--- a/E5Renewer.Processor/GraphAPIsGet.cs
+++ b/E5Renewer.Processor/GraphAPIsGet.cs
@@ -7,563 +7,565 @@
namespace E5Renewer.Processor.GraphAPIs
{
+ /// Functions container for calling msgraph apis.
[APIContainer]
public static class Get
{
#region API
+ /// msgraph api implemention.
[API("AgreementAcceptances.Get")]
public static async Task GetAgreementAcceptance(GraphServiceClient client) => await client.AgreementAcceptances.GetAsync();
-
+ /// msgraph api implemention.
[API("Admin.Get")]
public static async Task GetAdmin(GraphServiceClient client) => await client.Admin.GetAsync();
-
+ /// msgraph api implemention.
[API("Agreements.Get")]
public static async Task GetAgreements(GraphServiceClient client) => await client.Agreements.GetAsync();
-
+ /// msgraph api implemention.
[API("AppCatalogs.Get")]
public static async Task GetAppCatalogs(GraphServiceClient client) => await client.AppCatalogs.GetAsync();
-
+ /// msgraph api implemention.
[API("ApplicationTemplates.Get")]
public static async Task GetApplicationTemplates(GraphServiceClient client) => await client.ApplicationTemplates.GetAsync();
-
+ /// msgraph api implemention.
[API("Applications.Get")]
public static async Task GetApplications(GraphServiceClient client) => await client.Applications.GetAsync();
-
+ /// msgraph api implemention.
[API("AuditLogs.Get")]
public static async Task GetAuditLogs(GraphServiceClient client) => await client.AuditLogs.GetAsync();
-
+ /// msgraph api implemention.
[API("AuthenticationMethodConfigurations.Get")]
public static async Task GetAuthenticationMethodConfigurations(GraphServiceClient client) => await client.AuthenticationMethodConfigurations.GetAsync();
-
+ /// msgraph api implemention.
[API("AuthenticationMethodsPolicy.Get")]
public static async Task GetAuthenticationMethodsPolicy(GraphServiceClient client) => await client.AuthenticationMethodsPolicy.GetAsync();
-
+ /// msgraph api implemention.
[API("CertificateBasedAuthConfiguration.Get")]
public static async Task GetCertificateBasedAuthConfiguration(GraphServiceClient client) => await client.CertificateBasedAuthConfiguration.GetAsync();
-
+ /// msgraph api implemention.
[API("Chats.Get")]
public static async Task GetChats(GraphServiceClient client) => await client.Chats.GetAsync();
-
+ /// msgraph api implemention.
[API("Communications.Get")]
public static async Task GetCommunications(GraphServiceClient client) => await client.Communications.GetAsync();
-
+ /// msgraph api implemention.
[API("Compliance.Get")]
public static async Task GetCompliance(GraphServiceClient client) => await client.Compliance.GetAsync();
-
+ /// msgraph api implemention.
[API("Connections.Get")]
public static async Task GetConnections(GraphServiceClient client) => await client.Connections.GetAsync();
-
+ /// msgraph api implemention.
[API("Contacts.Get")]
public static async Task GetContacts(GraphServiceClient client) => await client.Contacts.GetAsync();
-
+ /// msgraph api implemention.
[API("DataPolicyOperations.Get")]
public static async Task GetDataPolicyOperations(GraphServiceClient client) => await client.DataPolicyOperations.GetAsync();
-
+ /// msgraph api implemention.
[API("DeviceAppManagement.Get")]
public static async Task GetDeviceAppManagement(GraphServiceClient client) => await client.DeviceAppManagement.GetAsync();
-
+ /// msgraph api implemention.
[API("DeviceManagement.Get")]
public static async Task GetDeviceManagement(GraphServiceClient client) => await client.DeviceManagement.GetAsync();
-
+ /// msgraph api implemention.
[API("Devices.Get")]
public static async Task GetDevies(GraphServiceClient client) => await client.Devices.GetAsync();
-
+ /// msgraph api implemention.
[API("Direcory.Get")]
public static async Task GetDirecory(GraphServiceClient client) => await client.Directory.GetAsync();
-
+ /// msgraph api implemention.
[API("DirectoryObjects.Get")]
public static async Task GetDirectoryObjects(GraphServiceClient client) => await client.DirectoryObjects.GetAsync();
-
+ /// msgraph api implemention.
[API("DirectoryRoleTemplates.Get")]
public static async Task GetDirectoryRoleTemplates(GraphServiceClient client) => await client.DirectoryRoleTemplates.GetAsync();
-
+ /// msgraph api implemention.
[API("DirectoryRoles.Get")]
public static async Task GetDirectoryRoles(GraphServiceClient client) => await client.DirectoryRoles.GetAsync();
-
+ /// msgraph api implemention.
[API("DomainDnsRecords.Get")]
public static async Task GetDomainDnsRecords(GraphServiceClient client) => await client.DomainDnsRecords.GetAsync();
-
+ /// msgraph api implemention.
[API("Domains.Get")]
public static async Task GetDomains(GraphServiceClient client) => await client.Domains.GetAsync();
-
+ /// msgraph api implemention.
[API("Drives.Get")]
public static async Task GetDrives(GraphServiceClient client) => await client.Drives.GetAsync();
-
+ /// msgraph api implemention.
[API("Education.Get")]
public static async Task GetEducation(GraphServiceClient client) => await client.Education.GetAsync();
-
+ /// msgraph api implemention.
[API("EmployeeExperience.Get")]
public static async Task GetEmployeeExperience(GraphServiceClient client) => await client.EmployeeExperience.GetAsync();
-
+ /// msgraph api implemention.
[API("External.Get")]
public static async Task GetExternal(GraphServiceClient client) => await client.External.GetAsync();
-
+ /// msgraph api implemention.
[API("FilterOperators.Get")]
public static async Task GetFilterOperators(GraphServiceClient client) => await client.FilterOperators.GetAsync();
-
+ /// msgraph api implemention.
[API("Functions.Get")]
public static async Task GetFunctions(GraphServiceClient client) => await client.Functions.GetAsync();
-
+ /// msgraph api implemention.
[API("GroupLifecyclePolicies.Get")]
public static async Task GetGroupLifecyclePolicies(GraphServiceClient client) => await client.GroupLifecyclePolicies.GetAsync();
-
+ /// msgraph api implemention.
[API("GroupSettingTemplates.Get")]
public static async Task GetGroupSettingTemplates(GraphServiceClient client) => await client.GroupSettingTemplates.GetAsync();
-
+ /// msgraph api implemention.
[API("GroupSetings.Get")]
public static async Task GetGroupSettings(GraphServiceClient client) => await client.GroupSettings.GetAsync();
-
+ /// msgraph api implemention.
[API("Groups.Get")]
public static async Task GetGroups(GraphServiceClient client) => await client.Groups.GetAsync();
-
+ /// msgraph api implemention.
[API("Identity.Get")]
public static async Task GetIdentity(GraphServiceClient client) => await client.Identity.GetAsync();
-
+ /// msgraph api implemention.
[API("IdentityGovernance.Get")]
public static async Task GetIdentityGovernance(GraphServiceClient client) => await client.IdentityGovernance.GetAsync();
-
+ /// msgraph api implemention.
[API("IdentityProtection.Get")]
public static async Task GetIdentityProtection(GraphServiceClient client) => await client.IdentityProtection.GetAsync();
-
+ /// msgraph api implemention.
[Obsolete("GraphServiceClient.IdentityProviders.GetAsync is obsolete.")]
[API("IdentityProviders.Get")]
public static async Task GetIdentityProviders(GraphServiceClient client) => await client.IdentityProviders.GetAsync();
-
+ /// msgraph api implemention.
[API("InformationProtecion.Get")]
public static async Task GetInfomationProtecion(GraphServiceClient client) => await client.InformationProtection.GetAsync();
-
+ /// msgraph api implemention.
[API("Invitations.Get")]
public static async Task GetInvitations(GraphServiceClient client) => await client.Invitations.GetAsync();
-
+ /// msgraph api implemention.
[API("OAuth2PermissionGrants.Get")]
public static async Task GetOAuth2PermissionGrants(GraphServiceClient client) => await client.Oauth2PermissionGrants.GetAsync();
-
+ /// msgraph api implemention.
[API("Organization.Get")]
public static async Task GetOrganization(GraphServiceClient client) => await client.Organization.GetAsync();
-
+ /// msgraph api implemention.
[API("PermissionGrants.Get")]
public static async Task GetPermissionGrants(GraphServiceClient client) => await client.PermissionGrants.GetAsync();
-
+ /// msgraph api implemention.
[API("Places.Count.Get")]
public static async Task GetPlacesCount(GraphServiceClient client) => await client.Places.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Places.GraphRoom.Get")]
public static async Task GetPlacesGraphRoom(GraphServiceClient client) => await client.Places.GraphRoom.GetAsync();
-
+ /// msgraph api implemention.
[API("Places.GraphRoom.Count.Get")]
public static async Task GetPlacesGraphRoomCount(GraphServiceClient client) => await client.Places.GraphRoom.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Places.GraphRoomList.Get")]
public static async Task GetPlacesGraphRoomList(GraphServiceClient client) => await client.Places.GraphRoomList.GetAsync();
-
+ /// msgraph api implemention.
[API("Places.GraphRoomList.Count.Get")]
public static async Task GetPlacesGraphRoomListCount(GraphServiceClient client) => await client.Places.GraphRoomList.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Planner.Get")]
public static async Task GetPlanner(GraphServiceClient client) => await client.Planner.GetAsync();
-
+ /// msgraph api implemention.
[API("Planner.Buckets.Get")]
public static async Task GetPlannerBuckets(GraphServiceClient client) => await client.Planner.Buckets.GetAsync();
-
+ /// msgraph api implemention.
[API("Planner.Buckets.Count.Get")]
public static async Task GetPlannerBucketsC(GraphServiceClient client) => await client.Planner.Buckets.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Planner.Plans.Get")]
public static async Task GetPlannerPlans(GraphServiceClient client) => await client.Planner.Plans.GetAsync();
-
+ /// msgraph api implemention.
[API("Planner.Plans.Count.Get")]
public static async Task GetPlannerPlansCount(GraphServiceClient client) => await client.Planner.Plans.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Planner.Tasks.Get")]
public static async Task GetPlannerTasks(GraphServiceClient client) => await client.Planner.Tasks.GetAsync();
-
+ /// msgraph api implemention.
[API("Planner.Tasks.Count.Get")]
public static async Task GetPlannerTasksCount(GraphServiceClient client) => await client.Planner.Tasks.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Policies.Get")]
public static async Task GetPolicies(GraphServiceClient client) => await client.Policies.GetAsync();
-
+ /// msgraph api implemention.
[API("Print.Get")]
public static async Task GetPrint(GraphServiceClient client) => await client.Print.GetAsync();
-
+ /// msgraph api implemention.
[API("Privacy.Get")]
public static async Task GetPrivacy(GraphServiceClient client) => await client.Privacy.GetAsync();
-
+ /// msgraph api implemention.
[API("Reports.Get")]
public static async Task GetReports(GraphServiceClient client) => await client.Reports.GetAsync();
-
+ /// msgraph api implemention.
[API("RoleManagement.Get")]
public static async Task GetRoleManagement(GraphServiceClient client) => await client.RoleManagement.GetAsync();
-
+ /// msgraph api implemention.
[API("SchemaExtensions.Get")]
public static async Task GetSchemaExtensions(GraphServiceClient client) => await client.SchemaExtensions.GetAsync();
-
+ /// msgraph api implemention.
[API("ScopedRoleMemberships.Get")]
public static async Task GetScopedRoleMemberships(GraphServiceClient client) => await client.ScopedRoleMemberships.GetAsync();
-
+ /// msgraph api implemention.
[API("Search.Get")]
public static async Task GetSearch(GraphServiceClient client) => await client.Search.GetAsync();
-
+ /// msgraph api implemention.
[API("Search.Acronyms.Get")]
public static async Task GetSearchAcronyms(GraphServiceClient client) => await client.Search.Acronyms.GetAsync();
-
+ /// msgraph api implemention.
[API("Search.Acronyms.Count.Get")]
public static async Task GetSearchAcronymsCount(GraphServiceClient client) => await client.Search.Acronyms.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Search.Bookmarks.Get")]
public static async Task GetSearchBookmarks(GraphServiceClient client) => await client.Search.Bookmarks.GetAsync();
-
+ /// msgraph api implemention.
[API("Search.Bookmarks.Count.Get")]
public static async Task GetSearchBookmarksCount(GraphServiceClient client) => await client.Search.Bookmarks.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Search.Qnas.Get")]
public static async Task GetSearchQnas(GraphServiceClient client) => await client.Search.Qnas.GetAsync();
-
+ /// msgraph api implemention.
[API("Search.Qnas.Count.Get")]
public static async Task GetSearhQnasCount(GraphServiceClient client) => await client.Search.Qnas.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Get")]
public static async Task GetSecurity(GraphServiceClient client) => await client.Security.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Alerts.Get")]
public static async Task GetSecurityCount(GraphServiceClient client) => await client.Security.Alerts.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Alerts.Count.Get")]
public static async Task GetSecurityAlertsCount(GraphServiceClient client) => await client.Security.Alerts.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Alerts_v2.Get")]
public static async Task GetSecurityAlertsV2(GraphServiceClient client) => await client.Security.Alerts_v2.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Alerts_v2.Count.Get")]
public static async Task GetSecurityAlertsV2Count(GraphServiceClient client) => await client.Security.Alerts_v2.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Get")]
public static async Task GetSecurityAttackSimulation(GraphServiceClient client) => await client.Security.AttackSimulation.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.EndUserNotifications.Get")]
public static async Task GetSecurityAttackSimulationEndUserNotifications(GraphServiceClient client) => await client.Security.AttackSimulation.EndUserNotifications.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.EndUserNotifications.Count.Get")]
public static async Task GetSecurityAttackSimulationEndUserNotificationsCount(GraphServiceClient client) => await client.Security.AttackSimulation.EndUserNotifications.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.LandingPages.Get")]
public static async Task GetSecurityAttackSimulationLandingPages(GraphServiceClient client) => await client.Security.AttackSimulation.LandingPages.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.LandingPages.Count.Get")]
public static async Task GetSecurityAttackSimulationLandingPagesCount(GraphServiceClient client) => await client.Security.AttackSimulation.LandingPages.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.LoginPages.Get")]
public static async Task GetSecurityAttackSimulationLoginPages(GraphServiceClient client) => await client.Security.AttackSimulation.LoginPages.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.LoginPages.Count.Get")]
public static async Task GetSecurityAttackSimulationLoginPagesCount(GraphServiceClient client) => await client.Security.AttackSimulation.LoginPages.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Operations.Get")]
public static async Task GetSecurityAttackSimulationOperations(GraphServiceClient client) => await client.Security.AttackSimulation.Operations.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Operations.Count.Get")]
public static async Task GetSecurityAttackSimulationOperationsCount(GraphServiceClient client) => await client.Security.AttackSimulation.Operations.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Payloads.Get")]
public static async Task GetSecurityAttackSimulationPayloads(GraphServiceClient client) => await client.Security.AttackSimulation.Payloads.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Payloads.Count.Get")]
public static async Task GetSecurityAttackSimulationPayloadsCount(GraphServiceClient client) => await client.Security.AttackSimulation.Payloads.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.SimulationAutomations.Get")]
public static async Task GetSecurityAttackSimulationSimulationAutomations(GraphServiceClient client) => await client.Security.AttackSimulation.SimulationAutomations.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.SimulationAutomations.Count.Get")]
public static async Task GetSecurityAttackSimulationSimulationAutomationsCount(GraphServiceClient client) => await client.Security.AttackSimulation.SimulationAutomations.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Simulations.Get")]
public static async Task GetSecurityAttackSimulationSimulations(GraphServiceClient client) => await client.Security.AttackSimulation.Simulations.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Simulations.Count.Get")]
public static async Task GetSecurityAttackSimulationSimulationsCount(GraphServiceClient client) => await client.Security.AttackSimulation.Simulations.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Trainings.Get")]
public static async Task GetSecurityAttackSimulationTrendings(GraphServiceClient client) => await client.Security.AttackSimulation.Trainings.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.AttackSimulation.Trainings.Count.Get")]
public static async Task GetSecurityAttackSimulationTrendingsCount(GraphServiceClient client) => await client.Security.AttackSimulation.Trainings.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Cases.Get")]
public static async Task GetSecurityCases(GraphServiceClient client) => await client.Security.Cases.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Cases.EdiscoveryCases.Get")]
public static async Task GetSecurityCasesEdiscoveryCases(GraphServiceClient client) => await client.Security.Cases.EdiscoveryCases.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Cases.EdiscoveryCases.Count.Get")]
public static async Task GetSecurityCasesEdiscoveryCasesCount(GraphServiceClient client) => await client.Security.Cases.EdiscoveryCases.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Incidents.Get")]
public static async Task GetSecurityIncidents(GraphServiceClient client) => await client.Security.Incidents.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Incidents.Count.Get")]
public static async Task GetSecurityIncidentsCount(GraphServiceClient client) => await client.Security.Incidents.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.SecureScoreControlProfiles.Get")]
public static async Task GetSecuritySecureScoreControlProfiles(GraphServiceClient client) => await client.Security.SecureScoreControlProfiles.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.SecureScoreControlProfiles.Count.Get")]
public static async Task GetSecuritySecureScoreControlProfilesCount(GraphServiceClient client) => await client.Security.SecureScoreControlProfiles.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.SecureScores.Get")]
public static async Task GetSecurityScores(GraphServiceClient client) => await client.Security.SecureScores.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.SecureScores.Count.Get")]
public static async Task GetSecuritySecureScoresCount(GraphServiceClient client) => await client.Security.SecureScores.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.SubjectRightsRequests.Get")]
public static async Task GetSecuritySubjectRightsRequests(GraphServiceClient client) => await client.Security.SubjectRightsRequests.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.SubjectRightsRequests.Count.Get")]
public static async Task GetSecuritySubjectRightsRequestsCount(GraphServiceClient client) => await client.Security.SubjectRightsRequests.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Get")]
public static async Task GetSecurityThreatIntelligence(GraphServiceClient client) => await client.Security.ThreatIntelligence.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.ArticleIndicators.Get")]
public static async Task GetSecurityThreatIntelligenceArticleIndicators(GraphServiceClient client) => await client.Security.ThreatIntelligence.ArticleIndicators.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.ArticleIndicators.Count.Get")]
public static async Task GetSecurityThreatIntelligenceArticleIndicatorsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.ArticleIndicators.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Articles.Get")]
public static async Task GetSecurityThreatIntelligenceArticles(GraphServiceClient client) => await client.Security.ThreatIntelligence.Articles.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Articles.Count.Get")]
public static async Task GetSecurityThreatIntelligenceArticlesCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.Articles.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostComponents.Get")]
public static async Task GetSecurityThreatIntelligenceHostComponents(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostComponents.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostComponents.Count.Get")]
public static async Task GetSecurityThreatIntelligenceHostComponentsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostComponents.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostCookies.Get")]
public static async Task GetSecurityThreatIntelligenceHostCookies(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostCookies.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostCookies.Count.Get")]
public static async Task GetSecurityThreatIntelligenceHostCookiesCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostCookies.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostPairs.Get")]
public static async Task GetSecurityThreatIntelligenceHostPairs(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostPairs.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostPairs.Count.Get")]
public static async Task GetSecurityThreatIntelligenceHostPairsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostPairs.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostPorts.Get")]
public static async Task GetSecurityThreatIntelligenceHostPorts(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostPorts.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostPorts.Count.Get")]
public static async Task GetSecurityThreatIntelligenceHostPortsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostPorts.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostSslCertificates.Get")]
public static async Task GetSecurityThreatIntelligenceHostSslCertificates(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostSslCertificates.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostSslCertificates.Count.Get")]
public static async Task GetSecurityThreatIntelligenceHostSslCertificatesCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostSslCertificates.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostTrackers.Get")]
public static async Task GetSecurityThreatIntelligenceHostTrackers(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostTrackers.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.HostTrackers.Count.Get")]
public static async Task GetSecurityThreatIntelligenceHostTrackersCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.HostTrackers.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Hosts.Get")]
public static async Task GetSecurityThreatIntelligenceHosts(GraphServiceClient client) => await client.Security.ThreatIntelligence.Hosts.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Hosts.Count.Get")]
public static async Task GetSecurityThreatIntelligenceHostsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.Hosts.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.IntelligenceProfiles.Get")]
public static async Task GetSecurityThreatIntelligenceIntelProfiles(GraphServiceClient client) => await client.Security.ThreatIntelligence.IntelProfiles.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.IntelligenceProfiles.Count.Get")]
public static async Task GetSecurityThreatIntelligenceIntelProfilesCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.IntelProfiles.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.IntelligenceProfileIndicators.Get")]
public static async Task GetSecurityThreatIntelligenceIntelligenceProfileIndicators(GraphServiceClient client) => await client.Security.ThreatIntelligence.IntelligenceProfileIndicators.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.IntelligenceProfileIndicators.Count.Get")]
public static async Task GetSecurityThreatIntelligenceIntelligenceProfileIndicatorsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.IntelligenceProfileIndicators.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.PassiveDnsRecords.Get")]
public static async Task GetSecurityThreatIntelligencePassiveDnsRecords(GraphServiceClient client) => await client.Security.ThreatIntelligence.PassiveDnsRecords.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.PassiveDnsRecords.Count.Get")]
public static async Task GetSecurityThreatIntelligencePassiveDnsRecordsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.PassiveDnsRecords.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.SslCertificates.Get")]
public static async Task GetSecurityThreatIntelligenceSslCertificates(GraphServiceClient client) => await client.Security.ThreatIntelligence.SslCertificates.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.SslCertificates.Count.Get")]
public static async Task GetSecurityThreatIntelligenceSslCertificatesCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.SslCertificates.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Subdomains.Get")]
public static async Task GetSecurityThreatIntelligenceSubdomains(GraphServiceClient client) => await client.Security.ThreatIntelligence.Subdomains.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Subdomains.Count.Get")]
public static async Task GetSecurityThreatIntelligenceSubdomainsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.Subdomains.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Vulnerabilities.Get")]
public static async Task GetSecurityThreatIntelligenceVulnerabilities(GraphServiceClient client) => await client.Security.ThreatIntelligence.Vulnerabilities.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.Vulnerabilities.Count.Get")]
public static async Task GetSecurityThreatIntelligenceVulnerabilitiesCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.Vulnerabilities.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.WhoisHistoryRecords.Get")]
public static async Task GetSecurityThreatIntelligenceWhoisHistoryRecords(GraphServiceClient client) => await client.Security.ThreatIntelligence.WhoisHistoryRecords.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.WhoisHistoryRecords.Count.Get")]
public static async Task GetSecurityThreatIntelligenceWhoisHistoryRecordsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.WhoisHistoryRecords.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.WhoisRecords.Get")]
public static async Task GetSecurityThreatIntelligenceWhoisRecords(GraphServiceClient client) => await client.Security.ThreatIntelligence.WhoisRecords.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.ThreatIntelligence.WhoisRecords.Count.Get")]
public static async Task GetSecurityThreatIntelligenceWhoisRecordsCount(GraphServiceClient client) => await client.Security.ThreatIntelligence.WhoisRecords.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.TriggerTypes.Get")]
public static async Task GetSecurityTriggerTypes(GraphServiceClient client) => await client.Security.TriggerTypes.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.TriggerTypes.RetentionEventTypes.Get")]
public static async Task GetSecurityTriggerTypesRetentionEventTypes(GraphServiceClient client) => await client.Security.TriggerTypes.RetentionEventTypes.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.TriggerTypes.RetentionEventTypes.Count.Get")]
public static async Task GetSecurityTriggerTypesRetentionEventTypesCount(GraphServiceClient client) => await client.Security.TriggerTypes.RetentionEventTypes.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Triggers.Get")]
public static async Task GetSecurityTriggers(GraphServiceClient client) => await client.Security.Triggers.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Triggers.RetentionEvents.Get")]
public static async Task GetSecurityTriggersRetensionEvents(GraphServiceClient client) => await client.Security.Triggers.RetentionEvents.GetAsync();
-
+ /// msgraph api implemention.
[API("Security.Triggers.RetentionEvents.Count.Get")]
public static async Task GetSecurityTriggersRetensionEventsCount(GraphServiceClient client) => await client.Security.Triggers.RetentionEvents.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("ServicePrincipals.Get")]
public static async Task GetServicePrincipals(GraphServiceClient client) => await client.ServicePrincipals.GetAsync();
-
+ /// msgraph api implemention.
[API("ServicePrincipals.Count.Get")]
public static async Task GetServicePrincipalsCount(GraphServiceClient client) => await client.ServicePrincipals.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("ServicePrincipals.Delta.Get")]
public static async Task GetServicePrincipalsDelta(GraphServiceClient client) => await client.ServicePrincipals.Delta.GetAsDeltaGetResponseAsync();
-
+ /// msgraph api implemention.
[API("Shares.Get")]
public static async Task GetShares(GraphServiceClient client) => await client.Shares.GetAsync();
-
+ /// msgraph api implemention.
[API("Shares.Count.Get")]
public static async Task GetSharesCount(GraphServiceClient client) => await client.Shares.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Sites.Get")]
public static async Task GetSites(GraphServiceClient client) => await client.Sites.GetAsync();
-
+ /// msgraph api implemention.
[API("Sites.Count.Get")]
public static async Task GetSitesCount(GraphServiceClient client) => await client.Sites.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Sites.Add.Get")]
public static async Task GetSitesDelta(GraphServiceClient client) => await client.Sites.Delta.GetAsDeltaGetResponseAsync();
-
+ /// msgraph api implemention.
[API("Sites.GetAllSites.Get")]
public static async Task GetSitesGetAllSites(GraphServiceClient client) => await client.Sites.GetAllSites.GetAsGetAllSitesGetResponseAsync();
-
+ /// msgraph api implemention.
[API("Solutions.Get")]
public static async Task GetSolutions(GraphServiceClient client) => await client.Solutions.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.BookingBusinesses.Get")]
public static async Task GetSolutionsBookingBusinesses(GraphServiceClient client) => await client.Solutions.BookingBusinesses.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.BookingBusinesses.Count.Get")]
public static async Task GetSolutionsBookingBusinessesCount(GraphServiceClient client) => await client.Solutions.BookingBusinesses.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.BookingCurrencies.Get")]
public static async Task GetSolutionsBookingCurrencies(GraphServiceClient client) => await client.Solutions.BookingCurrencies.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.BookingCurrencies.Count.Get")]
public static async Task GetSolutionsBookingCurrenciesCount(GraphServiceClient client) => await client.Solutions.BookingCurrencies.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.VirtualEvents.Get")]
public static async Task GetSolutionsVirtualEvents(GraphServiceClient client) => await client.Solutions.VirtualEvents.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.VirtualEvents.Events.Get")]
public static async Task GetSolutionsVirtualEventsEvents(GraphServiceClient client) => await client.Solutions.VirtualEvents.Events.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.VirtualEvents.Events.Count.Get")]
public static async Task GetSolutionsVirtualEventsEventsCount(GraphServiceClient client) => await client.Solutions.VirtualEvents.Events.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.VirtualEvents.Webinars.Get")]
public static async Task GetSolutionsVirtualEventsWebinars(GraphServiceClient client) => await client.Solutions.VirtualEvents.Webinars.GetAsync();
-
+ /// msgraph api implemention.
[API("Solutions.VirtualEvents.Webinars.Count.Get")]
public static async Task GetSolutionsVirtualEventsWebinarsCount(GraphServiceClient client) => await client.Solutions.VirtualEvents.Webinars.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("SubscribedSkus.Get")]
public static async Task GetSubscribedSkus(GraphServiceClient client) => await client.SubscribedSkus.GetAsync();
-
+ /// msgraph api implemention.
[API("Subscriptions.Get")]
public static async Task GetSubscriptions(GraphServiceClient client) => await client.Subscriptions.GetAsync();
-
+ /// msgraph api implemention.
[API("Teams.Get")]
public static async Task GetTeams(GraphServiceClient client) => await client.Teams.GetAsync();
-
+ /// msgraph api implemention.
[API("Teams.Count.Get")]
public static async Task GetTeamsCount(GraphServiceClient client) => await client.Teams.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Teams.GetAllMessages.Get")]
public static async Task GetTeamsGetAllMessages(GraphServiceClient client) => await client.Teams.GetAllMessages.GetAsGetAllMessagesGetResponseAsync();
-
+ /// msgraph api implemention.
[API("TeamsTemplates.Get")]
public static async Task GetTeamsTemplates(GraphServiceClient client) => await client.TeamsTemplates.GetAsync();
-
+ /// msgraph api implemention.
[API("TeamsTemplates.Count.Get")]
public static async Task GetTeamsTemplatesCount(GraphServiceClient client) => await client.TeamsTemplates.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.Get")]
public static async Task GetTeamwork(GraphServiceClient client) => await client.Teamwork.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.DeletedChats.Get")]
public static async Task GetTeamworkDeletedChats(GraphServiceClient client) => await client.Teamwork.DeletedChats.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.DeletedChats.Count.Get")]
public static async Task GetTeamworkDeletedChatsCount(GraphServiceClient client) => await client.Teamwork.DeletedChats.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.DeletedTeams.Get")]
public static async Task GetTeamworkDeletedTeams(GraphServiceClient client) => await client.Teamwork.DeletedTeams.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.DeletedTeams.Count.Get")]
public static async Task GetTeamworkDeletedTeamsCount(GraphServiceClient client) => await client.Teamwork.DeletedTeams.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.DeletedTeams.GetAllMessages.Get")]
public static async Task GetTeamworkDeletedTeamsGetAllMessages(GraphServiceClient client) => await client.Teamwork.DeletedTeams.GetAllMessages.GetAsGetAllMessagesGetResponseAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.TeamsAppSettings.Get")]
public static async Task GetTeamworkTeamsAppSettings(GraphServiceClient client) => await client.Teamwork.TeamsAppSettings.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.WorkforceIntegrations.Get")]
public static async Task GetTeamworkWorkforceIntegrations(GraphServiceClient client) => await client.Teamwork.WorkforceIntegrations.GetAsync();
-
+ /// msgraph api implemention.
[API("Teamwork.WorkforceIntegrations.Count.Get")]
public static async Task GetTeamworkWorkforceIntegrationsCount(GraphServiceClient client) => await client.Teamwork.WorkforceIntegrations.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("TenantRelationships.Get")]
public static async Task GetTenantRelationships(GraphServiceClient client) => await client.TenantRelationships.GetAsync();
-
+ /// msgraph api implemention.
[API("TenantRelationships.DelegatedAdminCustomers.Get")]
public static async Task GetTenantRelationshipsDelegatedAdminCustomers(GraphServiceClient client) => await client.TenantRelationships.DelegatedAdminCustomers.GetAsync();
-
+ /// msgraph api implemention.
[API("TenantRelationships.DelegatedAdminCustomers.Count.Get")]
public static async Task GetTenantRelationshipsDelegatedAdminCustomersCount(GraphServiceClient client) => await client.TenantRelationships.DelegatedAdminCustomers.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Users.Get")]
public static async Task GetUsers(GraphServiceClient client) => await client.Users.GetAsync();
-
+ /// msgraph api implemention.
[API("Users.Count.Get")]
public static async Task GetUsersCount(GraphServiceClient client) => await client.Users.Count.GetAsync();
-
+ /// msgraph api implemention.
[API("Users.Delta.Get")]
public static async Task GetUsersDelta(GraphServiceClient client) => await client.Users.Delta.GetAsDeltaGetResponseAsync();
diff --git a/E5Renewer.Processor/IAPICaller.cs b/E5Renewer.Processor/IAPICaller.cs
index 0771e61..1c9c599 100644
--- a/E5Renewer.Processor/IAPICaller.cs
+++ b/E5Renewer.Processor/IAPICaller.cs
@@ -3,9 +3,15 @@
namespace E5Renewer.Processor
{
+ /// The api interface of APICaller.
public interface IAPICaller : IModule
{
+ /// Call next APIFunction.
+ /// If update result, defaults to true
+ ///
public Task CallNextAPI(bool update = true);
+ /// Add user to caller.
+ /// The user to add.
public void AddUser(GraphUser user);
}
}
diff --git a/E5Renewer.Processor/Processor.cs b/E5Renewer.Processor/Processor.cs
index 3ae1f5b..6f63d74 100644
--- a/E5Renewer.Processor/Processor.cs
+++ b/E5Renewer.Processor/Processor.cs
@@ -2,15 +2,21 @@
namespace E5Renewer.Processor
{
+ /// Processor class for handling msgraph apis calling.
public class GraphAPIProcessor : BackgroundService
{
private readonly List users;
private readonly ILogger logger;
+ /// Initialize GraphAPIProcessor
+ /// All the users to be processed.
+ /// The logger to create logs.
+ /// All the params are injected by Asp.Net Core runtime.
public GraphAPIProcessor(List users, ILogger logger)
{
this.users = users;
this.logger = logger;
}
+ ///
protected override async Task ExecuteAsync(CancellationToken cancellationToken)
{
diff --git a/E5Renewer.Processor/RandomAPICaller.cs b/E5Renewer.Processor/RandomAPICaller.cs
index 2859b09..31fe219 100644
--- a/E5Renewer.Processor/RandomAPICaller.cs
+++ b/E5Renewer.Processor/RandomAPICaller.cs
@@ -6,6 +6,7 @@
namespace E5Renewer.Modules.APICallers
{
+ /// A APICaller implementation which calls msgraph apis randomly.
[Module]
public class RandomAPICaller : IAPICaller
{
@@ -18,12 +19,15 @@ public class RandomAPICaller : IAPICaller
}
).SetMinimumLevel(E5Renewer.Constraints.loggingLevel)
).CreateLogger();
- private static readonly Dictionary apiFunctions = APIHelper.GetAPIFunctions();
+ private static readonly Dictionary apiFunctions = APIHelper.GetAPIFunctions();
private readonly Dictionary userClientsMap = new();
+ ///
public string name { get => "RandomAPICaller"; }
+ ///
public string author { get => "E5Renewer"; }
+ ///
public SemVer apiVersion { get => new(0, 1, 0); }
-
+ ///
public async Task CallNextAPI(bool update = true)
{
List> tasks = new();
@@ -32,7 +36,7 @@ public async Task CallNextAPI(bool update = true)
{
int i = random.Next(apiFunctions.Count());
string apiName = apiFunctions.Keys.ElementAt(i);
- APIHelper.APIFunction apiFunc = apiFunctions.Values.ElementAt(i);
+ APIFunction apiFunc = apiFunctions.Values.ElementAt(i);
Func> invoke = async delegate (GraphUser user, GraphServiceClient client)
{
logger.LogDebug("Calling api {0}", apiName);
@@ -48,6 +52,7 @@ public async Task CallNextAPI(bool update = true)
}
await Task.WhenAll(tasks.ToArray());
}
+ ///
public void AddUser(GraphUser user)
{
if (!userClientsMap.ContainsKey(user))
diff --git a/E5Renewer.Processor/ResultsManager.cs b/E5Renewer.Processor/ResultsManager.cs
index 07f99d4..1b100ef 100644
--- a/E5Renewer.Processor/ResultsManager.cs
+++ b/E5Renewer.Processor/ResultsManager.cs
@@ -2,6 +2,8 @@
namespace E5Renewer.Processor
{
+ /// Utils to record results of APIFunction
+ ///
public static class ResultsManager
{
private static readonly Dictionary>> results = new();
@@ -16,6 +18,11 @@ internal static void UpdateResult(this GraphUser user, APICallResult result, str
results[user.name] = new() { new(apiName, result.ToString()) };
}
}
+ /// Get results by user and api.
+ /// The user's name.
+ /// The api's name.
+ ///
+ ///
public static List GetResults(string userName, string apiName)
{
List> kvs = results.ContainsKey(userName) ? results[userName] : new();
diff --git a/E5Renewer.Processor/UsersManager.cs b/E5Renewer.Processor/UsersManager.cs
index 7bfef15..f582713 100644
--- a/E5Renewer.Processor/UsersManager.cs
+++ b/E5Renewer.Processor/UsersManager.cs
@@ -2,6 +2,7 @@
namespace E5Renewer.Processor
{
+ /// Utils to record user status.
public static class UsersManager
{
private static readonly List waitingUsers = new();
@@ -31,7 +32,11 @@ internal static void SetRunning(this GraphUser user, bool running)
}
}
}
+ /// Get running users.
+ /// The list of running users'name.
public static List GetRunningUsers() => runningUsers;
+ /// Get waiting users.
+ /// The list of waiting users' name.
public static List GetWaitingUsers() => waitingUsers;
}
}
diff --git a/E5Renewer.Statistics/ExceptionHandlers.cs b/E5Renewer.Statistics/ExceptionHandlers.cs
index e2b1d9d..339ef96 100644
--- a/E5Renewer.Statistics/ExceptionHandlers.cs
+++ b/E5Renewer.Statistics/ExceptionHandlers.cs
@@ -3,6 +3,7 @@
namespace E5Renewer.Statistics
{
+ /// Utils to handle api request exceptions.
public static class ExceptionHandlers
{
private static ILogger logger = LoggerFactory.Create(
@@ -14,8 +15,13 @@ public static class ExceptionHandlers
}
).SetMinimumLevel(E5Renewer.Constraints.loggingLevel)
).CreateLogger(typeof(ExceptionHandlers));
+ /// Generate an exception result from ActionContext.
+ ///
+ /// The exception result.
public static async Task GenerateExceptionResult(ActionContext context) => await GenerateExceptionResult(context.HttpContext);
-
+ /// Generate an exception result from HttpContext.
+ ///
+ /// The exception result.
public static async Task GenerateExceptionResult(HttpContext context)
{
logger.LogWarning("Creating an empty InvokeResult to hide exceptions");
@@ -57,6 +63,5 @@ public static async Task GenerateExceptionResult(HttpContext conte
)
);
}
- public static async Task OnException(HttpContext context) => await context.Response.WriteAsJsonAsync(await GenerateExceptionResult(context));
}
}
diff --git a/E5Renewer.Statistics/Helper.cs b/E5Renewer.Statistics/Helper.cs
index d31b885..2dca654 100644
--- a/E5Renewer.Statistics/Helper.cs
+++ b/E5Renewer.Statistics/Helper.cs
@@ -1,7 +1,10 @@
namespace E5Renewer.Statistics
{
+ /// Utils for handling network requests.
public static class Helper
{
+ /// Get milliseconded unix timestamp.
+ /// The timestamp.
public static long GetUnixTimestamp()
{
return (long)DateTime.UtcNow.Subtract(DateTime.UnixEpoch).TotalMilliseconds;
diff --git a/E5Renewer.Statistics/InvokeResult.cs b/E5Renewer.Statistics/InvokeResult.cs
index 8c73923..a94e533 100644
--- a/E5Renewer.Statistics/InvokeResult.cs
+++ b/E5Renewer.Statistics/InvokeResult.cs
@@ -1,11 +1,22 @@
namespace E5Renewer.Statistics
{
+ /// The struct which stores query result and as a response.
public readonly struct InvokeResult
{
+ /// Request method.
+ /// Is **NOT** HttpContext.Request.Method
public readonly string method { get; }
+ /// The params to be passed to request method.
public readonly Dictionary args { get; }
+ /// The request result.
public readonly object? result { get; }
+ /// The timestamp.
public readonly long timestamp { get; }
+ /// Initialize an InvokeResult from method, params, result and timestamp.
+ /// The request method.
+ /// The request params.
+ /// The request result.
+ /// The request timestamp.
public InvokeResult(string method, Dictionary args, object? result, long timestamp)
{
this.method = method;
diff --git a/E5Renewer.Statistics/JsonAPIV1Controller.cs b/E5Renewer.Statistics/JsonAPIV1Controller.cs
index 6d04c23..b54cdd7 100644
--- a/E5Renewer.Statistics/JsonAPIV1Controller.cs
+++ b/E5Renewer.Statistics/JsonAPIV1Controller.cs
@@ -3,16 +3,20 @@
namespace E5Renewer.Statistics
{
+ /// Json api controller.
[ApiController]
[Route("v1")]
public class JsonAPIV1Controller : ControllerBase
{
private readonly ILogger logger;
+ /// Initialize controller by logger given.
+ /// The logger to create logs.
+ /// All the params are injected by Asp.Net Core runtime.
public JsonAPIV1Controller(ILogger logger)
{
this.logger = logger;
}
-
+ /// Handler for /v1/list_apis.
[HttpGet("list_apis")]
public InvokeResult GetListApis()
{
@@ -25,6 +29,7 @@ public InvokeResult GetListApis()
Helper.GetUnixTimestamp()
);
}
+ /// Handler for /v1/running_users.
[HttpGet("running_users")]
public InvokeResult GetRunningUsers()
{
@@ -37,6 +42,7 @@ public InvokeResult GetRunningUsers()
Helper.GetUnixTimestamp()
);
}
+ /// Handler for /v1/waiting_users.
[HttpGet("waiting_users")]
public InvokeResult GetWaitingUsers()
{
@@ -49,6 +55,7 @@ public InvokeResult GetWaitingUsers()
Helper.GetUnixTimestamp()
);
}
+ /// Handler for /v1/user_results.
[HttpGet("user_results")]
public InvokeResult GetUserResults([FromQuery(Name = "user")] string userName, [FromQuery(Name = "api_name")] string apiName)
{
diff --git a/E5Renewer.Statistics/WebApplicationExtends.cs b/E5Renewer.Statistics/WebApplicationExtends.cs
index 3ca545c..2868a7a 100644
--- a/E5Renewer.Statistics/WebApplicationExtends.cs
+++ b/E5Renewer.Statistics/WebApplicationExtends.cs
@@ -3,8 +3,13 @@
namespace E5Renewer.Statistics
{
+ /// Extends for WebApplication
+ ///
public static class WebApplicationExtends
{
+ /// Use custom authentication middleware.
+ /// The WebApplication instance.
+ /// The token used for authentication.
public static IApplicationBuilder UseAuthTokenAuthentication(this WebApplication app, string authToken)
{
return app.Use(
@@ -22,6 +27,9 @@ public static IApplicationBuilder UseAuthTokenAuthentication(this WebApplication
}
);
}
+ /// Only allow methods given to connect.
+ /// The WebApplication instance.
+ /// The request methods to allow.
public static IApplicationBuilder UseHttpMethodChecker(this WebApplication app, params string[] methods)
{
return app.Use(
@@ -37,6 +45,9 @@ public static IApplicationBuilder UseHttpMethodChecker(this WebApplication app,
}
);
}
+ /// Check timestamp in request.
+ /// The WebApplication instance.
+ /// Max allowed seconds.
public static IApplicationBuilder UseUnixTimestampChecker(this WebApplication app, uint allowedMaxSeconds = 30)
{
return app.Use(
diff --git a/Helper.cs b/Helper.cs
index 7dfe456..001bdd8 100644
--- a/Helper.cs
+++ b/Helper.cs
@@ -1,5 +1,10 @@
+/// Utils for processing.
public static class Helper
{
+ /// Convert unix permission to UnixFileMode.
+ /// The unix permission in octal number.
+ /// The converted UnixFileMode flag.
+ ///
public static UnixFileMode ToUnixFileMode(uint permission)
{
if (permission > 777)
diff --git a/Main.cs b/Main.cs
index 691a173..8cb6d1f 100644
--- a/Main.cs
+++ b/Main.cs
@@ -3,7 +3,6 @@
using System.Net.Sockets;
using System.Text.Json;
using Microsoft.AspNetCore.Server.Kestrel.Core;
-using Microsoft.AspNetCore.Mvc;
using E5Renewer.Config;
using E5Renewer.Modules;
using E5Renewer.Exceptions;
@@ -54,37 +53,38 @@ async Task StartWebApplication(RuntimeConfig config)
builder.WebHost.ConfigureKestrel(
delegate (KestrelServerOptions serverOptions)
{
- try
+ const uint maxPort = 65535;
+ bool listenHttp =
+ !string.IsNullOrEmpty(config.listenAddr) &&
+ config.listenPort > 0 &&
+ config.listenPort <= maxPort;
+ if (listenHttp)
{
serverOptions.Listen(
IPAddress.Parse(config.listenAddr),
(int)config.listenPort
);
}
- catch
+ else if (Socket.OSSupportsUnixDomainSockets)
{
- if (Socket.OSSupportsUnixDomainSockets)
- {
- serverOptions.ListenUnixSocket(
- config.listenSocket,
- delegate (ListenOptions listenOptions)
+ serverOptions.ListenUnixSocket(
+ config.listenSocket,
+ delegate (ListenOptions listenOptions)
+ {
+ if (listenOptions.SocketPath != null && !OperatingSystem.IsWindows())
{
- if (listenOptions.SocketPath != null && !OperatingSystem.IsWindows())
- {
- File.SetUnixFileMode(
- listenOptions.SocketPath,
- Helper.ToUnixFileMode(config.listenSocketPermission)
- );
- }
+ File.SetUnixFileMode(
+ listenOptions.SocketPath,
+ Helper.ToUnixFileMode(config.listenSocketPermission)
+ );
}
- );
- }
- else
- {
- throw new RuntimeException("Cannot Bind to HTTP or Unix Domain Socket.");
- }
+ }
+ );
+ }
+ else
+ {
+ throw new RuntimeException("Cannot Bind to HTTP or Unix Domain Socket.");
}
-
}
);
builder.Services.AddHostedService();
@@ -101,15 +101,10 @@ async Task StartWebApplication(RuntimeConfig config)
options.InvalidModelStateResponseFactory = (context) => ExceptionHandlers.GenerateExceptionResult(context).Result
);
WebApplication app = builder.Build();
- app.UseExceptionHandler(
- new ExceptionHandlerOptions()
- {
- ExceptionHandler = ExceptionHandlers.OnException
- }
- );
app.UseRouting();
- app.Logger.LogDebug("Setting allowed method to GET and POST");
- app.UseHttpMethodChecker("GET", "POST");
+ string[] allowedMethods = ["GET", "POST"];
+ app.Logger.LogDebug("Setting allowed method to {0}", string.Join(", ", allowedMethods));
+ app.UseHttpMethodChecker(allowedMethods);
app.Logger.LogDebug("Setting check Unix timestamp in request");
app.UseUnixTimestampChecker();
app.Logger.LogDebug("Setting authToken");