using RestEase; using System; using System.Collections.Generic; using System.Net.Http.Headers; using System.Threading.Tasks; using WireMock.Admin.Mappings; using WireMock.Admin.Requests; using WireMock.Admin.Scenarios; using WireMock.Admin.Settings; namespace WireMock.Client { /// /// The RestEase interface which defines all admin commands. /// [BasePath("__admin")] public interface IWireMockAdminApi { /// /// Authentication header /// [Header("Authorization")] AuthenticationHeaderValue Authorization { get; set; } /// /// Get the settings. /// /// SettingsModel [Get("settings")] Task GetSettingsAsync(); /// /// Update the settings. /// /// SettingsModel [Put("settings")] [Header("Content-Type", "application/json")] Task PutSettingsAsync([Body] SettingsModel settings); /// /// Update the settings /// /// SettingsModel [Post("settings")] [Header("Content-Type", "application/json")] Task PostSettingsAsync([Body] SettingsModel settings); /// /// Get the mappings. /// /// MappingModels [Get("mappings")] Task> GetMappingsAsync(); /// /// Add a new mapping. /// /// MappingModel [Post("mappings")] [Header("Content-Type", "application/json")] Task PostMappingAsync([Body] MappingModel mapping); /// /// Add new mappings. /// /// MappingModels [Post("mappings")] [Header("Content-Type", "application/json")] Task PostMappingsAsync([Body] IList mappings); /// /// Delete all mappings. /// [Delete("mappings")] Task DeleteMappingsAsync(); /// /// Delete mappings according to GUIDs /// /// MappingModels [Delete("mappings")] [Header("Content-Type", "application/json")] Task DeleteMappingsAsync([Body] IList mappings); /// /// Delete (reset) all mappings. /// /// A value indicating whether to reload the static mappings after the reset. [Post("mappings/reset")] Task ResetMappingsAsync(bool? reloadStaticMappings = false); /// /// Get a mapping based on the guid /// /// The Guid /// MappingModel [Get("mappings/{guid}")] Task GetMappingAsync([Path] Guid guid); /// /// Update a mapping based on the guid /// /// The Guid /// MappingModel [Put("mappings/{guid}")] [Header("Content-Type", "application/json")] Task PutMappingAsync([Path] Guid guid, [Body] MappingModel mapping); /// /// Delete a mapping based on the guid /// /// The Guid [Delete("mappings/{guid}")] Task DeleteMappingAsync([Path] Guid guid); /// /// Save the mappings /// [Post("mappings/save")] Task SaveMappingAsync(); /// /// Get the requests. /// /// LogRequestModels [Get("requests")] Task> GetRequestsAsync(); /// /// Delete all requests. /// [Delete("requests")] Task DeleteRequestsAsync(); /// /// Delete (reset) all requests. /// [Post("requests/reset")] Task ResetRequestsAsync(); /// /// Get a request based on the guid /// /// The Guid /// MappingModel [Get("requests/{guid}")] Task GetRequestAsync([Path] Guid guid); /// /// Delete a request based on the guid /// /// The Guid [Delete("requests/{guid}")] Task DeleteRequestAsync([Path] Guid guid); /// /// Find a request based on the criteria /// /// The RequestModel [Post("requests/find")] [Header("Content-Type", "application/json")] Task> FindRequestsAsync([Body] RequestModel model); /// /// Get all scenarios /// [Get("scenarios")] Task> GetScenariosAsync(); /// /// Delete (reset) all scenarios /// [Delete("scenarios")] Task DeleteScenariosAsync(); /// /// Delete (reset) all scenarios /// [Post("scenarios")] Task ResetScenariosAsync(); /// /// Create a new File /// /// The filename /// The body [Post("files/{filename}")] Task PostFileAsync([Path] string filename, [Body] string body); /// /// Update an existing File /// /// The filename /// The body [Put("files/{filename}")] Task PutFileAsync([Path] string filename, [Body] string body); /// /// Get the content of an existing File /// /// The filename [Get("files/{filename}")] Task GetFileAsync([Path] string filename); /// /// Delete an existing File /// /// The filename [Delete("files/{filename}")] Task DeleteFileAsync([Path] string filename); /// /// Check if a file exists /// /// The filename [Head("files/{filename}")] Task FileExistsAsync([Path] string filename); } }