diff --git a/EnvelopeGenerator.Application/Configurations/GtxMessaging/SmsParams.cs b/EnvelopeGenerator.Application/Configurations/GtxMessaging/SmsParams.cs index c57d65f5..ca7a34d5 100644 --- a/EnvelopeGenerator.Application/Configurations/GtxMessaging/SmsParams.cs +++ b/EnvelopeGenerator.Application/Configurations/GtxMessaging/SmsParams.cs @@ -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>? 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 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>? QueryParams { get; init; } } } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index 6bec01fe..17aa1124 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -12,7 +12,7 @@ - + diff --git a/EnvelopeGenerator.Application/Services/GTXMessagingService.cs b/EnvelopeGenerator.Application/Services/GTXMessagingService.cs index 43ad6934..7044140f 100644 --- a/EnvelopeGenerator.Application/Services/GTXMessagingService.cs +++ b/EnvelopeGenerator.Application/Services/GTXMessagingService.cs @@ -1,29 +1,20 @@ using DigitalData.Core.Abstractions.Client; -using DigitalData.Core.DTO; using EnvelopeGenerator.Application.Configurations.GtxMessaging; -using Microsoft.Extensions.Options; namespace EnvelopeGenerator.Application.Services { public class GtxMessagingService { - private readonly SmsParams _smsParams; - private readonly IHttpClientService _smsClient; - private readonly string _authPath; - - public GtxMessagingService(IOptions smsParamsOptions, IHttpClientService smsClient) + public GtxMessagingService(IHttpClientService smsClient) { - _smsParams = smsParamsOptions.Value; _smsClient = smsClient; - - _authPath = _smsParams.AuthPath; } public async Task SendSms() { - await _smsClient.FetchAsync(path: _authPath); + await _smsClient.FetchAsync(); } } } \ No newline at end of file