2025-07-28 20:35:48 +04:00
|
|
|
using Microsoft.AspNetCore.Builder;
|
2025-08-02 02:32:38 +04:00
|
|
|
using Microsoft.Extensions.Options;
|
2025-07-29 05:14:57 +04:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2025-07-24 23:19:59 +04:00
|
|
|
|
|
|
|
|
namespace Telegrator.Hosting.Web
|
|
|
|
|
{
|
2025-07-28 20:35:48 +04:00
|
|
|
/// <summary>
|
2025-08-02 02:32:38 +04:00
|
|
|
/// Options for configuring the behavior for TelegramBotWebHost.
|
2025-07-28 20:35:48 +04:00
|
|
|
/// </summary>
|
|
|
|
|
public class TelegramBotWebOptions : TelegratorOptions
|
2025-07-24 23:19:59 +04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2025-08-02 02:32:38 +04:00
|
|
|
/// Disables automatic configuration for all of required <see cref="IOptions{TOptions}"/> instances
|
2025-07-24 23:19:59 +04:00
|
|
|
/// </summary>
|
2025-08-02 02:32:38 +04:00
|
|
|
public bool DisableAutoConfigure { get; set; }
|
2025-07-28 20:35:48 +04:00
|
|
|
|
|
|
|
|
/// <inheritdoc cref="WebApplicationOptions.Args"/>
|
|
|
|
|
public string[]? Args { get; init; }
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc cref="WebApplicationOptions.EnvironmentName"/>
|
|
|
|
|
public string? EnvironmentName { get; init; }
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc cref="WebApplicationOptions.ApplicationName"/>
|
|
|
|
|
public string? ApplicationName { get; init; }
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc cref="WebApplicationOptions.ContentRootPath"/>
|
|
|
|
|
public string? ContentRootPath { get; init; }
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc cref="WebApplicationOptions.WebRootPath"/>
|
|
|
|
|
public string? WebRootPath { get; init; }
|
|
|
|
|
|
|
|
|
|
internal WebApplicationOptions ToWebApplicationOptions() => new WebApplicationOptions()
|
|
|
|
|
{
|
|
|
|
|
ApplicationName = ApplicationName,
|
|
|
|
|
Args = Args,
|
|
|
|
|
ContentRootPath = ContentRootPath,
|
|
|
|
|
EnvironmentName = EnvironmentName,
|
|
|
|
|
WebRootPath = WebRootPath
|
|
|
|
|
};
|
2025-07-24 23:19:59 +04:00
|
|
|
}
|
|
|
|
|
}
|