Repository navigation
DiGi.WebAPI.Classes
Holds metadata about a controller, including its name, assembly information, and version.
public class ControllerInformation : DiGi.Core.Classes.SerializableObject, DiGi.WebAPI.Interfaces.IWebAPISerializableObject, DiGi.WebAPI.Interfaces.IWebAPIObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → ControllerInformation
Implements IWebAPISerializableObject, IWebAPIObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject
Initializes a new instance of the ControllerInformation class by copying from another instance.
public ControllerInformation(DiGi.WebAPI.Classes.ControllerInformation? controllerInformation);controllerInformation ControllerInformation
The ControllerInformation to copy from.
Initializes a new instance of the ControllerInformation class with the specified metadata.
public ControllerInformation(string? name, string? assemblyName, string? version, string? informationalVersion);name System.String
The controller name.
assemblyName System.String
The name of the assembly containing the controller.
version System.String
The assembly version.
informationalVersion System.String
The informational version of the assembly.
Initializes a new instance of the ControllerInformation class from a JSON object.
public ControllerInformation(System.Text.Json.Nodes.JsonObject jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object to deserialize from.
Gets the name of the assembly containing the controller.
public string? AssemblyName { get; }Gets the informational version of the assembly.
public string? InformationalVersion { get; }Gets the name of the controller.
public string? Name { get; }Gets the version of the assembly containing the controller.
public string? Version { get; }Provides API endpoints for retrieving controller metadata and application version information.
public class InformationController : DiGi.WebAPI.Classes.WebAPIControllerInheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → WebAPIController → InformationController
Initializes a new instance of the InformationController class.
public InformationController(Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager applicationPartManager);applicationPartManager Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager
The application part manager used for controller discovery.
Manages application parts for controller discovery.
private readonly ApplicationPartManager applicationPartManager;Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager
Retrieves a list of all registered controllers in the application.
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetControllersAsync();System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A JSON string containing controller information, or an empty response if no controllers are found.
Retrieves the version of the executing assembly.
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetVersionAsync();System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
The assembly version as a string, or an empty response if unavailable.
Abstract class for input parameters for endpoint.
public abstract class Parameter : DiGi.Core.Classes.SerializableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Parameter
Initializes a new instance of the Parameter class.
public Parameter();Initializes a new instance of the Parameter class by copying another instance of the same type.
public Parameter(DiGi.WebAPI.Classes.Parameter parameter);parameter Parameter
The Parameter instance to copy from.
Initializes a new instance of the Parameter class using the specified JSON object.
public Parameter(System.Text.Json.Nodes.JsonObject jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject that contains the initialization data.
Holds configuration options for POST operations, including delay and result request settings.
public class PostOptions : DiGi.Core.Classes.SerializableOptionsInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.Core.Classes.SerializableOptions → PostOptions
Initializes a new instance of the PostOptions class.
public PostOptions();Initializes a new instance of the PostOptions class by copying from another instance.
public PostOptions(DiGi.WebAPI.Classes.PostOptions? postOptions);postOptions PostOptions
The PostOptions to copy from.
Initializes a new instance of the PostOptions class from a JSON object.
public PostOptions(System.Text.Json.Nodes.JsonObject jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object to deserialize from.
Gets or sets the delay duration for the POST operation.
public System.TimeSpan Delay { get; set; }Gets or sets a value indicating whether the response result should be requested.
public bool RequestResult { get; set; }Represents a non-generic POST response with a boolean result.
public class PostResponse : DiGi.WebAPI.Classes.PostResponse<bool>Inheritance System.Object → DiGi.WebAPI.Classes.PostResponse<System.Boolean> → PostResponse
Initializes a new instance of the PostResponse class.
public PostResponse(bool succeeded);succeeded System.Boolean
Whether the operation succeeded.
Represents the response from a POST operation, containing the result, success status, and whether a result was requested.
public class PostResponse<T>T
The type of the result contained in the response.
Inheritance System.Object → PostResponse<T>
Derived
↳ PostResponse
Initializes a new instance of the PostResponse<T> class.
public PostResponse(bool succeeded);succeeded System.Boolean
Whether the operation succeeded.
Initializes a new instance of the PostResponse<T> class.
public PostResponse(bool succeeded, bool resultRequested, T? result=default(T?));succeeded System.Boolean
Whether the operation succeeded.
resultRequested System.Boolean
Whether a result was requested.
result T
The result of the operation.
Gets the result of the POST operation.
public T? Result { get; }Gets a value indicating whether a result was requested from the POST operation.
public bool ResultRequested { get; }Gets a value indicating whether the POST operation succeeded.
public bool Succeeded { get; }Represents a security key with a unique identifier and creation timestamp.
public sealed class SecurityKey : DiGi.Core.Classes.GuidObject, DiGi.WebAPI.Interfaces.IWebAPIGuidObject, DiGi.Core.Interfaces.IGuidObject, DiGi.Core.Interfaces.IUniqueObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject, DiGi.WebAPI.Interfaces.IWebAPISerializableObject, DiGi.WebAPI.Interfaces.IWebAPIObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.Core.Classes.UniqueObject → DiGi.Core.Classes.GuidObject → SecurityKey
Implements IWebAPIGuidObject, DiGi.Core.Interfaces.IGuidObject, DiGi.Core.Interfaces.IUniqueObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject, IWebAPISerializableObject, IWebAPIObject
Initializes a new instance of the SecurityKey class with a randomly generated key.
public SecurityKey();Initializes a new instance of the SecurityKey class by copying from another instance.
public SecurityKey(DiGi.WebAPI.Classes.SecurityKey? securityKey);securityKey SecurityKey
The SecurityKey to copy from.
Initializes a new instance of the SecurityKey class with the specified key value.
public SecurityKey(string? key);key System.String
The key value to use.
Initializes a new instance of the SecurityKey class from a JSON object.
public SecurityKey(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object to deserialize from.
Gets the UTC date and time when the key was created.
public System.DateTime CreatedAt { get; private set; }Gets the key value as a string.
public string Key { get; private set; }Converts the key to a byte array using ASCII encoding.
public byte[] GetBytes();System.Byte[]
A byte array representation of the key.
Manages a collection of SecurityKey instances, including generation, retrieval, and removal of keys.
public sealed class SecurityKeyManager : DiGi.Core.Classes.SerializableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → SecurityKeyManager
Initializes a new instance of the SecurityKeyManager class.
public SecurityKeyManager();Initializes a new instance of the SecurityKeyManager class by copying from another instance.
public SecurityKeyManager(DiGi.WebAPI.Classes.SecurityKeyManager securityKeyManager);securityKeyManager SecurityKeyManager
The SecurityKeyManager to copy from.
Initializes a new instance of the SecurityKeyManager class from a JSON object.
public SecurityKeyManager(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object to deserialize from.
Stores the security keys indexed by their GUID.
private Dictionary<Guid,SecurityKey> securityKeys;System.Collections.Generic.Dictionary<System.Guid,SecurityKey>
Gets or sets the collection of security keys.
public System.Collections.Generic.IEnumerable<DiGi.WebAPI.Classes.SecurityKey> SecurityKeys { get; set; }System.Collections.Generic.IEnumerable<SecurityKey>
Adds a SecurityKey to the manager.
public bool Add(DiGi.WebAPI.Classes.SecurityKey? securityKey);securityKey SecurityKey
The security key to add.
System.Boolean
true if the key was added successfully; otherwise, false.
Generates a new unique SecurityKey and adds it to the manager.
public DiGi.WebAPI.Classes.SecurityKey Generate();SecurityKey
The newly generated SecurityKey.
Gets the most recently created active security key.
public DiGi.WebAPI.Classes.SecurityKey? GetActive(bool generate=true);generate System.Boolean
Whether to generate a new key if none exist.
SecurityKey
The most recent SecurityKey, or null if no keys exist and generate is false.
Removes a security key by its GUID.
public bool Remove(System.Guid guid);guid System.Guid
The GUID of the security key to remove.
System.Boolean
true if the key was found and removed; otherwise, false.
Provides a fluent API for constructing URLs with query parameters and automatic encoding.
public class UrlBuilderInheritance System.Object → UrlBuilder
Initializes a new instance of the UrlBuilder class with the specified base URL.
public UrlBuilder(string url);url System.String
The base URL to build upon.
Stores the query parameters to be appended to the URL.
private readonly Dictionary<string,string> dictionary;System.Collections.Generic.Dictionary<System.String,System.String>
The base URL before query parameters are added.
private readonly string url;Gets the names of all query parameters currently added to the URL.
public System.Collections.Generic.IEnumerable<string> ParameterNames { get; }System.Collections.Generic.IEnumerable<System.String>
Adds a boolean query parameter with automatic URL encoding.
public DiGi.WebAPI.Classes.UrlBuilder AddParameter(string name, bool value);name System.String
The parameter name.
value System.Boolean
The boolean value to encode.
UrlBuilder
The UrlBuilder instance for chaining.
Adds a double query parameter with automatic URL encoding.
public DiGi.WebAPI.Classes.UrlBuilder AddParameter(string name, double value);name System.String
The parameter name.
value System.Double
The double value to encode.
UrlBuilder
The UrlBuilder instance for chaining.
Adds an integer query parameter with automatic URL encoding.
public DiGi.WebAPI.Classes.UrlBuilder AddParameter(string name, int value);name System.String
The parameter name.
value System.Int32
The integer value to encode.
UrlBuilder
The UrlBuilder instance for chaining.
Adds a query parameter with automatic URL encoding.
public DiGi.WebAPI.Classes.UrlBuilder AddParameter(string name, string? value);name System.String
The name of the query parameter.
value System.String
The value of the query parameter.
UrlBuilder
The current UrlBuilder instance.
Builds the final URL string.
public string Build();System.String
The built URL string with query parameters.
Returns the built URL as a string.
public override string ToString();System.String
The complete URL with query parameters.
Attempts to retrieve and convert a query parameter value to the specified type.
public bool TryGetValue<T>(string parameterName, out T? value);T
The type to convert the parameter value to.
parameterName System.String
The name of the query parameter to retrieve.
value T
When this method returns, contains the converted value if found, or default(T) if not found.
System.Boolean
true if the parameter exists and was successfully converted; otherwise, false.
Converts the UrlBuilder to its string representation.
public static string? implicit operator string?(DiGi.WebAPI.Classes.UrlBuilder? urlBuilder);urlBuilder UrlBuilder
The UrlBuilder instance to convert.
System.String
The built URL string, or null if the builder is null.
Serves as the base class for all WebAPI controllers, providing common MVC and API functionality.
public abstract class WebAPIController : Microsoft.AspNetCore.Mvc.ControllerBase, DiGi.WebAPI.Interfaces.IWebAPIController, DiGi.WebAPI.Interfaces.IWebAPIObject, DiGi.Core.Interfaces.IObjectInheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → WebAPIController
Derived
↳ InformationController
Implements IWebAPIController, IWebAPIObject, DiGi.Core.Interfaces.IObject