| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using System;
- using System.Collections.Generic;
- using System.Text.Json.Serialization;
- using BO.ProcessServer.Business.Enums;
- namespace BO.ProcessServer.Options
- {
- internal class Configuration
- {
- [JsonPropertyName("api-base-url")] public Uri ApiBaseUrl { get; set; }
- [JsonPropertyName("api-user")] public string ApiUser { get; set; }
- [JsonPropertyName("api-pwd")] public string ApiUserPwd { get; set; }
- [JsonPropertyName("api-magic")] public string ApiMagic { get; set; }
- [JsonPropertyName("api-timeout")] public string ApiTimeoutRaw { get; set; }
- public TimeSpan ApiTimeout => TimeSpan.Parse(ApiTimeoutRaw);
- public CfgSystem System { get; set; }
- public class CfgSystem
- {
- [JsonPropertyName("mode")] public AppModeEnum Mode { get; set; }
- [JsonPropertyName("identification")] public string Identification { get; set; }
- [JsonPropertyName("preferred-interface")] public string PreferredInterface { get; set; }
- [JsonPropertyName("pool-pull-documents")] public int PoolPullDocuments { get; set; }
- [JsonPropertyName("pool-pull-interval")] public string PoolPullIntervalRaw { get; set; }
- public TimeSpan PoolPullInterval => TimeSpan.Parse(PoolPullIntervalRaw);
- [JsonPropertyName("pool-path-base")] public string PoolPathBase { get; set; }
- [JsonPropertyName("pool-path-pending")] public string PoolPathPending { get; set; }
- [JsonPropertyName("pool-path-working")] public string PoolPathWorking { get; set; }
- [JsonPropertyName("pool-path-done")] public string PoolPathDone { get; set; }
- [JsonPropertyName("pool-path-fail")] public string PoolPathFail { get; set; }
- [JsonPropertyName("pool-retention")] public CfgPoolRetention Retention { get; set; }
- [JsonPropertyName("status-monitoring")] public CfgStatusMonitoring Status { get; set; }
- [JsonPropertyName("scenario-path-base")] public string ScenarioPathBase { get; set; }
- [JsonPropertyName("scenario-parallels")] public int ScenarioParallelThreads { get; set; }
- [JsonPropertyName("scenarios")] public IEnumerable<CfgScenario> Scenarios { get; set; }
- }
- public class CfgScenarioAcceptFilter
- {
- [JsonPropertyName("code")] public string Code { get; set; }
- [JsonPropertyName("value")] public string Value { get; set; }
- }
- public class CfgScenario
- {
- [JsonPropertyName("name")] public string Name { get; set; }
- [JsonPropertyName("cmd")] public string ShellCommand { get; set; }
- [JsonPropertyName("args")] public string ShellCommandArguments { get; set; }
- [JsonPropertyName("accept-filters")] public IEnumerable<CfgScenarioAcceptFilter> AcceptFilters { get; set; }
- [JsonPropertyName("timeout-interval")] public string TimeoutIntervalRaw { get; set; }
- public TimeSpan TimeoutInterval => TimeSpan.Parse(TimeoutIntervalRaw);
- [JsonPropertyName("exitcode-succ")] public int ExitCodeSucc { get; set; }
- [JsonPropertyName("exitcode-fail")] public int ExitCodeFail { get; set; }
- }
- public class CfgStatusMonitoring
- {
- [JsonPropertyName("enabled")] public bool Enabled { get; set; }
- [JsonPropertyName("interval")] public string IntervalRaw { get; set; }
- public TimeSpan Interval => TimeSpan.Parse(IntervalRaw);
- [JsonPropertyName("file")] public string File { get; set; }
- }
- public class CfgPoolRetention
- {
- [JsonPropertyName("enabled")] public bool Enabled { get; set; }
- [JsonPropertyName("interval")] public string IntervalRaw { get; set; }
- public TimeSpan Interval => TimeSpan.Parse(IntervalRaw);
- [JsonPropertyName("size")] public long Size { get; set; }
- [JsonPropertyName("items")] public int Items { get; set; }
- }
- }
- }
|