CShock/CShocker/Shockers/Abstract/HttpShocker.cs

24 lines
776 B
C#
Raw Normal View History

2024-01-17 17:59:10 +01:00
using CShocker.Ranges;
using Microsoft.Extensions.Logging;
namespace CShocker.Shockers.Abstract;
public abstract class HttpShocker : Shocker
{
protected readonly HttpClient HttpClient = new();
2024-01-17 19:33:57 +01:00
public string Endpoint { get; init; }
public string ApiKey { get; init; }
2024-01-17 17:59:10 +01:00
protected HttpShocker(List<string> shockerIds, IntensityRange intensityRange, DurationRange durationRange, string apiKey, string endpoint, ShockerApi apiType, ILogger? logger = null) : base(shockerIds, intensityRange, durationRange, apiType, logger)
2024-01-17 17:59:10 +01:00
{
Endpoint = endpoint;
ApiKey = apiKey;
}
2024-01-17 23:12:51 +01:00
public override string ToString()
{
return $"{base.ToString()}\n" +
$"Endpoint: {Endpoint}\n" +
$"ApiKey: {ApiKey}";
}
2024-01-17 17:59:10 +01:00
}