using JetBrains.Annotations;
namespace WireMock.Settings;
///
/// ProxyAndRecordSettings
///
public class ProxyAndRecordSettings : HttpClientSettings
{
///
/// The URL to proxy.
///
[PublicAPI]
public string Url { get; set; } = null!;
///
/// Save the mapping for each request/response to the internal Mappings.
///
[PublicAPI]
public bool SaveMapping { get; set; }
///
/// Save the mapping for each request/response also to a file. (Note that SaveMapping must also be set to true.)
///
[PublicAPI]
public bool SaveMappingToFile { get; set; }
///
/// Only save request/response to the internal Mappings if the status code is included in this pattern. (Note that SaveMapping must also be set to true.)
/// The pattern can contain a single value like "200", but also ranges like "2xx", "100,300,600" or "100-299,6xx" are supported.
///
/// Deprecated : use SaveMappingSettings.
///
[PublicAPI]
public string SaveMappingForStatusCodePattern
{
set
{
if (SaveMappingSettings is null)
{
SaveMappingSettings = new ProxySaveMappingSettings();
}
SaveMappingSettings.StatusCodePattern = value;
}
}
///
/// Additional SaveMappingSettings.
///
[PublicAPI]
public ProxySaveMappingSettings? SaveMappingSettings { get; set; }
///
/// Defines a list from headers which will be excluded from the saved mappings.
///
[PublicAPI]
public string[]? ExcludedHeaders { get; set; }
///
/// Defines a list of cookies which will be excluded from the saved mappings.
///
[PublicAPI]
public string[]? ExcludedCookies { get; set; }
///
/// Prefer the Proxy Mapping over the saved Mapping (in case SaveMapping is set to true).
///
//[PublicAPI]
//public bool PreferProxyMapping { get; set; }
///
/// When SaveMapping is set to true, this setting can be used to control the behavior of the generated request matchers for the new mapping.
/// - false, the default matchers will be used.
/// - true, the defined mappings in the request wil be used for the new mapping.
///
/// Default value is false.
///
public bool UseDefinedRequestMatchers { get; set; }
///
/// Append an unique GUID to the filename from the saved mapping file.
///
public bool AppendGuidToSavedMappingFile { get; set; }
}