smarty_rust_sdk/us_street_api/
candidate.rs1use crate::sdk::CoordinateLicense;
2use serde::Deserialize;
3use serde::Serialize;
4
5pub type Candidates = Vec<Candidate>;
6
7#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
8#[serde(default)]
9pub struct Candidate {
10 pub input_id: String,
11 pub input_index: i64,
12 pub candidate_index: i64,
13 pub addressee: String,
14 pub delivery_line_1: String,
15 pub delivery_line_2: String,
16 pub last_line: String,
17 pub delivery_point_barcode: String,
18 pub smarty_key: String,
19 pub components: Components,
20 pub metadata: Metadata,
21 pub analysis: Analysis,
22}
23
24#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
25#[serde(default)]
26pub struct Components {
27 pub primary_number: String,
28 pub street_name: String,
29 pub street_predirection: String,
30 pub street_postdirection: String,
31 pub street_suffix: String,
32 pub secondary_number: String,
33 pub secondary_designator: String,
34 pub extra_secondary_number: String,
35 pub extra_secondary_designator: String,
36 pub pmb_number: String,
37 pub pmb_designator: String,
38 pub city_name: String,
39 pub default_city_name: String,
40 pub state_abbreviation: String,
41 pub zipcode: String,
42 pub plus4_code: String,
43 pub delivery_point: String,
44 pub delivery_point_check_digit: String,
45 pub urbanization: String,
46}
47
48#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
49#[serde(default)]
50pub struct Metadata {
51 pub record_type: String,
52 pub zip_type: String,
53 pub county_fips: String,
54 pub county_name: String,
55 pub carrier_route: String,
56 pub congressional_district: String,
57 pub building_default_indicator: String,
58 pub rdi: String,
59 pub elot_sequence: String,
60 pub elot_sort: String,
61 pub latitude: f64,
62 pub longitude: f64,
63 pub coordinate_license: CoordinateLicense,
64 pub precision: String,
65 pub time_zone: String,
66 pub utc_offset: f32,
67 pub dst: bool,
68 pub ews_match: bool,
69}
70
71#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
72#[serde(default)]
73pub struct Analysis {
74 pub dpv_match_code: String,
75 pub dpv_footnotes: String,
76 pub dpv_cmra: String,
77 pub dpv_vacant: String,
78 pub dpv_no_stat: String,
79 pub active: String,
80 pub footnotes: String,
81 pub lacslink_code: String,
82 pub lacslink_indicator: String,
83 pub suitelink_match: bool,
84 pub ews_match: bool,
85 pub enhanced_match: String,
86}