feat(SmsParams): Aktualisiert, um IHttpClientOptions zu implementieren

This commit is contained in:
Developer 02
2024-11-25 12:47:30 +01:00
parent 6e6f3fd2ed
commit ed80839777
3 changed files with 7 additions and 53 deletions

View File

@@ -8,49 +8,12 @@ namespace EnvelopeGenerator.Application.Configurations.GtxMessaging
public class SmsParams : IHttpClientOptions
{
//TODO: Add a regex check to init methods to reduce the chance of errors.
public string Uri { get; set; } = "https://rest.gtx-messaging.net";
public required string Uri { get; init; }
public string Path { get; set; } = "smsc/sendsms";
public string? Path { get; init; }
// path params
public required string AuthKey { get; init; }
public IEnumerable<KeyValuePair<string, object>>? Headers { get; init; }
public string? Format { get; init; }
// header params
public string? Accept { get; init; }
public string? ContentType { get; init; }
// query params
public required string From { get; init; }
public required Dictionary<string, string> Texts { get; init; }
public int? DlrMask { get; init; }
public string? DlrUrl { get; init; }
public string? Udh { get; init; }
public int? Dcs { get; init; }
public int? MClass { get; init; }
public int? MWI { get; init; }
public int? Coding { get; init; }
public string? Charset { get; init; }
public int? Validity { get; init; }
public DateTime? ValidityTime { get; init; }
public int? Deferred { get; init; }
public DateTime? DeferredTime { get; init; }
internal string AuthPath => Format is null ? AuthKey : string.Join('/', AuthKey, Format);
public IEnumerable<KeyValuePair<string, object?>>? QueryParams { get; init; }
}
}