This commit is contained in:
Stef
2025-10-05 15:19:18 +02:00
13 changed files with 205 additions and 81 deletions

View File

@@ -1,5 +1,8 @@
// Copyright © WireMock.Net
using System.Diagnostics.CodeAnalysis;
using WireMock.Types;
namespace WireMock.Settings;
/// <summary>
@@ -8,17 +11,35 @@ namespace WireMock.Settings;
public class ProxyUrlReplaceSettings
{
/// <summary>
/// The old path value to be replaced by the new path value
/// The old path value to be replaced by the new path value.
/// </summary>
public string OldValue { get; set; } = null!;
public string? OldValue { get; set; }
/// <summary>
/// The new path value to replace the old value with
/// The new path value to replace the old value with.
/// </summary>
public string NewValue { get; set; } = null!;
public string? NewValue { get; set; }
/// <summary>
/// Defines if the case should be ignored when replacing.
/// </summary>
public bool IgnoreCase { get; set; }
/// <summary>
/// Holds the transformation template used when <see cref="UseTransformer"/> is true.
/// </summary>
public string? TransformTemplate { get; set; }
/// <summary>
/// Use Transformer.
/// </summary>
[MemberNotNullWhen(true, nameof(TransformTemplate))]
[MemberNotNullWhen(false, nameof(OldValue))]
[MemberNotNullWhen(false, nameof(NewValue))]
public bool UseTransformer => !string.IsNullOrEmpty(TransformTemplate);
/// <summary>
/// The transformer type, in case <see cref="UseTransformer"/> is set to <c>true</c>.
/// </summary>
public TransformerType TransformerType { get; set; } = TransformerType.Handlebars;
}