mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 10:22:13 +01:00
* ProxyUrlTransformer * tests * Update src/WireMock.Net.Shared/Settings/ProxyUrlReplaceSettings.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
// Copyright © WireMock.Net
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using WireMock.Types;
|
|
|
|
namespace WireMock.Settings;
|
|
|
|
/// <summary>
|
|
/// Defines an old path param and a new path param to be replaced when proxying.
|
|
/// </summary>
|
|
public class ProxyUrlReplaceSettings
|
|
{
|
|
/// <summary>
|
|
/// The old path value to be replaced by the new path value.
|
|
/// </summary>
|
|
public string? OldValue { get; set; }
|
|
|
|
/// <summary>
|
|
/// The new path value to replace the old value with.
|
|
/// </summary>
|
|
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;
|
|
} |