Update WireMock.Org.Abstractions and WireMock.Org.RestClient (#765)

* Update WireMock.Org.Abstractions and WireMock.Org.RestClient

* .

* rename
This commit is contained in:
Stef Heyenrath
2022-07-08 11:02:18 +02:00
committed by GitHub
parent 4d0f96eabe
commit b1032c9dcd
42 changed files with 862 additions and 6736 deletions

View File

@@ -0,0 +1,59 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminMappingsByStubMappingIdResult
{
/// <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 WireMockOrgRequest Request { get; set; }
public WireMockOrgResponse 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; }
}
}

View File

@@ -1,9 +0,0 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminMappingsResponse
{
public Mapping[] Mappings { get; set; }
public Meta Meta { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminMappingsResult
{
public Mappings Mappings { get; set; }
public Meta Meta { get; set; }
}
}

View File

@@ -1,7 +1,7 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminRecordingsStatusResponse
public class GetAdminRecordingsStatusResult
{
public string Status { get; set; }
}
}
}

View File

@@ -1,7 +0,0 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminRequestsUnmatchedNearMissesResponse
{
public NearMiss[] NearMisses { get; set; }
}
}

View File

@@ -0,0 +1,7 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminRequestsUnmatchedNearMissesResult
{
public NearMisses NearMisses { get; set; }
}
}

View File

@@ -1,7 +0,0 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminScenariosResponse
{
public Scenario[] Scenarios { get; set; }
}
}

View File

@@ -0,0 +1,7 @@
namespace WireMock.Org.Abstractions
{
public class GetAdminScenariosResult
{
public Scenarios Scenarios { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace WireMock.Org.Abstractions
{
public class Mapping
public class Mappings
{
/// <summary>
/// This stub mapping's unique identifier
@@ -17,9 +17,9 @@ namespace WireMock.Org.Abstractions
/// </summary>
public string Name { get; set; }
public Request Request { get; set; }
public MappingsRequest Request { get; set; }
public Response Response { 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.
@@ -56,4 +56,4 @@ namespace WireMock.Org.Abstractions
/// </summary>
public object Metadata { get; set; }
}
}
}

View File

@@ -0,0 +1,55 @@
namespace WireMock.Org.Abstractions
{
public class MappingsRequest
{
/// <summary>
/// The HTTP request method e.g. GET
/// </summary>
public string Method { get; set; }
/// <summary>
/// The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
/// </summary>
public string Url { get; set; }
/// <summary>
/// The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
/// </summary>
public string UrlPath { get; set; }
/// <summary>
/// The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
/// </summary>
public string UrlPathPattern { get; set; }
/// <summary>
/// The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
/// </summary>
public string UrlPattern { get; set; }
/// <summary>
/// Query parameter patterns to match against in the : { "": "" } form
/// </summary>
public object QueryParameters { get; set; }
/// <summary>
/// Header patterns to match against in the : { "": "" } form
/// </summary>
public object Headers { get; set; }
/// <summary>
/// Pre-emptive basic auth credentials to match against
/// </summary>
public MappingsRequestBasicAuthCredentials BasicAuthCredentials { get; set; }
/// <summary>
/// Cookie patterns to match against in the : { "": "" } form
/// </summary>
public object Cookies { get; set; }
/// <summary>
/// Request body patterns to match against in the : { "": "" } form
/// </summary>
public object[] BodyPatterns { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
namespace WireMock.Org.Abstractions
{
/// <summary>
/// Pre-emptive basic auth credentials to match against
/// </summary>
public class MappingsRequestBasicAuthCredentials
{
public string Password { get; set; }
public string Username { get; set; }
}
}

View File

@@ -0,0 +1,80 @@
namespace WireMock.Org.Abstractions
{
public class MappingsResponse
{
/// <summary>
/// The HTTP status code to be returned
/// </summary>
public int Status { get; set; }
/// <summary>
/// The HTTP status message to be returned
/// </summary>
public string StatusMessage { get; set; }
/// <summary>
/// Map of response headers to send
/// </summary>
public object Headers { get; set; }
/// <summary>
/// Extra request headers to send when proxying to another host.
/// </summary>
public object AdditionalProxyRequestHeaders { get; set; }
/// <summary>
/// The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
/// </summary>
public string Body { get; set; }
/// <summary>
/// The response body as a base64 encoded string (useful for binary content). Only one of body, base64Body, jsonBody or bodyFileName may be specified.
/// </summary>
public string Base64Body { get; set; }
/// <summary>
/// The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
/// </summary>
public object JsonBody { get; set; }
/// <summary>
/// The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
/// </summary>
public string BodyFileName { get; set; }
/// <summary>
/// The fault to apply (instead of a full, valid response).
/// </summary>
public string Fault { get; set; }
/// <summary>
/// Number of milliseconds to delay be before sending the response.
/// </summary>
public int FixedDelayMilliseconds { get; set; }
/// <summary>
/// The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.
/// </summary>
public object DelayDistribution { get; set; }
/// <summary>
/// Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.
/// </summary>
public bool FromConfiguredStub { get; set; }
/// <summary>
/// The base URL of the target to proxy matching requests to.
/// </summary>
public string ProxyBaseUrl { get; set; }
/// <summary>
/// Parameters to apply to response transformers.
/// </summary>
public object TransformerParameters { get; set; }
/// <summary>
/// List of names of transformers to apply to this response.
/// </summary>
public string[] Transformers { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
namespace WireMock.Org.Abstractions
{
/// <summary>
/// The fault to apply (instead of a full, valid response).
/// </summary>
public static class MappingsResponseFaultConstants
{
public const string CONNECTIONRESETBYPEER = "CONNECTION_RESET_BY_PEER";
public const string EMPTYRESPONSE = "EMPTY_RESPONSE";
public const string MALFORMEDRESPONSECHUNK = "MALFORMED_RESPONSE_CHUNK";
public const string RANDOMDATATHENCLOSE = "RANDOM_DATA_THEN_CLOSE";
}
}

View File

@@ -4,4 +4,4 @@ namespace WireMock.Org.Abstractions
{
public int Total { get; set; }
}
}
}

View File

@@ -1,6 +1,6 @@
namespace WireMock.Org.Abstractions
{
public class NearMiss
public class NearMisses
{
/// <summary>
/// The HTTP request method
@@ -18,12 +18,12 @@ namespace WireMock.Org.Abstractions
public string AbsoluteUrl { get; set; }
/// <summary>
/// Header patterns to match against in the &lt;key&gt;: { "&lt;predicate&gt;": "&lt;value&gt;" } form
/// Header patterns to match against in the : { "": "" } form
/// </summary>
public object Headers { get; set; }
/// <summary>
/// Cookie patterns to match against in the &lt;key&gt;: { "&lt;predicate&gt;": "&lt;value&gt;" } form
/// Cookie patterns to match against in the : { "": "" } form
/// </summary>
public object Cookies { get; set; }
@@ -32,4 +32,4 @@ namespace WireMock.Org.Abstractions
/// </summary>
public string Body { get; set; }
}
}
}

View File

@@ -0,0 +1,9 @@
namespace WireMock.Org.Abstractions
{
public class PostAdminMappingsFindByMetadataResult
{
public Mappings Mappings { get; set; }
public Meta Meta { get; set; }
}
}

View File

@@ -0,0 +1,59 @@
namespace WireMock.Org.Abstractions
{
public class PostAdminMappingsResult
{
/// <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 WireMockOrgRequest Request { get; set; }
public WireMockOrgResponse 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; }
}
}

View File

@@ -0,0 +1,7 @@
namespace WireMock.Org.Abstractions
{
public class PostAdminNearMissesRequestPatternResult
{
public NearMisses NearMisses { get; set; }
}
}

View File

@@ -0,0 +1,7 @@
namespace WireMock.Org.Abstractions
{
public class PostAdminNearMissesRequestResult
{
public NearMisses NearMisses { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace WireMock.Org.Abstractions
{
public class PostAdminRecordingsSnapshotResult
{
public Mappings Mappings { get; set; }
public Meta Meta { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace WireMock.Org.Abstractions
{
public class PostAdminRecordingsStopResult
{
public Mappings Mappings { get; set; }
public Meta Meta { get; set; }
}
}

View File

@@ -1,7 +1,7 @@
namespace WireMock.Org.Abstractions
{
public class PostAdminRequestsCountResponse
public class PostAdminRequestsCountResult
{
public int Count { get; set; }
}
}
}

View File

@@ -0,0 +1,59 @@
namespace WireMock.Org.Abstractions
{
public class PutAdminMappingsByStubMappingIdResult
{
/// <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 WireMockOrgRequest Request { get; set; }
public WireMockOrgResponse 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; }
}
}

View File

@@ -1,6 +1,6 @@
namespace WireMock.Org.Abstractions
{
public class Request
public class WireMockOrgRequest
{
/// <summary>
/// The HTTP request method e.g. GET
@@ -28,28 +28,28 @@ namespace WireMock.Org.Abstractions
public string UrlPattern { get; set; }
/// <summary>
/// Query parameter patterns to match against in the &lt;key&gt;: { "&lt;predicate&gt;": "&lt;value&gt;" } form
/// Query parameter patterns to match against in the : { "": "" } form
/// </summary>
public object QueryParameters { get; set; }
/// <summary>
/// Header patterns to match against in the &lt;key&gt;: { "&lt;predicate&gt;": "&lt;value&gt;" } form
/// Header patterns to match against in the : { "": "" } form
/// </summary>
public object Headers { get; set; }
/// <summary>
/// Pre-emptive basic auth credentials to match against
/// </summary>
public BasicAuthCredentials BasicAuthCredentials { get; set; }
public RequestBasicAuthCredentials BasicAuthCredentials { get; set; }
/// <summary>
/// Cookie patterns to match against in the &lt;key&gt;: { "&lt;predicate&gt;": "&lt;value&gt;" } form
/// Cookie patterns to match against in the : { "": "" } form
/// </summary>
public object Cookies { get; set; }
/// <summary>
/// Request body patterns to match against in the &lt;key&gt;: { "&lt;predicate&gt;": "&lt;value&gt;" } form
/// Request body patterns to match against in the : { "": "" } form
/// </summary>
public object[] BodyPatterns { get; set; }
}
}
}

View File

@@ -3,10 +3,10 @@ namespace WireMock.Org.Abstractions
/// <summary>
/// Pre-emptive basic auth credentials to match against
/// </summary>
public class BasicAuthCredentials
public class RequestBasicAuthCredentials
{
public string Password { get; set; }
public string Username { get; set; }
}
}
}

View File

@@ -1,6 +1,6 @@
namespace WireMock.Org.Abstractions
{
public class Response
public class WireMockOrgResponse
{
/// <summary>
/// The HTTP status code to be returned
@@ -52,6 +52,11 @@ namespace WireMock.Org.Abstractions
/// </summary>
public int FixedDelayMilliseconds { get; set; }
/// <summary>
/// The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.
/// </summary>
public object DelayDistribution { get; set; }
/// <summary>
/// Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.
/// </summary>
@@ -70,6 +75,6 @@ namespace WireMock.Org.Abstractions
/// <summary>
/// List of names of transformers to apply to this response.
/// </summary>
public string Transformers { get; set; }
public string[] Transformers { get; set; }
}
}
}

View File

@@ -0,0 +1,16 @@
namespace WireMock.Org.Abstractions
{
/// <summary>
/// The fault to apply (instead of a full, valid response).
/// </summary>
public static class ResponseFaultConstants
{
public const string CONNECTIONRESETBYPEER = "CONNECTION_RESET_BY_PEER";
public const string EMPTYRESPONSE = "EMPTY_RESPONSE";
public const string MALFORMEDRESPONSECHUNK = "MALFORMED_RESPONSE_CHUNK";
public const string RANDOMDATATHENCLOSE = "RANDOM_DATA_THEN_CLOSE";
}
}

View File

@@ -1,14 +0,0 @@
namespace WireMock.Org.Abstractions
{
/// <summary>
/// Log normal randomly distributed response delay.
/// </summary>
public class ResponseLogNormal
{
public int Median { get; set; }
public double Sigma { get; set; }
public string Type { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
namespace WireMock.Org.Abstractions
{
/// <summary>
/// Uniformly distributed random response delay.
/// </summary>
public class ResponseLogUniformlyDistributed
{
public int Lower { get; set; }
public string Type { get; set; }
public int Upper { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace WireMock.Org.Abstractions
{
public class Scenario
public class Scenarios
{
/// <summary>
/// The scenario ID
@@ -12,11 +12,14 @@ namespace WireMock.Org.Abstractions
/// </summary>
public string Name { get; set; }
public string PossibleStates { get; set; }
/// <summary>
/// All the states this scenario can be in
/// </summary>
public string[] PossibleStates { get; set; }
/// <summary>
/// The current state of this scenario
/// </summary>
public string State { get; set; }
}
}
}

View File

@@ -0,0 +1,11 @@
namespace WireMock.Org.Abstractions
{
public static class StatusConstants
{
public const string NeverStarted = "NeverStarted";
public const string Recording = "Recording";
public const string Stopped = "Stopped";
}
}

File diff suppressed because it is too large Load Diff