39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using DigitalData.Core.Abstractions.Client;
|
|
using Microsoft.Extensions.Caching.Distributed;
|
|
|
|
namespace EnvelopeGenerator.Application.Configurations.GtxMessaging
|
|
{
|
|
/// <summary>
|
|
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
|
|
/// </summary>
|
|
public class SmsParams : IHttpClientOptions
|
|
{
|
|
public required string Uri { get; init; }
|
|
|
|
public string? Path { get; init; }
|
|
|
|
public Dictionary<string, object>? Headers { get; init; }
|
|
|
|
public Dictionary<string, object?>? QueryParams { get; init; }
|
|
|
|
public string RecipientQueryParamName { get; init; } = "to";
|
|
|
|
public string MessageQueryParamName { get; init; } = "text";
|
|
|
|
public int CodeLength { get; init; } = 5;
|
|
|
|
/// <summary>
|
|
/// Gets the cache key format for SMS codes.
|
|
/// The placeholder {0} represents the envelopeReceiverId.
|
|
/// </summary>
|
|
public string CodeCacheKeyFormat { get; init; } = "sms-code-{0}";
|
|
|
|
/// <summary>
|
|
/// Gets the cache expiration key format for SMS codes.
|
|
/// The placeholder {0} represents the envelopeReceiverId.
|
|
/// </summary>
|
|
public string CodeExpirationCacheKeyFormat { get; init; } = "sms-code-expiration-{0}";
|
|
|
|
public TimeSpan CodeCacheValidityPeriod { get; init; } = new(0, 5, 0);
|
|
}
|
|
} |