mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-21 16:01:18 +02:00
FixMapping[] for WireMock.Org REST API (#1023)
This commit is contained in:
@@ -10,7 +10,7 @@ using WireMock.RequestBuilders;
|
|||||||
using WireMock.ResponseBuilders;
|
using WireMock.ResponseBuilders;
|
||||||
using WireMock.Util;
|
using WireMock.Util;
|
||||||
using Stef.Validation;
|
using Stef.Validation;
|
||||||
using OrgMappings = WireMock.Org.Abstractions.Mappings;
|
using OrgMapping = WireMock.Org.Abstractions.Mapping;
|
||||||
|
|
||||||
namespace WireMock.Server;
|
namespace WireMock.Server;
|
||||||
|
|
||||||
@@ -25,14 +25,14 @@ public partial class WireMockServer
|
|||||||
{
|
{
|
||||||
Guard.NotNull(path, nameof(path));
|
Guard.NotNull(path, nameof(path));
|
||||||
|
|
||||||
string filenameWithoutExtension = Path.GetFileNameWithoutExtension(path);
|
var filenameWithoutExtension = Path.GetFileNameWithoutExtension(path);
|
||||||
|
|
||||||
if (FileHelper.TryReadMappingFileWithRetryAndDelay(_settings.FileSystemHandler, path, out var value))
|
if (FileHelper.TryReadMappingFileWithRetryAndDelay(_settings.FileSystemHandler, path, out var value))
|
||||||
{
|
{
|
||||||
var mappings = DeserializeJsonToArray<OrgMappings>(value);
|
var mappings = DeserializeJsonToArray<OrgMapping>(value);
|
||||||
foreach (var mapping in mappings)
|
foreach (var mapping in mappings)
|
||||||
{
|
{
|
||||||
if (mappings.Length == 1 && Guid.TryParse(filenameWithoutExtension, out Guid guidFromFilename))
|
if (mappings.Length == 1 && Guid.TryParse(filenameWithoutExtension, out var guidFromFilename))
|
||||||
{
|
{
|
||||||
ConvertWireMockOrgMappingAndRegisterAsRespondProvider(mapping, guidFromFilename, path);
|
ConvertWireMockOrgMappingAndRegisterAsRespondProvider(mapping, guidFromFilename, path);
|
||||||
}
|
}
|
||||||
@@ -48,10 +48,10 @@ public partial class WireMockServer
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var mappingModels = DeserializeRequestMessageToArray<OrgMappings>(requestMessage);
|
var mappingModels = DeserializeRequestMessageToArray<OrgMapping>(requestMessage);
|
||||||
if (mappingModels.Length == 1)
|
if (mappingModels.Length == 1)
|
||||||
{
|
{
|
||||||
Guid? guid = ConvertWireMockOrgMappingAndRegisterAsRespondProvider(mappingModels[0]);
|
var guid = ConvertWireMockOrgMappingAndRegisterAsRespondProvider(mappingModels[0]);
|
||||||
return ResponseMessageBuilder.Create(201, "Mapping added", guid);
|
return ResponseMessageBuilder.Create(201, "Mapping added", guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public partial class WireMockServer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Guid? ConvertWireMockOrgMappingAndRegisterAsRespondProvider(OrgMappings mapping, Guid? guid = null, string? path = null)
|
private Guid? ConvertWireMockOrgMappingAndRegisterAsRespondProvider(Org.Abstractions.Mapping mapping, Guid? guid = null, string? path = null)
|
||||||
{
|
{
|
||||||
var requestBuilder = Request.Create();
|
var requestBuilder = Request.Create();
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ public partial class WireMockServer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IResponseBuilder responseBuilder = Response.Create();
|
var responseBuilder = Response.Create();
|
||||||
|
|
||||||
var response = mapping.Response;
|
var response = mapping.Response;
|
||||||
if (response != null)
|
if (response != null)
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
namespace WireMock.Org.Abstractions
|
namespace WireMock.Org.Abstractions;
|
||||||
{
|
|
||||||
public class GetAdminMappingsResult
|
|
||||||
{
|
|
||||||
public Mappings Mappings { get; set; }
|
|
||||||
|
|
||||||
public Meta Meta { get; set; }
|
public class GetAdminMappingsResult
|
||||||
}
|
{
|
||||||
|
public Mapping[] Mappings { get; set; }
|
||||||
|
|
||||||
|
public Meta Meta { get; set; }
|
||||||
}
|
}
|
||||||
58
src/WireMock.Org.Abstractions/Mapping.cs
Normal file
58
src/WireMock.Org.Abstractions/Mapping.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
namespace WireMock.Org.Abstractions;
|
||||||
|
|
||||||
|
public class Mapping
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This stub mapping's unique identifier
|
||||||
|
/// </summary>
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Alias for the id
|
||||||
|
/// </summary>
|
||||||
|
public string Uuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The stub mapping's name
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public MappingsRequest Request { get; set; }
|
||||||
|
|
||||||
|
public MappingsResponse Response { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.
|
||||||
|
/// </summary>
|
||||||
|
public bool Persistent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This stub mapping's priority relative to others. 1 is highest.
|
||||||
|
/// </summary>
|
||||||
|
public int Priority { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The name of the scenario that this stub mapping is part of
|
||||||
|
/// </summary>
|
||||||
|
public string ScenarioName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The required state of the scenario in order for this stub to be matched.
|
||||||
|
/// </summary>
|
||||||
|
public string RequiredScenarioState { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The new state for the scenario to be updated to after this stub is served.
|
||||||
|
/// </summary>
|
||||||
|
public string NewScenarioState { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A map of the names of post serve action extensions to trigger and their parameters.
|
||||||
|
/// </summary>
|
||||||
|
public object PostServeActions { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.
|
||||||
|
/// </summary>
|
||||||
|
public object Metadata { get; set; }
|
||||||
|
}
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
namespace WireMock.Org.Abstractions
|
|
||||||
{
|
|
||||||
public class Mappings
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// This stub mapping's unique identifier
|
|
||||||
/// </summary>
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Alias for the id
|
|
||||||
/// </summary>
|
|
||||||
public string Uuid { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The stub mapping's name
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
public MappingsRequest Request { get; set; }
|
|
||||||
|
|
||||||
public MappingsResponse Response { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.
|
|
||||||
/// </summary>
|
|
||||||
public bool Persistent { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This stub mapping's priority relative to others. 1 is highest.
|
|
||||||
/// </summary>
|
|
||||||
public int Priority { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The name of the scenario that this stub mapping is part of
|
|
||||||
/// </summary>
|
|
||||||
public string ScenarioName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The required state of the scenario in order for this stub to be matched.
|
|
||||||
/// </summary>
|
|
||||||
public string RequiredScenarioState { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The new state for the scenario to be updated to after this stub is served.
|
|
||||||
/// </summary>
|
|
||||||
public string NewScenarioState { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A map of the names of post serve action extensions to trigger and their parameters.
|
|
||||||
/// </summary>
|
|
||||||
public object PostServeActions { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.
|
|
||||||
/// </summary>
|
|
||||||
public object Metadata { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
namespace WireMock.Org.Abstractions
|
namespace WireMock.Org.Abstractions;
|
||||||
{
|
|
||||||
public class PostAdminMappingsFindByMetadataResult
|
|
||||||
{
|
|
||||||
public Mappings Mappings { get; set; }
|
|
||||||
|
|
||||||
public Meta Meta { get; set; }
|
public class PostAdminMappingsFindByMetadataResult
|
||||||
}
|
{
|
||||||
|
public Mapping[] Mappings { get; set; }
|
||||||
|
|
||||||
|
public Meta Meta { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
namespace WireMock.Org.Abstractions
|
namespace WireMock.Org.Abstractions;
|
||||||
{
|
|
||||||
public class PostAdminRecordingsSnapshotResult
|
|
||||||
{
|
|
||||||
public Mappings Mappings { get; set; }
|
|
||||||
|
|
||||||
public Meta Meta { get; set; }
|
public class PostAdminRecordingsSnapshotResult
|
||||||
}
|
{
|
||||||
|
public Mapping[] Mappings { get; set; }
|
||||||
|
|
||||||
|
public Meta Meta { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
namespace WireMock.Org.Abstractions
|
namespace WireMock.Org.Abstractions;
|
||||||
{
|
|
||||||
public class PostAdminRecordingsStopResult
|
|
||||||
{
|
|
||||||
public Mappings Mappings { get; set; }
|
|
||||||
|
|
||||||
public Meta Meta { get; set; }
|
public class PostAdminRecordingsStopResult
|
||||||
}
|
{
|
||||||
|
public Mapping[] Mappings { get; set; }
|
||||||
|
|
||||||
|
public Meta Meta { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,299 +1,293 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AnyOfTypes;
|
using AnyOfTypes;
|
||||||
using RestEase;
|
using RestEase;
|
||||||
using WireMock.Org.Abstractions;
|
using WireMock.Org.Abstractions;
|
||||||
|
|
||||||
namespace WireMock.Org.RestClient
|
namespace WireMock.Org.RestClient;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Summary: WireMockOrg
|
||||||
|
///
|
||||||
|
/// Title : WireMock
|
||||||
|
/// Version: 2.3x
|
||||||
|
/// </summary>
|
||||||
|
public interface IWireMockOrgApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary: WireMockOrg
|
/// Get all stub mappings
|
||||||
///
|
///
|
||||||
/// Title : WireMock
|
/// GetAdminMappings (/__admin/mappings)
|
||||||
/// Version: 2.33.2
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IWireMockOrgApi
|
/// <param name="limit">The maximum number of results to return</param>
|
||||||
{
|
/// <param name="offset">The start index of the results to return</param>
|
||||||
/// <summary>
|
[Get("/__admin/mappings")]
|
||||||
/// Get all stub mappings
|
Task<GetAdminMappingsResult> GetAdminMappingsAsync([Query] int? limit, [Query] int? offset);
|
||||||
///
|
|
||||||
/// GetAdminMappings (/__admin/mappings)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="limit">The maximum number of results to return</param>
|
|
||||||
/// <param name="offset">The start index of the results to return</param>
|
|
||||||
[Get("/__admin/mappings")]
|
|
||||||
Task<GetAdminMappingsResult> GetAdminMappingsAsync([Query] int? limit, [Query] int? offset);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new stub mapping
|
/// Create a new stub mapping
|
||||||
///
|
///
|
||||||
/// PostAdminMappings (/__admin/mappings)
|
/// PostAdminMappings (/__admin/mappings)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/mappings")]
|
[Post("/__admin/mappings")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<PostAdminMappingsResult> PostAdminMappingsAsync();
|
Task<PostAdminMappingsResult> PostAdminMappingsAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete all stub mappings
|
/// Delete all stub mappings
|
||||||
///
|
///
|
||||||
/// DeleteAdminMappings (/__admin/mappings)
|
/// DeleteAdminMappings (/__admin/mappings)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Delete("/__admin/mappings")]
|
[Delete("/__admin/mappings")]
|
||||||
Task<object> DeleteAdminMappingsAsync();
|
Task<object> DeleteAdminMappingsAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reset stub mappings
|
/// Reset stub mappings
|
||||||
///
|
///
|
||||||
/// PostAdminMappingsReset (/__admin/mappings/reset)
|
/// PostAdminMappingsReset (/__admin/mappings/reset)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/mappings/reset")]
|
[Post("/__admin/mappings/reset")]
|
||||||
Task<object> PostAdminMappingsResetAsync();
|
Task<object> PostAdminMappingsResetAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Persist stub mappings
|
/// Persist stub mappings
|
||||||
///
|
///
|
||||||
/// PostAdminMappingsSave (/__admin/mappings/save)
|
/// PostAdminMappingsSave (/__admin/mappings/save)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/mappings/save")]
|
[Post("/__admin/mappings/save")]
|
||||||
Task<object> PostAdminMappingsSaveAsync();
|
Task<object> PostAdminMappingsSaveAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get stub mapping by ID
|
/// Get stub mapping by ID
|
||||||
///
|
///
|
||||||
/// GetAdminMappingsByStubMappingId (/__admin/mappings/{stubMappingId})
|
/// GetAdminMappingsByStubMappingId (/__admin/mappings/{stubMappingId})
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stubMappingId">The UUID of stub mapping</param>
|
/// <param name="stubMappingId">The UUID of stub mapping</param>
|
||||||
[Get("/__admin/mappings/{stubMappingId}")]
|
[Get("/__admin/mappings/{stubMappingId}")]
|
||||||
Task<Response<AnyOf<GetAdminMappingsByStubMappingIdResult, object>>> GetAdminMappingsByStubMappingIdAsync([Path] string stubMappingId);
|
Task<Response<AnyOf<GetAdminMappingsByStubMappingIdResult, object>>> GetAdminMappingsByStubMappingIdAsync([Path] string stubMappingId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update a stub mapping
|
/// Update a stub mapping
|
||||||
///
|
///
|
||||||
/// PutAdminMappingsByStubMappingId (/__admin/mappings/{stubMappingId})
|
/// PutAdminMappingsByStubMappingId (/__admin/mappings/{stubMappingId})
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stubMappingId">The UUID of stub mapping</param>
|
/// <param name="stubMappingId">The UUID of stub mapping</param>
|
||||||
[Put("/__admin/mappings/{stubMappingId}")]
|
[Put("/__admin/mappings/{stubMappingId}")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<Response<AnyOf<PutAdminMappingsByStubMappingIdResult, object>>> PutAdminMappingsByStubMappingIdAsync([Path] string stubMappingId);
|
Task<Response<AnyOf<PutAdminMappingsByStubMappingIdResult, object>>> PutAdminMappingsByStubMappingIdAsync([Path] string stubMappingId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete a stub mapping
|
/// Delete a stub mapping
|
||||||
///
|
///
|
||||||
/// DeleteAdminMappingsByStubMappingId (/__admin/mappings/{stubMappingId})
|
/// DeleteAdminMappingsByStubMappingId (/__admin/mappings/{stubMappingId})
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stubMappingId">The UUID of stub mapping</param>
|
/// <param name="stubMappingId">The UUID of stub mapping</param>
|
||||||
[Delete("/__admin/mappings/{stubMappingId}")]
|
[Delete("/__admin/mappings/{stubMappingId}")]
|
||||||
Task<object> DeleteAdminMappingsByStubMappingIdAsync([Path] string stubMappingId);
|
Task<object> DeleteAdminMappingsByStubMappingIdAsync([Path] string stubMappingId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find stubs by matching on their metadata
|
/// Find stubs by matching on their metadata
|
||||||
///
|
///
|
||||||
/// PostAdminMappingsFindByMetadata (/__admin/mappings/find-by-metadata)
|
/// PostAdminMappingsFindByMetadata (/__admin/mappings/find-by-metadata)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/mappings/find-by-metadata")]
|
[Post("/__admin/mappings/find-by-metadata")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<PostAdminMappingsFindByMetadataResult> PostAdminMappingsFindByMetadataAsync();
|
Task<PostAdminMappingsFindByMetadataResult> PostAdminMappingsFindByMetadataAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete stub mappings matching metadata
|
/// Delete stub mappings matching metadata
|
||||||
///
|
///
|
||||||
/// PostAdminMappingsRemoveByMetadata (/__admin/mappings/remove-by-metadata)
|
/// PostAdminMappingsRemoveByMetadata (/__admin/mappings/remove-by-metadata)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/mappings/remove-by-metadata")]
|
[Post("/__admin/mappings/remove-by-metadata")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<object> PostAdminMappingsRemoveByMetadataAsync();
|
Task<object> PostAdminMappingsRemoveByMetadataAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all requests in journal
|
/// Get all requests in journal
|
||||||
///
|
///
|
||||||
/// GetAdminRequests (/__admin/requests)
|
/// GetAdminRequests (/__admin/requests)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="limit">The maximum number of results to return</param>
|
/// <param name="limit">The maximum number of results to return</param>
|
||||||
/// <param name="since">Only return logged requests after this date</param>
|
/// <param name="since">Only return logged requests after this date</param>
|
||||||
[Get("/__admin/requests")]
|
[Get("/__admin/requests")]
|
||||||
Task<object> GetAdminRequestsAsync([Query] string limit, [Query] string since);
|
Task<object> GetAdminRequestsAsync([Query] string limit, [Query] string since);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete all requests in journal
|
/// Delete all requests in journal
|
||||||
///
|
///
|
||||||
/// DeleteAdminRequests (/__admin/requests)
|
/// DeleteAdminRequests (/__admin/requests)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Delete("/__admin/requests")]
|
[Delete("/__admin/requests")]
|
||||||
Task<object> DeleteAdminRequestsAsync();
|
Task<object> DeleteAdminRequestsAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get request by ID
|
/// Get request by ID
|
||||||
///
|
///
|
||||||
/// GetAdminRequestsByRequestId (/__admin/requests/{requestId})
|
/// GetAdminRequestsByRequestId (/__admin/requests/{requestId})
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="requestId">The UUID of the logged request</param>
|
/// <param name="requestId">The UUID of the logged request</param>
|
||||||
[Get("/__admin/requests/{requestId}")]
|
[Get("/__admin/requests/{requestId}")]
|
||||||
Task<object> GetAdminRequestsByRequestIdAsync([Path] string requestId);
|
Task<object> GetAdminRequestsByRequestIdAsync([Path] string requestId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete request by ID
|
/// Delete request by ID
|
||||||
///
|
///
|
||||||
/// DeleteAdminRequestsByRequestId (/__admin/requests/{requestId})
|
/// DeleteAdminRequestsByRequestId (/__admin/requests/{requestId})
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="requestId">The UUID of the logged request</param>
|
/// <param name="requestId">The UUID of the logged request</param>
|
||||||
[Delete("/__admin/requests/{requestId}")]
|
[Delete("/__admin/requests/{requestId}")]
|
||||||
Task<object> DeleteAdminRequestsByRequestIdAsync([Path] string requestId);
|
Task<object> DeleteAdminRequestsByRequestIdAsync([Path] string requestId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Empty the request journal
|
/// Empty the request journal
|
||||||
///
|
///
|
||||||
/// PostAdminRequestsReset (/__admin/requests/reset)
|
/// PostAdminRequestsReset (/__admin/requests/reset)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/requests/reset")]
|
[Post("/__admin/requests/reset")]
|
||||||
Task<object> PostAdminRequestsResetAsync();
|
Task<object> PostAdminRequestsResetAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Count requests by criteria
|
/// Count requests by criteria
|
||||||
///
|
///
|
||||||
/// PostAdminRequestsCount (/__admin/requests/count)
|
/// PostAdminRequestsCount (/__admin/requests/count)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/requests/count")]
|
[Post("/__admin/requests/count")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<PostAdminRequestsCountResult> PostAdminRequestsCountAsync();
|
Task<PostAdminRequestsCountResult> PostAdminRequestsCountAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove requests by criteria
|
/// Remove requests by criteria
|
||||||
///
|
///
|
||||||
/// PostAdminRequestsRemove (/__admin/requests/remove)
|
/// PostAdminRequestsRemove (/__admin/requests/remove)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/requests/remove")]
|
[Post("/__admin/requests/remove")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<object> PostAdminRequestsRemoveAsync();
|
Task<object> PostAdminRequestsRemoveAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete requests mappings matching metadata
|
/// Delete requests mappings matching metadata
|
||||||
///
|
///
|
||||||
/// PostAdminRequestsRemoveByMetadata (/__admin/requests/remove-by-metadata)
|
/// PostAdminRequestsRemoveByMetadata (/__admin/requests/remove-by-metadata)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/requests/remove-by-metadata")]
|
[Post("/__admin/requests/remove-by-metadata")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<object> PostAdminRequestsRemoveByMetadataAsync();
|
Task<object> PostAdminRequestsRemoveByMetadataAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find requests by criteria
|
/// Find requests by criteria
|
||||||
///
|
///
|
||||||
/// PostAdminRequestsFind (/__admin/requests/find)
|
/// PostAdminRequestsFind (/__admin/requests/find)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/requests/find")]
|
[Post("/__admin/requests/find")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<object> PostAdminRequestsFindAsync();
|
Task<object> PostAdminRequestsFindAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find unmatched requests
|
/// Find unmatched requests
|
||||||
///
|
///
|
||||||
/// GetAdminRequestsUnmatched (/__admin/requests/unmatched)
|
/// GetAdminRequestsUnmatched (/__admin/requests/unmatched)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Get("/__admin/requests/unmatched")]
|
[Get("/__admin/requests/unmatched")]
|
||||||
Task<object> GetAdminRequestsUnmatchedAsync();
|
Task<object> GetAdminRequestsUnmatchedAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve near-misses for all unmatched requests
|
/// Retrieve near-misses for all unmatched requests
|
||||||
///
|
///
|
||||||
/// GetAdminRequestsUnmatchedNearMisses (/__admin/requests/unmatched/near-misses)
|
/// GetAdminRequestsUnmatchedNearMisses (/__admin/requests/unmatched/near-misses)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Get("/__admin/requests/unmatched/near-misses")]
|
[Get("/__admin/requests/unmatched/near-misses")]
|
||||||
Task<GetAdminRequestsUnmatchedNearMissesResult> GetAdminRequestsUnmatchedNearMissesAsync();
|
Task<GetAdminRequestsUnmatchedNearMissesResult> GetAdminRequestsUnmatchedNearMissesAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find near misses matching specific request
|
/// Find near misses matching specific request
|
||||||
///
|
///
|
||||||
/// PostAdminNearMissesRequest (/__admin/near-misses/request)
|
/// PostAdminNearMissesRequest (/__admin/near-misses/request)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/near-misses/request")]
|
[Post("/__admin/near-misses/request")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<PostAdminNearMissesRequestResult> PostAdminNearMissesRequestAsync();
|
Task<PostAdminNearMissesRequestResult> PostAdminNearMissesRequestAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find near misses matching request pattern
|
/// Find near misses matching request pattern
|
||||||
///
|
///
|
||||||
/// PostAdminNearMissesRequestPattern (/__admin/near-misses/request-pattern)
|
/// PostAdminNearMissesRequestPattern (/__admin/near-misses/request-pattern)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/near-misses/request-pattern")]
|
[Post("/__admin/near-misses/request-pattern")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<PostAdminNearMissesRequestPatternResult> PostAdminNearMissesRequestPatternAsync();
|
Task<PostAdminNearMissesRequestPatternResult> PostAdminNearMissesRequestPatternAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start recording
|
/// Start recording
|
||||||
///
|
///
|
||||||
/// PostAdminRecordingsStart (/__admin/recordings/start)
|
/// PostAdminRecordingsStart (/__admin/recordings/start)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/recordings/start")]
|
[Post("/__admin/recordings/start")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<object> PostAdminRecordingsStartAsync();
|
Task<object> PostAdminRecordingsStartAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop recording
|
/// Stop recording
|
||||||
///
|
///
|
||||||
/// PostAdminRecordingsStop (/__admin/recordings/stop)
|
/// PostAdminRecordingsStop (/__admin/recordings/stop)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/recordings/stop")]
|
[Post("/__admin/recordings/stop")]
|
||||||
Task<PostAdminRecordingsStopResult> PostAdminRecordingsStopAsync();
|
Task<PostAdminRecordingsStopResult> PostAdminRecordingsStopAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get recording status
|
/// Get recording status
|
||||||
///
|
///
|
||||||
/// GetAdminRecordingsStatus (/__admin/recordings/status)
|
/// GetAdminRecordingsStatus (/__admin/recordings/status)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Get("/__admin/recordings/status")]
|
[Get("/__admin/recordings/status")]
|
||||||
Task<GetAdminRecordingsStatusResult> GetAdminRecordingsStatusAsync();
|
Task<GetAdminRecordingsStatusResult> GetAdminRecordingsStatusAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Take a snapshot recording
|
/// Take a snapshot recording
|
||||||
///
|
///
|
||||||
/// PostAdminRecordingsSnapshot (/__admin/recordings/snapshot)
|
/// PostAdminRecordingsSnapshot (/__admin/recordings/snapshot)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/recordings/snapshot")]
|
[Post("/__admin/recordings/snapshot")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<PostAdminRecordingsSnapshotResult> PostAdminRecordingsSnapshotAsync();
|
Task<PostAdminRecordingsSnapshotResult> PostAdminRecordingsSnapshotAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all scenarios
|
/// Get all scenarios
|
||||||
///
|
///
|
||||||
/// GetAdminScenarios (/__admin/scenarios)
|
/// GetAdminScenarios (/__admin/scenarios)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Get("/__admin/scenarios")]
|
[Get("/__admin/scenarios")]
|
||||||
Task<GetAdminScenariosResult> GetAdminScenariosAsync();
|
Task<GetAdminScenariosResult> GetAdminScenariosAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reset the state of all scenarios
|
/// Reset the state of all scenarios
|
||||||
///
|
///
|
||||||
/// PostAdminScenariosReset (/__admin/scenarios/reset)
|
/// PostAdminScenariosReset (/__admin/scenarios/reset)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/scenarios/reset")]
|
[Post("/__admin/scenarios/reset")]
|
||||||
Task<object> PostAdminScenariosResetAsync();
|
Task<object> PostAdminScenariosResetAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update global settings
|
/// Update global settings
|
||||||
///
|
///
|
||||||
/// PostAdminSettings (/__admin/settings)
|
/// PostAdminSettings (/__admin/settings)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/settings")]
|
[Post("/__admin/settings")]
|
||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<object> PostAdminSettingsAsync();
|
Task<object> PostAdminSettingsAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reset mappings and request journal
|
/// Reset mappings and request journal
|
||||||
///
|
///
|
||||||
/// PostAdminReset (/__admin/reset)
|
/// PostAdminReset (/__admin/reset)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/reset")]
|
[Post("/__admin/reset")]
|
||||||
Task<object> PostAdminResetAsync();
|
Task<object> PostAdminResetAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shutdown the WireMock server
|
/// Shutdown the WireMock server
|
||||||
///
|
///
|
||||||
/// PostAdminShutdown (/__admin/shutdown)
|
/// PostAdminShutdown (/__admin/shutdown)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Post("/__admin/shutdown")]
|
[Post("/__admin/shutdown")]
|
||||||
Task<object> PostAdminShutdownAsync();
|
Task<object> PostAdminShutdownAsync();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user