termii_rust/common/switch/
sender_id.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Deserialize, Serialize)]
4pub struct SenderIDResponse {
5 current_page: i64,
6 pub(crate) data: Vec<SenderIDItem>,
7 first_page_url: String,
8 from: Option<i64>,
9 last_page: i64,
10 last_page_url: String,
11 next_page_url: Option<String>,
12 path: String,
13 per_page: i64,
14 prev_page_url: Option<String>,
15 to: Option<i64>,
16 total: i64,
17}
18
19#[derive(Debug, Deserialize, Serialize)]
20pub struct SenderIDItem {
21 pub sender_id: String,
22 pub status: String,
23 pub company: Option<String>,
24 pub usecase: Option<String>,
25 pub country: Option<String>,
26 pub created_at: String,
27}
28
29#[derive(Debug, Deserialize, Serialize)]
30pub struct SenderIDRequest {
31 pub sender_id: String,
32 pub usecase: String,
33 pub company: String,
34 api_key: Option<String>,
35}
36
37impl SenderIDRequest {
38 pub fn new(sender_id: String, usecase: String, company: String) -> SenderIDRequest {
39 SenderIDRequest {
40 sender_id,
41 usecase,
42 company,
43 api_key: None,
44 }
45 }
46
47 pub(crate) fn set_api_key(&mut self, api_key: &str) {
48 self.api_key = Some(api_key.to_string());
49 }
50}
51
52#[derive(Debug, Deserialize, Serialize)]
53pub struct SenderIDRequestResponse {
54 pub code: String,
55 pub message: String,
56}