smarty_rust_sdk/us_enrichment_api/
secondary.rs

1use serde::{Deserialize, Serialize};
2
3use super::response::EnrichmentResponse;
4
5#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
6#[serde(default)]
7pub struct SecondaryResponse {
8    pub smarty_key: String,
9    pub root_address: RootAddress,
10    pub aliases: Vec<Alias>,
11    pub secondaries: Vec<Secondary>,
12}
13
14impl EnrichmentResponse for SecondaryResponse {
15    fn lookup_type() -> &'static str {
16        "secondary"
17    }
18}
19
20#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
21#[serde(default)]
22pub struct RootAddress {
23    pub secondary_count: i64,
24    pub smarty_key: String,
25    pub primary_number: String,
26    pub street_name: String,
27    pub street_suffix: String,
28    pub street_postdirection: String,
29    pub city_name: String,
30    pub state_abbreviation: String,
31    pub zipcode: String,
32    pub plus4_code: String,
33}
34
35#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
36#[serde(default)]
37pub struct Alias {
38    pub smarty_key: String,
39    pub primary_number: String,
40    pub street_name: String,
41    pub street_suffix: String,
42    pub street_postdirection: String,
43    pub city_name: String,
44    pub state_abbreviation: String,
45    pub zipcode: String,
46    pub plus4_code: String,
47}
48
49#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
50#[serde(default)]
51pub struct Secondary {
52    pub smarty_key: String,
53    pub secondary_designator: String,
54    pub secondary_number: String,
55    pub plus4_code: String,
56}
57
58#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
59#[serde(default)]
60pub struct SecondaryCountResponse {
61    pub smarty_key: String,
62    pub count: i64,
63}
64
65impl EnrichmentResponse for SecondaryCountResponse {
66    fn lookup_type() -> &'static str {
67        "secondary/count"
68    }
69}