mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-23 02:34:55 +01:00
* #630 Allow removal of prefix when proxying to another server * #630 Rename replace to replace settings and ensure properties used in place of fields * #630 Update replace settings type name to ProxyUrlReplaceSettings * #630 Add admin model and update settings parser to parse new values * Fix formatting issues * #630 Ensure json mapping between admin model and internal model takes place * #630 Refactor parsing and structure of extracting new proxy url * Reduce function complexity * #630 Fix line length issues and remove try prefix from parser methods
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using Nelibur.ObjectMapper;
|
|
using WireMock.Admin.Settings;
|
|
using WireMock.Settings;
|
|
|
|
namespace WireMock.Util;
|
|
|
|
internal sealed class TinyMapperUtils
|
|
{
|
|
public static TinyMapperUtils Instance { get; } = new();
|
|
|
|
private TinyMapperUtils()
|
|
{
|
|
TinyMapper.Bind<ProxyAndRecordSettings, ProxyAndRecordSettingsModel>();
|
|
TinyMapper.Bind<WebProxySettings, WebProxySettingsModel>();
|
|
TinyMapper.Bind<ProxyUrlReplaceSettings, ProxyUrlReplaceSettingsModel>();
|
|
|
|
TinyMapper.Bind<ProxyAndRecordSettingsModel, ProxyAndRecordSettings>();
|
|
TinyMapper.Bind<WebProxySettingsModel, WebProxySettings>();
|
|
TinyMapper.Bind<ProxyUrlReplaceSettingsModel, ProxyUrlReplaceSettings>();
|
|
}
|
|
|
|
public ProxyAndRecordSettingsModel? Map(ProxyAndRecordSettings? instance)
|
|
{
|
|
return instance == null ? null : TinyMapper.Map<ProxyAndRecordSettingsModel>(instance);
|
|
}
|
|
|
|
public ProxyAndRecordSettings? Map(ProxyAndRecordSettingsModel? model)
|
|
{
|
|
return model == null ? null : TinyMapper.Map<ProxyAndRecordSettings>(model);
|
|
}
|
|
} |