-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSmartyStreetsJSON.cls
86 lines (82 loc) · 2.56 KB
/
SmartyStreetsJSON.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*-------------------------------------------------------------------------------------------
Name: SmartyStreetsJSON.cls
Purpose: An Apex Class for storing of data from recieved JSON response
------------------------------History--------------------------------------------------------
Version Author Date Detail Description
------- --------------- -------------- ------------------
1.0 Sourabh Naik 29th Oct 2022 Initial Development
--------------------------------------------------------------------------------------------*/
public class SmartyStreetsJSON{
/*
* Name : Components
* Return Type :
* Parameters :
* Description : Wrapper Class for Components
* */
public class Components {
public String primary_number;
public String street_name;
public String street_suffix;
public String city_name;
public String default_city_name;
public String state_abbreviation;
public String zipcode;
public String plus4_code;
public String delivery_point;
public String delivery_point_check_digit;
}
public Integer input_index;
public Integer candidate_index;
public String delivery_line_1;
public String last_line;
public String delivery_point_barcode;
public Components components;
public Metadata metadata;
public Analysis analysis;
/*
* Name : Analysis
* Return Type :
* Parameters :
* Description : Wrapper Class for Analysis
* */
public class Analysis {
public String dpv_match_code;
public String dpv_footnotes;
public String dpv_cmra;
public String dpv_vacant;
public String dpv_no_stat;
public String active;
}
/*
* Name : Metadata
* Return Type :
* Parameters :
* Description : Wrapper Class for Metadata
* */
public class Metadata {
public String record_type;
public String zip_type;
public String county_fips;
public String county_name;
public String carrier_route;
public String congressional_district;
public String rdi;
public String elot_sequence;
public String elot_sort;
public Double latitude;
public Double longitude;
public String precision;
public String time_zone;
public Integer utc_offset;
public Boolean dst;
}
/*
* Method Name : parse
* Return Type : List of SmartyStreetsJSON
* Parameters : String
* Description : To deserialize the json response
* */
public static List<SmartyStreetsJSON> parse(String json) {
return (List<SmartyStreetsJSON>) System.JSON.deserialize(json, List<SmartyStreetsJSON>.class);
}
}