|
| 1 | +using System.Text.Json.Serialization; |
| 2 | + |
| 3 | +namespace Termii; |
| 4 | + |
| 5 | +public sealed class SendCampaignRequest |
| 6 | +{ |
| 7 | + [JsonPropertyName("country_code")] |
| 8 | + public string CountryCode { get; set; } = string.Empty; |
| 9 | + |
| 10 | + [JsonPropertyName("sender_id")] |
| 11 | + public string SenderId { get; set; } = string.Empty; |
| 12 | + |
| 13 | + [JsonPropertyName("message")] |
| 14 | + public string Message { get; set; } = string.Empty; |
| 15 | + |
| 16 | + [JsonPropertyName("channel")] |
| 17 | + public string Channel { get; set; } = string.Empty; |
| 18 | + |
| 19 | + [JsonPropertyName("message_type")] |
| 20 | + public string MessageType { get; set; } = string.Empty; |
| 21 | + |
| 22 | + [JsonPropertyName("phonebook_id")] |
| 23 | + public string PhonebookId { get; set; } = string.Empty; |
| 24 | + |
| 25 | + [JsonPropertyName("enable_link_tracking")] |
| 26 | + public bool? EnableLinkTracking { get; set; } |
| 27 | + |
| 28 | + [JsonPropertyName("campaign_type")] |
| 29 | + public string CampaignType { get; set; } = string.Empty; |
| 30 | + |
| 31 | + [JsonPropertyName("schedule_sms_status")] |
| 32 | + public string ScheduleSmsStatus { get; set; } = string.Empty; |
| 33 | + |
| 34 | + [JsonPropertyName("schedule_time")] |
| 35 | + public string? ScheduleTime { get; set; } |
| 36 | + |
| 37 | + [JsonPropertyName("delimiter")] |
| 38 | + public string? Delimiter { get; set; } |
| 39 | + |
| 40 | + [JsonPropertyName("remove_duplicate")] |
| 41 | + public string? RemoveDuplicate { get; set; } |
| 42 | + |
| 43 | + internal void Validate() |
| 44 | + { |
| 45 | + TermiiRequestValidation.Required(CountryCode, nameof(CountryCode)); |
| 46 | + TermiiRequestValidation.Required(SenderId, nameof(SenderId)); |
| 47 | + TermiiRequestValidation.Required(Message, nameof(Message)); |
| 48 | + TermiiRequestValidation.Required(Channel, nameof(Channel)); |
| 49 | + TermiiRequestValidation.Required(MessageType, nameof(MessageType)); |
| 50 | + TermiiRequestValidation.Required(PhonebookId, nameof(PhonebookId)); |
| 51 | + TermiiRequestValidation.Required(CampaignType, nameof(CampaignType)); |
| 52 | + TermiiRequestValidation.Required(ScheduleSmsStatus, nameof(ScheduleSmsStatus)); |
| 53 | + } |
| 54 | +} |
0 commit comments