1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.maps.addressvalidation.v1; 18 19option cc_enable_arenas = true; 20option csharp_namespace = "Google.Maps.AddressValidation.V1"; 21option go_package = "cloud.google.com/go/maps/addressvalidation/apiv1/addressvalidationpb;addressvalidationpb"; 22option java_multiple_files = true; 23option java_outer_classname = "UspsDataProto"; 24option java_package = "com.google.maps.addressvalidation.v1"; 25option objc_class_prefix = "GMPAVV1"; 26option php_namespace = "Google\\Maps\\AddressValidation\\V1"; 27option ruby_package = "Google::Maps::AddressValidation::V1"; 28 29// USPS representation of a US address. 30message UspsAddress { 31 // First address line. 32 string first_address_line = 1; 33 34 // Firm name. 35 string firm = 2; 36 37 // Second address line. 38 string second_address_line = 3; 39 40 // Puerto Rican urbanization name. 41 string urbanization = 4; 42 43 // City + state + postal code. 44 string city_state_zip_address_line = 5; 45 46 // City name. 47 string city = 6; 48 49 // 2 letter state code. 50 string state = 7; 51 52 // Postal code e.g. 10009. 53 string zip_code = 8; 54 55 // 4-digit postal code extension e.g. 5023. 56 string zip_code_extension = 9; 57} 58 59// The USPS data for the address. `uspsData` is not guaranteed to be fully 60// populated for every US or PR address sent to the Address Validation API. It's 61// recommended to integrate the backup address fields in the response if you 62// utilize uspsData as the primary part of the response. 63message UspsData { 64 // USPS standardized address. 65 UspsAddress standardized_address = 1; 66 67 // 2 digit delivery point code 68 string delivery_point_code = 2; 69 70 // The delivery point check digit. This number is added to the end of the 71 // delivery_point_barcode for mechanically scanned mail. Adding all the 72 // digits of the delivery_point_barcode, delivery_point_check_digit, postal 73 // code, and ZIP+4 together should yield a number divisible by 10. 74 string delivery_point_check_digit = 3; 75 76 // The possible values for DPV confirmation. Returns a single character or 77 // returns no value. 78 // 79 // * `N`: Primary and any secondary number information failed to 80 // DPV confirm. 81 // * `D`: Address was DPV confirmed for the primary number only, and the 82 // secondary number information was missing. 83 // * `S`: Address was DPV confirmed for the primary number only, and the 84 // secondary number information was present but not confirmed. 85 // * `Y`: Address was DPV confirmed for primary and any secondary numbers. 86 // * Empty: If the response does not contain a `dpv_confirmation` value, the 87 // address was not submitted for DPV confirmation. 88 string dpv_confirmation = 4; 89 90 // The footnotes from delivery point validation. 91 // Multiple footnotes may be strung together in the same string. 92 // 93 // * `AA`: Input address matched to the ZIP+4 file 94 // * `A1`: Input address was not matched to the ZIP+4 file 95 // * `BB`: Matched to DPV (all components) 96 // * `CC`: Secondary number not matched and not required 97 // * `C1`: Secondary number not matched but required 98 // * `N1`: High-rise address missing secondary number 99 // * `M1`: Primary number missing 100 // * `M3`: Primary number invalid 101 // * `P1`: Input address PO, RR or HC box number missing 102 // * `P3`: Input address PO, RR, or HC Box number invalid 103 // * `F1`: Input address matched to a military address 104 // * `G1`: Input address matched to a general delivery address 105 // * `U1`: Input address matched to a unique ZIP code 106 // * `PB`: Input address matched to PBSA record 107 // * `RR`: DPV confirmed address with PMB information 108 // * `R1`: DPV confirmed address without PMB information 109 // * `R7`: Carrier Route R777 or R779 record 110 // * `IA`: Informed Address identified 111 // * `TA`: Primary number matched by dropping a trailing alpha 112 string dpv_footnote = 5; 113 114 // Indicates if the address is a CMRA (Commercial Mail Receiving Agency)--a 115 // private business receiving mail for clients. Returns a single character. 116 // 117 // * `Y`: The address is a CMRA 118 // * `N`: The address is not a CMRA 119 string dpv_cmra = 6; 120 121 // Is this place vacant? 122 // Returns a single character. 123 // 124 // * `Y`: The address is vacant 125 // * `N`: The address is not vacant 126 string dpv_vacant = 7; 127 128 // Is this a no stat address or an active address? 129 // No stat addresses are ones which are not continuously occupied or addresses 130 // that the USPS does not service. Returns a single character. 131 // 132 // * `Y`: The address is not active 133 // * `N`: The address is active 134 string dpv_no_stat = 8; 135 136 // Indicates the NoStat type. Returns a reason code as int. 137 // 138 // * `1`: IDA (Internal Drop Address) – Addresses that do not receive mail 139 // directly from the USPS but are delivered to a drop address that services 140 // them. 141 // * `2`: CDS - Addresses that have not yet become deliverable. For example, a 142 // new subdivision where lots and primary numbers have been determined, but no 143 // structure exists yet for occupancy. 144 // * `3`: Collision - Addresses that do not actually DPV confirm. 145 // * `4`: CMZ (College, Military and Other Types) - ZIP + 4 records USPS has 146 // incorporated into the data. 147 // * `5`: Regular - Indicates addresses not receiving delivery and the 148 // addresses are not counted as possible deliveries. 149 // * `6`: Secondary Required - The address requires secondary information. 150 int32 dpv_no_stat_reason_code = 29; 151 152 // Flag indicates mail is delivered to a single receptable at a site. 153 // Returns a single character. 154 // 155 // * `Y`: The mail is delivered to a single receptable at a site. 156 // * `N`: The mail is not delivered to a single receptable at a site. 157 string dpv_drop = 30; 158 159 // Indicates that mail is not delivered to the street address. 160 // Returns a single character. 161 // 162 // * `Y`: The mail is not delivered to the street address. 163 // * `N`: The mail is delivered to the street address. 164 string dpv_throwback = 31; 165 166 // Flag indicates mail delivery is not performed every day of the week. 167 // Returns a single character. 168 // 169 // * `Y`: The mail delivery is not performed every day of the week. 170 // * `N`: No indication the mail delivery is not performed every day of the 171 // week. 172 string dpv_non_delivery_days = 32; 173 174 // Integer identifying non-delivery days. It can be interrogated using bit 175 // flags: 176 // 0x40 – Sunday is a non-delivery day 177 // 0x20 – Monday is a non-delivery day 178 // 0x10 – Tuesday is a non-delivery day 179 // 0x08 – Wednesday is a non-delivery day 180 // 0x04 – Thursday is a non-delivery day 181 // 0x02 – Friday is a non-delivery day 182 // 0x01 – Saturday is a non-delivery day 183 int32 dpv_non_delivery_days_values = 33; 184 185 // Flag indicates door is accessible, but package will not be left due to 186 // security concerns. 187 // Returns a single character. 188 // 189 // * `Y`: The package will not be left due to security concerns. 190 // * `N`: No indication the package will not be left due to security concerns. 191 string dpv_no_secure_location = 34; 192 193 // Indicates the address was matched to PBSA record. 194 // Returns a single character. 195 // 196 // * `Y`: The address was matched to PBSA record. 197 // * `N`: The address was not matched to PBSA record. 198 string dpv_pbsa = 35; 199 200 // Flag indicates addresses where USPS cannot knock on a door to deliver mail. 201 // Returns a single character. 202 // 203 // * `Y`: The door is not accessible. 204 // * `N`: No indication the door is not accessible. 205 string dpv_door_not_accessible = 36; 206 207 // Indicates that more than one DPV return code is valid for the address. 208 // Returns a single character. 209 // 210 // * `Y`: Address was DPV confirmed for primary and any secondary numbers. 211 // * `N`: Primary and any secondary number information failed to 212 // DPV confirm. 213 // * `S`: Address was DPV confirmed for the primary number only, and the 214 // secondary number information was present by not confirmed, or a single 215 // trailing alpha on a primary number was dropped to make a DPV match and 216 // secondary information required. 217 // * `D`: Address was DPV confirmed for the primary number only, and the 218 // secondary number information was missing. 219 // * `R`: Address confirmed but assigned to phantom route R777 and R779 and 220 // USPS delivery is not provided. 221 string dpv_enhanced_delivery_code = 37; 222 223 // The carrier route code. 224 // A four character code consisting of a one letter prefix and a three digit 225 // route designator. 226 // 227 // Prefixes: 228 // 229 // * `C`: Carrier route (or city route) 230 // * `R`: Rural route 231 // * `H`: Highway Contract Route 232 // * `B`: Post Office Box Section 233 // * `G`: General delivery unit 234 string carrier_route = 9; 235 236 // Carrier route rate sort indicator. 237 string carrier_route_indicator = 10; 238 239 // The delivery address is matchable, but the EWS file indicates that an exact 240 // match will be available soon. 241 bool ews_no_match = 11; 242 243 // Main post office city. 244 string post_office_city = 12; 245 246 // Main post office state. 247 string post_office_state = 13; 248 249 // Abbreviated city. 250 string abbreviated_city = 14; 251 252 // FIPS county code. 253 string fips_county_code = 15; 254 255 // County name. 256 string county = 16; 257 258 // Enhanced Line of Travel (eLOT) number. 259 string elot_number = 17; 260 261 // eLOT Ascending/Descending Flag (A/D). 262 string elot_flag = 18; 263 264 // LACSLink return code. 265 string lacs_link_return_code = 19; 266 267 // LACSLink indicator. 268 string lacs_link_indicator = 20; 269 270 // PO Box only postal code. 271 bool po_box_only_postal_code = 21; 272 273 // Footnotes from matching a street or highrise record to suite information. 274 // If business name match is found, the secondary number is returned. 275 // 276 // * `A`: SuiteLink record match, business address improved. 277 // * `00`: No match, business address is not improved. 278 string suitelink_footnote = 22; 279 280 // PMB (Private Mail Box) unit designator. 281 string pmb_designator = 23; 282 283 // PMB (Private Mail Box) number; 284 string pmb_number = 24; 285 286 // Type of the address record that matches the input address. 287 // 288 // * `F`: FIRM. This is a match to a Firm Record, which is the finest level of 289 // match available for an address. 290 // * `G`: GENERAL DELIVERY. This is a match to a General Delivery record. 291 // * `H`: BUILDING / APARTMENT. This is a match to a Building or Apartment 292 // record. 293 // * `P`: POST OFFICE BOX. This is a match to a Post Office Box. 294 // * `R`: RURAL ROUTE or HIGHWAY CONTRACT: This is a match to either a Rural 295 // Route or a Highway Contract record, both of which may have associated Box 296 // Number ranges. 297 // * `S`: STREET RECORD: This is a match to a Street record containing a valid 298 // primary number range. 299 string address_record_type = 25; 300 301 // Indicator that a default address was found, but more specific addresses 302 // exists. 303 bool default_address = 26; 304 305 // Error message for USPS data retrieval. This is populated when USPS 306 // processing is suspended because of the detection of artificially created 307 // addresses. 308 // 309 // The USPS data fields might not be populated when this error is present. 310 string error_message = 27; 311 312 // Indicator that the request has been CASS processed. 313 bool cass_processed = 28; 314} 315