google-apis-addressvalidation_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1265 @@
1
+ # Copyright 2020 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
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module AddressvalidationV1
24
+
25
+ # A latitude-longitude viewport, represented as two diagonally opposite `low`
26
+ # and `high` points. A viewport is considered a closed region, i.e. it includes
27
+ # its boundary. The latitude bounds must range between -90 to 90 degrees
28
+ # inclusive, and the longitude bounds must range between -180 to 180 degrees
29
+ # inclusive. Various cases include: - If `low` = `high`, the viewport consists
30
+ # of that single point. - If `low.longitude` > `high.longitude`, the longitude
31
+ # range is inverted (the viewport crosses the 180 degree longitude line). - If `
32
+ # low.longitude` = -180 degrees and `high.longitude` = 180 degrees, the viewport
33
+ # includes all longitudes. - If `low.longitude` = 180 degrees and `high.
34
+ # longitude` = -180 degrees, the longitude range is empty. - If `low.latitude` >
35
+ # `high.latitude`, the latitude range is empty. Both `low` and `high` must be
36
+ # populated, and the represented box cannot be empty (as specified by the
37
+ # definitions above). An empty viewport will result in an error. For example,
38
+ # this viewport fully encloses New York City: ` "low": ` "latitude": 40.477398, "
39
+ # longitude": -74.259087 `, "high": ` "latitude": 40.91618, "longitude": -73.
40
+ # 70018 ` `
41
+ class GoogleGeoTypeViewport
42
+ include Google::Apis::Core::Hashable
43
+
44
+ # An object that represents a latitude/longitude pair. This is expressed as a
45
+ # pair of doubles to represent degrees latitude and degrees longitude. Unless
46
+ # specified otherwise, this object must conform to the WGS84 standard. Values
47
+ # must be within normalized ranges.
48
+ # Corresponds to the JSON property `high`
49
+ # @return [Google::Apis::AddressvalidationV1::GoogleTypeLatLng]
50
+ attr_accessor :high
51
+
52
+ # An object that represents a latitude/longitude pair. This is expressed as a
53
+ # pair of doubles to represent degrees latitude and degrees longitude. Unless
54
+ # specified otherwise, this object must conform to the WGS84 standard. Values
55
+ # must be within normalized ranges.
56
+ # Corresponds to the JSON property `low`
57
+ # @return [Google::Apis::AddressvalidationV1::GoogleTypeLatLng]
58
+ attr_accessor :low
59
+
60
+ def initialize(**args)
61
+ update!(**args)
62
+ end
63
+
64
+ # Update properties of this object
65
+ def update!(**args)
66
+ @high = args[:high] if args.key?(:high)
67
+ @low = args[:low] if args.key?(:low)
68
+ end
69
+ end
70
+
71
+ # Details of the post-processed address. Post-processing includes correcting
72
+ # misspelled parts of the address, replacing incorrect parts, and inferring
73
+ # missing parts.
74
+ class GoogleMapsAddressvalidationV1Address
75
+ include Google::Apis::Core::Hashable
76
+
77
+ # Unordered list. The individual address components of the formatted and
78
+ # corrected address, along with validation information. This provides
79
+ # information on the validation status of the individual components. Address
80
+ # components are not ordered in a particular way. Do not make any assumptions on
81
+ # the ordering of the address components in the list.
82
+ # Corresponds to the JSON property `addressComponents`
83
+ # @return [Array<Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1AddressComponent>]
84
+ attr_accessor :address_components
85
+
86
+ # The post-processed address, formatted as a single-line address following the
87
+ # address formatting rules of the region where the address is located.
88
+ # Corresponds to the JSON property `formattedAddress`
89
+ # @return [String]
90
+ attr_accessor :formatted_address
91
+
92
+ # The types of components that were expected to be present in a correctly
93
+ # formatted mailing address but were not found in the input AND could not be
94
+ # inferred. Components of this type are not present in `formatted_address`, `
95
+ # postal_address`, or `address_components`. An example might be `['street_number'
96
+ # , 'route']` for an input like "Boulder, Colorado, 80301, USA". The list of
97
+ # possible types can be found [here](https://developers.google.com/maps/
98
+ # documentation/geocoding/requests-geocoding#Types).
99
+ # Corresponds to the JSON property `missingComponentTypes`
100
+ # @return [Array<String>]
101
+ attr_accessor :missing_component_types
102
+
103
+ # Represents a postal address, e.g. for postal delivery or payments addresses.
104
+ # Given a postal address, a postal service can deliver items to a premise, P.O.
105
+ # Box or similar. It is not intended to model geographical locations (roads,
106
+ # towns, mountains). In typical usage an address would be created via user input
107
+ # or from importing existing data, depending on the type of process. Advice on
108
+ # address input / editing: - Use an internationalization-ready address widget
109
+ # such as https://github.com/google/libaddressinput) - Users should not be
110
+ # presented with UI elements for input or editing of fields outside countries
111
+ # where that field is used. For more guidance on how to use this schema, please
112
+ # see: https://support.google.com/business/answer/6397478
113
+ # Corresponds to the JSON property `postalAddress`
114
+ # @return [Google::Apis::AddressvalidationV1::GoogleTypePostalAddress]
115
+ attr_accessor :postal_address
116
+
117
+ # The types of the components that are present in the `address_components` but
118
+ # could not be confirmed to be correct. This field is provided for the sake of
119
+ # convenience: its contents are equivalent to iterating through the `
120
+ # address_components` to find the types of all the components where the
121
+ # confirmation_level is not CONFIRMED or the inferred flag is not set to `true`.
122
+ # The list of possible types can be found [here](https://developers.google.com/
123
+ # maps/documentation/geocoding/requests-geocoding#Types).
124
+ # Corresponds to the JSON property `unconfirmedComponentTypes`
125
+ # @return [Array<String>]
126
+ attr_accessor :unconfirmed_component_types
127
+
128
+ # Any tokens in the input that could not be resolved. This might be an input
129
+ # that was not recognized as a valid part of an address (for example in an input
130
+ # like "123235253253 Main St, San Francisco, CA, 94105", the unresolved tokens
131
+ # may look like `["123235253253"]` since that does not look like a valid street
132
+ # number.
133
+ # Corresponds to the JSON property `unresolvedTokens`
134
+ # @return [Array<String>]
135
+ attr_accessor :unresolved_tokens
136
+
137
+ def initialize(**args)
138
+ update!(**args)
139
+ end
140
+
141
+ # Update properties of this object
142
+ def update!(**args)
143
+ @address_components = args[:address_components] if args.key?(:address_components)
144
+ @formatted_address = args[:formatted_address] if args.key?(:formatted_address)
145
+ @missing_component_types = args[:missing_component_types] if args.key?(:missing_component_types)
146
+ @postal_address = args[:postal_address] if args.key?(:postal_address)
147
+ @unconfirmed_component_types = args[:unconfirmed_component_types] if args.key?(:unconfirmed_component_types)
148
+ @unresolved_tokens = args[:unresolved_tokens] if args.key?(:unresolved_tokens)
149
+ end
150
+ end
151
+
152
+ # Represents an address component, such as a street, city, or state.
153
+ class GoogleMapsAddressvalidationV1AddressComponent
154
+ include Google::Apis::Core::Hashable
155
+
156
+ # A wrapper for the name of the component.
157
+ # Corresponds to the JSON property `componentName`
158
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1ComponentName]
159
+ attr_accessor :component_name
160
+
161
+ # The type of the address component. See [Table 2: Additional types returned by
162
+ # the Places service](https://developers.google.com/places/web-service/
163
+ # supported_types#table2) for a list of possible types.
164
+ # Corresponds to the JSON property `componentType`
165
+ # @return [String]
166
+ attr_accessor :component_type
167
+
168
+ # Indicates the level of certainty that we have that the component is correct.
169
+ # Corresponds to the JSON property `confirmationLevel`
170
+ # @return [String]
171
+ attr_accessor :confirmation_level
172
+
173
+ # Indicates that the component was not part of the input, but we inferred it for
174
+ # the address location and believe it should be provided for a complete address.
175
+ # Corresponds to the JSON property `inferred`
176
+ # @return [Boolean]
177
+ attr_accessor :inferred
178
+ alias_method :inferred?, :inferred
179
+
180
+ # Indicates the name of the component was replaced with a completely different
181
+ # one, for example a wrong postal code being replaced with one that is correct
182
+ # for the address. This is not a cosmetic change, the input component has been
183
+ # changed to a different one.
184
+ # Corresponds to the JSON property `replaced`
185
+ # @return [Boolean]
186
+ attr_accessor :replaced
187
+ alias_method :replaced?, :replaced
188
+
189
+ # Indicates a correction to a misspelling in the component name. The API does
190
+ # not always flag changes from one spelling variant to another, such as when
191
+ # changing "centre" to "center". It also does not always flag common
192
+ # misspellings, such as when changing "Amphitheater Pkwy" to "Amphitheatre Pkwy".
193
+ # Corresponds to the JSON property `spellCorrected`
194
+ # @return [Boolean]
195
+ attr_accessor :spell_corrected
196
+ alias_method :spell_corrected?, :spell_corrected
197
+
198
+ # Indicates an address component that is not expected to be present in a postal
199
+ # address for the given region. We have retained it only because it was part of
200
+ # the input.
201
+ # Corresponds to the JSON property `unexpected`
202
+ # @return [Boolean]
203
+ attr_accessor :unexpected
204
+ alias_method :unexpected?, :unexpected
205
+
206
+ def initialize(**args)
207
+ update!(**args)
208
+ end
209
+
210
+ # Update properties of this object
211
+ def update!(**args)
212
+ @component_name = args[:component_name] if args.key?(:component_name)
213
+ @component_type = args[:component_type] if args.key?(:component_type)
214
+ @confirmation_level = args[:confirmation_level] if args.key?(:confirmation_level)
215
+ @inferred = args[:inferred] if args.key?(:inferred)
216
+ @replaced = args[:replaced] if args.key?(:replaced)
217
+ @spell_corrected = args[:spell_corrected] if args.key?(:spell_corrected)
218
+ @unexpected = args[:unexpected] if args.key?(:unexpected)
219
+ end
220
+ end
221
+
222
+ # The metadata for the address. `metadata` is not guaranteed to be fully
223
+ # populated for every address sent to the Address Validation API.
224
+ class GoogleMapsAddressvalidationV1AddressMetadata
225
+ include Google::Apis::Core::Hashable
226
+
227
+ # Indicates that this is the address of a business. If unset, indicates that the
228
+ # value is unknown.
229
+ # Corresponds to the JSON property `business`
230
+ # @return [Boolean]
231
+ attr_accessor :business
232
+ alias_method :business?, :business
233
+
234
+ # Indicates that the address of a PO box. If unset, indicates that the value is
235
+ # unknown.
236
+ # Corresponds to the JSON property `poBox`
237
+ # @return [Boolean]
238
+ attr_accessor :po_box
239
+ alias_method :po_box?, :po_box
240
+
241
+ # Indicates that this is the address of a residence. If unset, indicates that
242
+ # the value is unknown.
243
+ # Corresponds to the JSON property `residential`
244
+ # @return [Boolean]
245
+ attr_accessor :residential
246
+ alias_method :residential?, :residential
247
+
248
+ def initialize(**args)
249
+ update!(**args)
250
+ end
251
+
252
+ # Update properties of this object
253
+ def update!(**args)
254
+ @business = args[:business] if args.key?(:business)
255
+ @po_box = args[:po_box] if args.key?(:po_box)
256
+ @residential = args[:residential] if args.key?(:residential)
257
+ end
258
+ end
259
+
260
+ # A wrapper for the name of the component.
261
+ class GoogleMapsAddressvalidationV1ComponentName
262
+ include Google::Apis::Core::Hashable
263
+
264
+ # The BCP-47 language code. This will not be present if the component name is
265
+ # not associated with a language, such as a street number.
266
+ # Corresponds to the JSON property `languageCode`
267
+ # @return [String]
268
+ attr_accessor :language_code
269
+
270
+ # The name text. For example, "5th Avenue" for a street name or "1253" for a
271
+ # street number.
272
+ # Corresponds to the JSON property `text`
273
+ # @return [String]
274
+ attr_accessor :text
275
+
276
+ def initialize(**args)
277
+ update!(**args)
278
+ end
279
+
280
+ # Update properties of this object
281
+ def update!(**args)
282
+ @language_code = args[:language_code] if args.key?(:language_code)
283
+ @text = args[:text] if args.key?(:text)
284
+ end
285
+ end
286
+
287
+ # Contains information about the place the input was geocoded to.
288
+ class GoogleMapsAddressvalidationV1Geocode
289
+ include Google::Apis::Core::Hashable
290
+
291
+ # A latitude-longitude viewport, represented as two diagonally opposite `low`
292
+ # and `high` points. A viewport is considered a closed region, i.e. it includes
293
+ # its boundary. The latitude bounds must range between -90 to 90 degrees
294
+ # inclusive, and the longitude bounds must range between -180 to 180 degrees
295
+ # inclusive. Various cases include: - If `low` = `high`, the viewport consists
296
+ # of that single point. - If `low.longitude` > `high.longitude`, the longitude
297
+ # range is inverted (the viewport crosses the 180 degree longitude line). - If `
298
+ # low.longitude` = -180 degrees and `high.longitude` = 180 degrees, the viewport
299
+ # includes all longitudes. - If `low.longitude` = 180 degrees and `high.
300
+ # longitude` = -180 degrees, the longitude range is empty. - If `low.latitude` >
301
+ # `high.latitude`, the latitude range is empty. Both `low` and `high` must be
302
+ # populated, and the represented box cannot be empty (as specified by the
303
+ # definitions above). An empty viewport will result in an error. For example,
304
+ # this viewport fully encloses New York City: ` "low": ` "latitude": 40.477398, "
305
+ # longitude": -74.259087 `, "high": ` "latitude": 40.91618, "longitude": -73.
306
+ # 70018 ` `
307
+ # Corresponds to the JSON property `bounds`
308
+ # @return [Google::Apis::AddressvalidationV1::GoogleGeoTypeViewport]
309
+ attr_accessor :bounds
310
+
311
+ # The size of the geocoded place, in meters. This is another measure of the
312
+ # coarseness of the geocoded location, but in physical size rather than in
313
+ # semantic meaning.
314
+ # Corresponds to the JSON property `featureSizeMeters`
315
+ # @return [Float]
316
+ attr_accessor :feature_size_meters
317
+
318
+ # An object that represents a latitude/longitude pair. This is expressed as a
319
+ # pair of doubles to represent degrees latitude and degrees longitude. Unless
320
+ # specified otherwise, this object must conform to the WGS84 standard. Values
321
+ # must be within normalized ranges.
322
+ # Corresponds to the JSON property `location`
323
+ # @return [Google::Apis::AddressvalidationV1::GoogleTypeLatLng]
324
+ attr_accessor :location
325
+
326
+ # The PlaceID of the place this input geocodes to. For more information about
327
+ # Place IDs see [here](https://developers.google.com/maps/documentation/places/
328
+ # web-service/place-id).
329
+ # Corresponds to the JSON property `placeId`
330
+ # @return [String]
331
+ attr_accessor :place_id
332
+
333
+ # The type(s) of place that the input geocoded to. For example, `['locality', '
334
+ # political']`. The full list of types can be found [here](https://developers.
335
+ # google.com/maps/documentation/geocoding/requests-geocoding#Types).
336
+ # Corresponds to the JSON property `placeTypes`
337
+ # @return [Array<String>]
338
+ attr_accessor :place_types
339
+
340
+ # Plus code (http://plus.codes) is a location reference with two formats: global
341
+ # code defining a 14mx14m (1/8000th of a degree) or smaller rectangle, and
342
+ # compound code, replacing the prefix with a reference location.
343
+ # Corresponds to the JSON property `plusCode`
344
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1PlusCode]
345
+ attr_accessor :plus_code
346
+
347
+ def initialize(**args)
348
+ update!(**args)
349
+ end
350
+
351
+ # Update properties of this object
352
+ def update!(**args)
353
+ @bounds = args[:bounds] if args.key?(:bounds)
354
+ @feature_size_meters = args[:feature_size_meters] if args.key?(:feature_size_meters)
355
+ @location = args[:location] if args.key?(:location)
356
+ @place_id = args[:place_id] if args.key?(:place_id)
357
+ @place_types = args[:place_types] if args.key?(:place_types)
358
+ @plus_code = args[:plus_code] if args.key?(:plus_code)
359
+ end
360
+ end
361
+
362
+ # Preview: This feature is in Preview (pre-GA). Pre-GA products and features
363
+ # might have limited support, and changes to pre-GA products and features might
364
+ # not be compatible with other pre-GA versions. Pre-GA Offerings are covered by
365
+ # the [Google Maps Platform Service Specific Terms](https://cloud.google.com/
366
+ # maps-platform/terms/maps-service-terms). For more information, see the [launch
367
+ # stage descriptions](https://developers.google.com/maps/launch-stages). Enables
368
+ # the Address Validation API to include additional information in the response.
369
+ class GoogleMapsAddressvalidationV1LanguageOptions
370
+ include Google::Apis::Core::Hashable
371
+
372
+ # Preview: Return a [google.maps.addressvalidation.v1.Address] in English. See [
373
+ # google.maps.addressvalidation.v1.ValidationResult.english_latin_address] for
374
+ # details.
375
+ # Corresponds to the JSON property `returnEnglishLatinAddress`
376
+ # @return [Boolean]
377
+ attr_accessor :return_english_latin_address
378
+ alias_method :return_english_latin_address?, :return_english_latin_address
379
+
380
+ def initialize(**args)
381
+ update!(**args)
382
+ end
383
+
384
+ # Update properties of this object
385
+ def update!(**args)
386
+ @return_english_latin_address = args[:return_english_latin_address] if args.key?(:return_english_latin_address)
387
+ end
388
+ end
389
+
390
+ # Plus code (http://plus.codes) is a location reference with two formats: global
391
+ # code defining a 14mx14m (1/8000th of a degree) or smaller rectangle, and
392
+ # compound code, replacing the prefix with a reference location.
393
+ class GoogleMapsAddressvalidationV1PlusCode
394
+ include Google::Apis::Core::Hashable
395
+
396
+ # Place's compound code, such as "33GV+HQ, Ramberg, Norway", containing the
397
+ # suffix of the global code and replacing the prefix with a formatted name of a
398
+ # reference entity.
399
+ # Corresponds to the JSON property `compoundCode`
400
+ # @return [String]
401
+ attr_accessor :compound_code
402
+
403
+ # Place's global (full) code, such as "9FWM33GV+HQ", representing an 1/8000 by 1/
404
+ # 8000 degree area (~14 by 14 meters).
405
+ # Corresponds to the JSON property `globalCode`
406
+ # @return [String]
407
+ attr_accessor :global_code
408
+
409
+ def initialize(**args)
410
+ update!(**args)
411
+ end
412
+
413
+ # Update properties of this object
414
+ def update!(**args)
415
+ @compound_code = args[:compound_code] if args.key?(:compound_code)
416
+ @global_code = args[:global_code] if args.key?(:global_code)
417
+ end
418
+ end
419
+
420
+ # The request for sending validation feedback.
421
+ class GoogleMapsAddressvalidationV1ProvideValidationFeedbackRequest
422
+ include Google::Apis::Core::Hashable
423
+
424
+ # Required. The outcome of the sequence of validation attempts. If this field is
425
+ # set to `VALIDATION_CONCLUSION_UNSPECIFIED`, an `INVALID_ARGUMENT` error will
426
+ # be returned.
427
+ # Corresponds to the JSON property `conclusion`
428
+ # @return [String]
429
+ attr_accessor :conclusion
430
+
431
+ # Required. The ID of the response that this feedback is for. This should be the
432
+ # response_id from the first response in a series of address validation attempts.
433
+ # Corresponds to the JSON property `responseId`
434
+ # @return [String]
435
+ attr_accessor :response_id
436
+
437
+ def initialize(**args)
438
+ update!(**args)
439
+ end
440
+
441
+ # Update properties of this object
442
+ def update!(**args)
443
+ @conclusion = args[:conclusion] if args.key?(:conclusion)
444
+ @response_id = args[:response_id] if args.key?(:response_id)
445
+ end
446
+ end
447
+
448
+ # The response for validation feedback. The response is empty if the feedback is
449
+ # sent successfully.
450
+ class GoogleMapsAddressvalidationV1ProvideValidationFeedbackResponse
451
+ include Google::Apis::Core::Hashable
452
+
453
+ def initialize(**args)
454
+ update!(**args)
455
+ end
456
+
457
+ # Update properties of this object
458
+ def update!(**args)
459
+ end
460
+ end
461
+
462
+ # USPS representation of a US address.
463
+ class GoogleMapsAddressvalidationV1UspsAddress
464
+ include Google::Apis::Core::Hashable
465
+
466
+ # City name.
467
+ # Corresponds to the JSON property `city`
468
+ # @return [String]
469
+ attr_accessor :city
470
+
471
+ # City + state + postal code.
472
+ # Corresponds to the JSON property `cityStateZipAddressLine`
473
+ # @return [String]
474
+ attr_accessor :city_state_zip_address_line
475
+
476
+ # Firm name.
477
+ # Corresponds to the JSON property `firm`
478
+ # @return [String]
479
+ attr_accessor :firm
480
+
481
+ # First address line.
482
+ # Corresponds to the JSON property `firstAddressLine`
483
+ # @return [String]
484
+ attr_accessor :first_address_line
485
+
486
+ # Second address line.
487
+ # Corresponds to the JSON property `secondAddressLine`
488
+ # @return [String]
489
+ attr_accessor :second_address_line
490
+
491
+ # 2 letter state code.
492
+ # Corresponds to the JSON property `state`
493
+ # @return [String]
494
+ attr_accessor :state
495
+
496
+ # Puerto Rican urbanization name.
497
+ # Corresponds to the JSON property `urbanization`
498
+ # @return [String]
499
+ attr_accessor :urbanization
500
+
501
+ # Postal code e.g. 10009.
502
+ # Corresponds to the JSON property `zipCode`
503
+ # @return [String]
504
+ attr_accessor :zip_code
505
+
506
+ # 4-digit postal code extension e.g. 5023.
507
+ # Corresponds to the JSON property `zipCodeExtension`
508
+ # @return [String]
509
+ attr_accessor :zip_code_extension
510
+
511
+ def initialize(**args)
512
+ update!(**args)
513
+ end
514
+
515
+ # Update properties of this object
516
+ def update!(**args)
517
+ @city = args[:city] if args.key?(:city)
518
+ @city_state_zip_address_line = args[:city_state_zip_address_line] if args.key?(:city_state_zip_address_line)
519
+ @firm = args[:firm] if args.key?(:firm)
520
+ @first_address_line = args[:first_address_line] if args.key?(:first_address_line)
521
+ @second_address_line = args[:second_address_line] if args.key?(:second_address_line)
522
+ @state = args[:state] if args.key?(:state)
523
+ @urbanization = args[:urbanization] if args.key?(:urbanization)
524
+ @zip_code = args[:zip_code] if args.key?(:zip_code)
525
+ @zip_code_extension = args[:zip_code_extension] if args.key?(:zip_code_extension)
526
+ end
527
+ end
528
+
529
+ # The USPS data for the address. `uspsData` is not guaranteed to be fully
530
+ # populated for every US or PR address sent to the Address Validation API. It's
531
+ # recommended to integrate the backup address fields in the response if you
532
+ # utilize uspsData as the primary part of the response.
533
+ class GoogleMapsAddressvalidationV1UspsData
534
+ include Google::Apis::Core::Hashable
535
+
536
+ # Abbreviated city.
537
+ # Corresponds to the JSON property `abbreviatedCity`
538
+ # @return [String]
539
+ attr_accessor :abbreviated_city
540
+
541
+ # Type of the address record that matches the input address. * `F`: FIRM. This
542
+ # is a match to a Firm Record, which is the finest level of match available for
543
+ # an address. * `G`: GENERAL DELIVERY. This is a match to a General Delivery
544
+ # record. * `H`: BUILDING / APARTMENT. This is a match to a Building or
545
+ # Apartment record. * `P`: POST OFFICE BOX. This is a match to a Post Office Box.
546
+ # * `R`: RURAL ROUTE or HIGHWAY CONTRACT: This is a match to either a Rural
547
+ # Route or a Highway Contract record, both of which may have associated Box
548
+ # Number ranges. * `S`: STREET RECORD: This is a match to a Street record
549
+ # containing a valid primary number range.
550
+ # Corresponds to the JSON property `addressRecordType`
551
+ # @return [String]
552
+ attr_accessor :address_record_type
553
+
554
+ # The carrier route code. A four character code consisting of a one letter
555
+ # prefix and a three digit route designator. Prefixes: * `C`: Carrier route (or
556
+ # city route) * `R`: Rural route * `H`: Highway Contract Route * `B`: Post
557
+ # Office Box Section * `G`: General delivery unit
558
+ # Corresponds to the JSON property `carrierRoute`
559
+ # @return [String]
560
+ attr_accessor :carrier_route
561
+
562
+ # Carrier route rate sort indicator.
563
+ # Corresponds to the JSON property `carrierRouteIndicator`
564
+ # @return [String]
565
+ attr_accessor :carrier_route_indicator
566
+
567
+ # Indicator that the request has been CASS processed.
568
+ # Corresponds to the JSON property `cassProcessed`
569
+ # @return [Boolean]
570
+ attr_accessor :cass_processed
571
+ alias_method :cass_processed?, :cass_processed
572
+
573
+ # County name.
574
+ # Corresponds to the JSON property `county`
575
+ # @return [String]
576
+ attr_accessor :county
577
+
578
+ # Indicator that a default address was found, but more specific addresses exists.
579
+ # Corresponds to the JSON property `defaultAddress`
580
+ # @return [Boolean]
581
+ attr_accessor :default_address
582
+ alias_method :default_address?, :default_address
583
+
584
+ # The delivery point check digit. This number is added to the end of the
585
+ # delivery_point_barcode for mechanically scanned mail. Adding all the digits of
586
+ # the delivery_point_barcode, delivery_point_check_digit, postal code, and ZIP+4
587
+ # together should yield a number divisible by 10.
588
+ # Corresponds to the JSON property `deliveryPointCheckDigit`
589
+ # @return [String]
590
+ attr_accessor :delivery_point_check_digit
591
+
592
+ # 2 digit delivery point code
593
+ # Corresponds to the JSON property `deliveryPointCode`
594
+ # @return [String]
595
+ attr_accessor :delivery_point_code
596
+
597
+ # Indicates if the address is a CMRA (Commercial Mail Receiving Agency)--a
598
+ # private business receiving mail for clients. Returns a single character. * `Y`:
599
+ # The address is a CMRA * `N`: The address is not a CMRA
600
+ # Corresponds to the JSON property `dpvCmra`
601
+ # @return [String]
602
+ attr_accessor :dpv_cmra
603
+
604
+ # The possible values for DPV confirmation. Returns a single character or
605
+ # returns no value. * `N`: Primary and any secondary number information failed
606
+ # to DPV confirm. * `D`: Address was DPV confirmed for the primary number only,
607
+ # and the secondary number information was missing. * `S`: Address was DPV
608
+ # confirmed for the primary number only, and the secondary number information
609
+ # was present but not confirmed. * `Y`: Address was DPV confirmed for primary
610
+ # and any secondary numbers. * Empty: If the response does not contain a `
611
+ # dpv_confirmation` value, the address was not submitted for DPV confirmation.
612
+ # Corresponds to the JSON property `dpvConfirmation`
613
+ # @return [String]
614
+ attr_accessor :dpv_confirmation
615
+
616
+ # Flag indicates addresses where USPS cannot knock on a door to deliver mail.
617
+ # Returns a single character. * `Y`: The door is not accessible. * `N`: No
618
+ # indication the door is not accessible.
619
+ # Corresponds to the JSON property `dpvDoorNotAccessible`
620
+ # @return [String]
621
+ attr_accessor :dpv_door_not_accessible
622
+
623
+ # Flag indicates mail is delivered to a single receptable at a site. Returns a
624
+ # single character. * `Y`: The mail is delivered to a single receptable at a
625
+ # site. * `N`: The mail is not delivered to a single receptable at a site.
626
+ # Corresponds to the JSON property `dpvDrop`
627
+ # @return [String]
628
+ attr_accessor :dpv_drop
629
+
630
+ # Indicates that more than one DPV return code is valid for the address. Returns
631
+ # a single character. * `Y`: Address was DPV confirmed for primary and any
632
+ # secondary numbers. * `N`: Primary and any secondary number information failed
633
+ # to DPV confirm. * `S`: Address was DPV confirmed for the primary number only,
634
+ # and the secondary number information was present by not confirmed, or a single
635
+ # trailing alpha on a primary number was dropped to make a DPV match and
636
+ # secondary information required. * `D`: Address was DPV confirmed for the
637
+ # primary number only, and the secondary number information was missing. * `R`:
638
+ # Address confirmed but assigned to phantom route R777 and R779 and USPS
639
+ # delivery is not provided.
640
+ # Corresponds to the JSON property `dpvEnhancedDeliveryCode`
641
+ # @return [String]
642
+ attr_accessor :dpv_enhanced_delivery_code
643
+
644
+ # The footnotes from delivery point validation. Multiple footnotes may be strung
645
+ # together in the same string. * `AA`: Input address matched to the ZIP+4 file *
646
+ # `A1`: Input address was not matched to the ZIP+4 file * `BB`: Matched to DPV (
647
+ # all components) * `CC`: Secondary number not matched and not required * `C1`:
648
+ # Secondary number not matched but required * `N1`: High-rise address missing
649
+ # secondary number * `M1`: Primary number missing * `M3`: Primary number invalid
650
+ # * `P1`: Input address PO, RR or HC box number missing * `P3`: Input address PO,
651
+ # RR, or HC Box number invalid * `F1`: Input address matched to a military
652
+ # address * `G1`: Input address matched to a general delivery address * `U1`:
653
+ # Input address matched to a unique ZIP code * `PB`: Input address matched to
654
+ # PBSA record * `RR`: DPV confirmed address with PMB information * `R1`: DPV
655
+ # confirmed address without PMB information * `R7`: Carrier Route R777 or R779
656
+ # record * `IA`: Informed Address identified * `TA`: Primary number matched by
657
+ # dropping a trailing alpha
658
+ # Corresponds to the JSON property `dpvFootnote`
659
+ # @return [String]
660
+ attr_accessor :dpv_footnote
661
+
662
+ # Flag indicates door is accessible, but package will not be left due to
663
+ # security concerns. Returns a single character. * `Y`: The package will not be
664
+ # left due to security concerns. * `N`: No indication the package will not be
665
+ # left due to security concerns.
666
+ # Corresponds to the JSON property `dpvNoSecureLocation`
667
+ # @return [String]
668
+ attr_accessor :dpv_no_secure_location
669
+
670
+ # Is this a no stat address or an active address? No stat addresses are ones
671
+ # which are not continuously occupied or addresses that the USPS does not
672
+ # service. Returns a single character. * `Y`: The address is not active * `N`:
673
+ # The address is active
674
+ # Corresponds to the JSON property `dpvNoStat`
675
+ # @return [String]
676
+ attr_accessor :dpv_no_stat
677
+
678
+ # Indicates the NoStat type. Returns a reason code as int. * `1`: IDA (Internal
679
+ # Drop Address) – Addresses that do not receive mail directly from the USPS but
680
+ # are delivered to a drop address that services them. * `2`: CDS - Addresses
681
+ # that have not yet become deliverable. For example, a new subdivision where
682
+ # lots and primary numbers have been determined, but no structure exists yet for
683
+ # occupancy. * `3`: Collision - Addresses that do not actually DPV confirm. * `4`
684
+ # : CMZ (College, Military and Other Types) - ZIP + 4 records USPS has
685
+ # incorporated into the data. * `5`: Regular - Indicates addresses not receiving
686
+ # delivery and the addresses are not counted as possible deliveries. * `6`:
687
+ # Secondary Required - The address requires secondary information.
688
+ # Corresponds to the JSON property `dpvNoStatReasonCode`
689
+ # @return [Fixnum]
690
+ attr_accessor :dpv_no_stat_reason_code
691
+
692
+ # Flag indicates mail delivery is not performed every day of the week. Returns a
693
+ # single character. * `Y`: The mail delivery is not performed every day of the
694
+ # week. * `N`: No indication the mail delivery is not performed every day of the
695
+ # week.
696
+ # Corresponds to the JSON property `dpvNonDeliveryDays`
697
+ # @return [String]
698
+ attr_accessor :dpv_non_delivery_days
699
+
700
+ # Integer identifying non-delivery days. It can be interrogated using bit flags:
701
+ # 0x40 – Sunday is a non-delivery day 0x20 – Monday is a non-delivery day 0x10 –
702
+ # Tuesday is a non-delivery day 0x08 – Wednesday is a non-delivery day 0x04 –
703
+ # Thursday is a non-delivery day 0x02 – Friday is a non-delivery day 0x01 –
704
+ # Saturday is a non-delivery day
705
+ # Corresponds to the JSON property `dpvNonDeliveryDaysValues`
706
+ # @return [Fixnum]
707
+ attr_accessor :dpv_non_delivery_days_values
708
+
709
+ # Indicates the address was matched to PBSA record. Returns a single character. *
710
+ # `Y`: The address was matched to PBSA record. * `N`: The address was not
711
+ # matched to PBSA record.
712
+ # Corresponds to the JSON property `dpvPbsa`
713
+ # @return [String]
714
+ attr_accessor :dpv_pbsa
715
+
716
+ # Indicates that mail is not delivered to the street address. Returns a single
717
+ # character. * `Y`: The mail is not delivered to the street address. * `N`: The
718
+ # mail is delivered to the street address.
719
+ # Corresponds to the JSON property `dpvThrowback`
720
+ # @return [String]
721
+ attr_accessor :dpv_throwback
722
+
723
+ # Is this place vacant? Returns a single character. * `Y`: The address is vacant
724
+ # * `N`: The address is not vacant
725
+ # Corresponds to the JSON property `dpvVacant`
726
+ # @return [String]
727
+ attr_accessor :dpv_vacant
728
+
729
+ # eLOT Ascending/Descending Flag (A/D).
730
+ # Corresponds to the JSON property `elotFlag`
731
+ # @return [String]
732
+ attr_accessor :elot_flag
733
+
734
+ # Enhanced Line of Travel (eLOT) number.
735
+ # Corresponds to the JSON property `elotNumber`
736
+ # @return [String]
737
+ attr_accessor :elot_number
738
+
739
+ # Error message for USPS data retrieval. This is populated when USPS processing
740
+ # is suspended because of the detection of artificially created addresses. The
741
+ # USPS data fields might not be populated when this error is present.
742
+ # Corresponds to the JSON property `errorMessage`
743
+ # @return [String]
744
+ attr_accessor :error_message
745
+
746
+ # The delivery address is matchable, but the EWS file indicates that an exact
747
+ # match will be available soon.
748
+ # Corresponds to the JSON property `ewsNoMatch`
749
+ # @return [Boolean]
750
+ attr_accessor :ews_no_match
751
+ alias_method :ews_no_match?, :ews_no_match
752
+
753
+ # FIPS county code.
754
+ # Corresponds to the JSON property `fipsCountyCode`
755
+ # @return [String]
756
+ attr_accessor :fips_county_code
757
+
758
+ # LACSLink indicator.
759
+ # Corresponds to the JSON property `lacsLinkIndicator`
760
+ # @return [String]
761
+ attr_accessor :lacs_link_indicator
762
+
763
+ # LACSLink return code.
764
+ # Corresponds to the JSON property `lacsLinkReturnCode`
765
+ # @return [String]
766
+ attr_accessor :lacs_link_return_code
767
+
768
+ # PMB (Private Mail Box) unit designator.
769
+ # Corresponds to the JSON property `pmbDesignator`
770
+ # @return [String]
771
+ attr_accessor :pmb_designator
772
+
773
+ # PMB (Private Mail Box) number;
774
+ # Corresponds to the JSON property `pmbNumber`
775
+ # @return [String]
776
+ attr_accessor :pmb_number
777
+
778
+ # PO Box only postal code.
779
+ # Corresponds to the JSON property `poBoxOnlyPostalCode`
780
+ # @return [Boolean]
781
+ attr_accessor :po_box_only_postal_code
782
+ alias_method :po_box_only_postal_code?, :po_box_only_postal_code
783
+
784
+ # Main post office city.
785
+ # Corresponds to the JSON property `postOfficeCity`
786
+ # @return [String]
787
+ attr_accessor :post_office_city
788
+
789
+ # Main post office state.
790
+ # Corresponds to the JSON property `postOfficeState`
791
+ # @return [String]
792
+ attr_accessor :post_office_state
793
+
794
+ # USPS representation of a US address.
795
+ # Corresponds to the JSON property `standardizedAddress`
796
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1UspsAddress]
797
+ attr_accessor :standardized_address
798
+
799
+ # Footnotes from matching a street or highrise record to suite information. If
800
+ # business name match is found, the secondary number is returned. * `A`:
801
+ # SuiteLink record match, business address improved. * `00`: No match, business
802
+ # address is not improved.
803
+ # Corresponds to the JSON property `suitelinkFootnote`
804
+ # @return [String]
805
+ attr_accessor :suitelink_footnote
806
+
807
+ def initialize(**args)
808
+ update!(**args)
809
+ end
810
+
811
+ # Update properties of this object
812
+ def update!(**args)
813
+ @abbreviated_city = args[:abbreviated_city] if args.key?(:abbreviated_city)
814
+ @address_record_type = args[:address_record_type] if args.key?(:address_record_type)
815
+ @carrier_route = args[:carrier_route] if args.key?(:carrier_route)
816
+ @carrier_route_indicator = args[:carrier_route_indicator] if args.key?(:carrier_route_indicator)
817
+ @cass_processed = args[:cass_processed] if args.key?(:cass_processed)
818
+ @county = args[:county] if args.key?(:county)
819
+ @default_address = args[:default_address] if args.key?(:default_address)
820
+ @delivery_point_check_digit = args[:delivery_point_check_digit] if args.key?(:delivery_point_check_digit)
821
+ @delivery_point_code = args[:delivery_point_code] if args.key?(:delivery_point_code)
822
+ @dpv_cmra = args[:dpv_cmra] if args.key?(:dpv_cmra)
823
+ @dpv_confirmation = args[:dpv_confirmation] if args.key?(:dpv_confirmation)
824
+ @dpv_door_not_accessible = args[:dpv_door_not_accessible] if args.key?(:dpv_door_not_accessible)
825
+ @dpv_drop = args[:dpv_drop] if args.key?(:dpv_drop)
826
+ @dpv_enhanced_delivery_code = args[:dpv_enhanced_delivery_code] if args.key?(:dpv_enhanced_delivery_code)
827
+ @dpv_footnote = args[:dpv_footnote] if args.key?(:dpv_footnote)
828
+ @dpv_no_secure_location = args[:dpv_no_secure_location] if args.key?(:dpv_no_secure_location)
829
+ @dpv_no_stat = args[:dpv_no_stat] if args.key?(:dpv_no_stat)
830
+ @dpv_no_stat_reason_code = args[:dpv_no_stat_reason_code] if args.key?(:dpv_no_stat_reason_code)
831
+ @dpv_non_delivery_days = args[:dpv_non_delivery_days] if args.key?(:dpv_non_delivery_days)
832
+ @dpv_non_delivery_days_values = args[:dpv_non_delivery_days_values] if args.key?(:dpv_non_delivery_days_values)
833
+ @dpv_pbsa = args[:dpv_pbsa] if args.key?(:dpv_pbsa)
834
+ @dpv_throwback = args[:dpv_throwback] if args.key?(:dpv_throwback)
835
+ @dpv_vacant = args[:dpv_vacant] if args.key?(:dpv_vacant)
836
+ @elot_flag = args[:elot_flag] if args.key?(:elot_flag)
837
+ @elot_number = args[:elot_number] if args.key?(:elot_number)
838
+ @error_message = args[:error_message] if args.key?(:error_message)
839
+ @ews_no_match = args[:ews_no_match] if args.key?(:ews_no_match)
840
+ @fips_county_code = args[:fips_county_code] if args.key?(:fips_county_code)
841
+ @lacs_link_indicator = args[:lacs_link_indicator] if args.key?(:lacs_link_indicator)
842
+ @lacs_link_return_code = args[:lacs_link_return_code] if args.key?(:lacs_link_return_code)
843
+ @pmb_designator = args[:pmb_designator] if args.key?(:pmb_designator)
844
+ @pmb_number = args[:pmb_number] if args.key?(:pmb_number)
845
+ @po_box_only_postal_code = args[:po_box_only_postal_code] if args.key?(:po_box_only_postal_code)
846
+ @post_office_city = args[:post_office_city] if args.key?(:post_office_city)
847
+ @post_office_state = args[:post_office_state] if args.key?(:post_office_state)
848
+ @standardized_address = args[:standardized_address] if args.key?(:standardized_address)
849
+ @suitelink_footnote = args[:suitelink_footnote] if args.key?(:suitelink_footnote)
850
+ end
851
+ end
852
+
853
+ # The request for validating an address.
854
+ class GoogleMapsAddressvalidationV1ValidateAddressRequest
855
+ include Google::Apis::Core::Hashable
856
+
857
+ # Represents a postal address, e.g. for postal delivery or payments addresses.
858
+ # Given a postal address, a postal service can deliver items to a premise, P.O.
859
+ # Box or similar. It is not intended to model geographical locations (roads,
860
+ # towns, mountains). In typical usage an address would be created via user input
861
+ # or from importing existing data, depending on the type of process. Advice on
862
+ # address input / editing: - Use an internationalization-ready address widget
863
+ # such as https://github.com/google/libaddressinput) - Users should not be
864
+ # presented with UI elements for input or editing of fields outside countries
865
+ # where that field is used. For more guidance on how to use this schema, please
866
+ # see: https://support.google.com/business/answer/6397478
867
+ # Corresponds to the JSON property `address`
868
+ # @return [Google::Apis::AddressvalidationV1::GoogleTypePostalAddress]
869
+ attr_accessor :address
870
+
871
+ # Enables USPS CASS compatible mode. This affects _only_ the [google.maps.
872
+ # addressvalidation.v1.ValidationResult.usps_data] field of [google.maps.
873
+ # addressvalidation.v1.ValidationResult]. Note: for USPS CASS enabled requests
874
+ # for addresses in Puerto Rico, a [google.type.PostalAddress.region_code] of the
875
+ # `address` must be provided as "PR", or an [google.type.PostalAddress.
876
+ # administrative_area] of the `address` must be provided as "Puerto Rico" (case-
877
+ # insensitive) or "PR". It's recommended to use a componentized `address`, or
878
+ # alternatively specify at least two [google.type.PostalAddress.address_lines]
879
+ # where the first line contains the street number and name and the second line
880
+ # contains the city, state, and zip code.
881
+ # Corresponds to the JSON property `enableUspsCass`
882
+ # @return [Boolean]
883
+ attr_accessor :enable_usps_cass
884
+ alias_method :enable_usps_cass?, :enable_usps_cass
885
+
886
+ # Preview: This feature is in Preview (pre-GA). Pre-GA products and features
887
+ # might have limited support, and changes to pre-GA products and features might
888
+ # not be compatible with other pre-GA versions. Pre-GA Offerings are covered by
889
+ # the [Google Maps Platform Service Specific Terms](https://cloud.google.com/
890
+ # maps-platform/terms/maps-service-terms). For more information, see the [launch
891
+ # stage descriptions](https://developers.google.com/maps/launch-stages). Enables
892
+ # the Address Validation API to include additional information in the response.
893
+ # Corresponds to the JSON property `languageOptions`
894
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1LanguageOptions]
895
+ attr_accessor :language_options
896
+
897
+ # This field must be empty for the first address validation request. If more
898
+ # requests are necessary to fully validate a single address (for example if the
899
+ # changes the user makes after the initial validation need to be re-validated),
900
+ # then each followup request must populate this field with the response_id from
901
+ # the very first response in the validation sequence.
902
+ # Corresponds to the JSON property `previousResponseId`
903
+ # @return [String]
904
+ attr_accessor :previous_response_id
905
+
906
+ # Optional. A string which identifies an Autocomplete session for billing
907
+ # purposes. Must be a URL and filename safe base64 string with at most 36 ASCII
908
+ # characters in length. Otherwise an INVALID_ARGUMENT error is returned. The
909
+ # session begins when the user makes an Autocomplete query, and concludes when
910
+ # they select a place and a call to Place Details or Address Validation is made.
911
+ # Each session can have multiple Autocomplete queries, followed by one Place
912
+ # Details or Address Validation request. The credentials used for each request
913
+ # within a session must belong to the same Google Cloud Console project. Once a
914
+ # session has concluded, the token is no longer valid; your app must generate a
915
+ # fresh token for each session. If the `sessionToken` parameter is omitted, or
916
+ # if you reuse a session token, the session is charged as if no session token
917
+ # was provided (each request is billed separately). Note: Address Validation can
918
+ # only be used in sessions with the Autocomplete (New) API, not the Autocomplete
919
+ # API. See https://developers.google.com/maps/documentation/places/web-service/
920
+ # session-pricing for more details.
921
+ # Corresponds to the JSON property `sessionToken`
922
+ # @return [String]
923
+ attr_accessor :session_token
924
+
925
+ def initialize(**args)
926
+ update!(**args)
927
+ end
928
+
929
+ # Update properties of this object
930
+ def update!(**args)
931
+ @address = args[:address] if args.key?(:address)
932
+ @enable_usps_cass = args[:enable_usps_cass] if args.key?(:enable_usps_cass)
933
+ @language_options = args[:language_options] if args.key?(:language_options)
934
+ @previous_response_id = args[:previous_response_id] if args.key?(:previous_response_id)
935
+ @session_token = args[:session_token] if args.key?(:session_token)
936
+ end
937
+ end
938
+
939
+ # The response to an address validation request.
940
+ class GoogleMapsAddressvalidationV1ValidateAddressResponse
941
+ include Google::Apis::Core::Hashable
942
+
943
+ # The UUID that identifies this response. If the address needs to be re-
944
+ # validated, this UUID *must* accompany the new request.
945
+ # Corresponds to the JSON property `responseId`
946
+ # @return [String]
947
+ attr_accessor :response_id
948
+
949
+ # The result of validating an address.
950
+ # Corresponds to the JSON property `result`
951
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1ValidationResult]
952
+ attr_accessor :result
953
+
954
+ def initialize(**args)
955
+ update!(**args)
956
+ end
957
+
958
+ # Update properties of this object
959
+ def update!(**args)
960
+ @response_id = args[:response_id] if args.key?(:response_id)
961
+ @result = args[:result] if args.key?(:result)
962
+ end
963
+ end
964
+
965
+ # The result of validating an address.
966
+ class GoogleMapsAddressvalidationV1ValidationResult
967
+ include Google::Apis::Core::Hashable
968
+
969
+ # Details of the post-processed address. Post-processing includes correcting
970
+ # misspelled parts of the address, replacing incorrect parts, and inferring
971
+ # missing parts.
972
+ # Corresponds to the JSON property `address`
973
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1Address]
974
+ attr_accessor :address
975
+
976
+ # Details of the post-processed address. Post-processing includes correcting
977
+ # misspelled parts of the address, replacing incorrect parts, and inferring
978
+ # missing parts.
979
+ # Corresponds to the JSON property `englishLatinAddress`
980
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1Address]
981
+ attr_accessor :english_latin_address
982
+
983
+ # Contains information about the place the input was geocoded to.
984
+ # Corresponds to the JSON property `geocode`
985
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1Geocode]
986
+ attr_accessor :geocode
987
+
988
+ # The metadata for the address. `metadata` is not guaranteed to be fully
989
+ # populated for every address sent to the Address Validation API.
990
+ # Corresponds to the JSON property `metadata`
991
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1AddressMetadata]
992
+ attr_accessor :metadata
993
+
994
+ # The USPS data for the address. `uspsData` is not guaranteed to be fully
995
+ # populated for every US or PR address sent to the Address Validation API. It's
996
+ # recommended to integrate the backup address fields in the response if you
997
+ # utilize uspsData as the primary part of the response.
998
+ # Corresponds to the JSON property `uspsData`
999
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1UspsData]
1000
+ attr_accessor :usps_data
1001
+
1002
+ # High level overview of the address validation result and geocode.
1003
+ # Corresponds to the JSON property `verdict`
1004
+ # @return [Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1Verdict]
1005
+ attr_accessor :verdict
1006
+
1007
+ def initialize(**args)
1008
+ update!(**args)
1009
+ end
1010
+
1011
+ # Update properties of this object
1012
+ def update!(**args)
1013
+ @address = args[:address] if args.key?(:address)
1014
+ @english_latin_address = args[:english_latin_address] if args.key?(:english_latin_address)
1015
+ @geocode = args[:geocode] if args.key?(:geocode)
1016
+ @metadata = args[:metadata] if args.key?(:metadata)
1017
+ @usps_data = args[:usps_data] if args.key?(:usps_data)
1018
+ @verdict = args[:verdict] if args.key?(:verdict)
1019
+ end
1020
+ end
1021
+
1022
+ # High level overview of the address validation result and geocode.
1023
+ class GoogleMapsAddressvalidationV1Verdict
1024
+ include Google::Apis::Core::Hashable
1025
+
1026
+ # The address is considered complete if there are no unresolved tokens, no
1027
+ # unexpected or missing address components. If unset, indicates that the value
1028
+ # is `false`. See `missing_component_types`, `unresolved_tokens` or `unexpected`
1029
+ # fields for more details.
1030
+ # Corresponds to the JSON property `addressComplete`
1031
+ # @return [Boolean]
1032
+ attr_accessor :address_complete
1033
+ alias_method :address_complete?, :address_complete
1034
+
1035
+ # Information about the granularity of the `geocode`. This can be understood as
1036
+ # the semantic meaning of how coarse or fine the geocoded location is. This can
1037
+ # differ from the `validation_granularity` above occasionally. For example, our
1038
+ # database might record the existence of an apartment number but do not have a
1039
+ # precise location for the apartment within a big apartment complex. In that
1040
+ # case, the `validation_granularity` will be `SUB_PREMISE` but the `
1041
+ # geocode_granularity` will be `PREMISE`.
1042
+ # Corresponds to the JSON property `geocodeGranularity`
1043
+ # @return [String]
1044
+ attr_accessor :geocode_granularity
1045
+
1046
+ # At least one address component was inferred (added) that wasn't in the input,
1047
+ # see [google.maps.addressvalidation.v1.Address.address_components] for details.
1048
+ # Corresponds to the JSON property `hasInferredComponents`
1049
+ # @return [Boolean]
1050
+ attr_accessor :has_inferred_components
1051
+ alias_method :has_inferred_components?, :has_inferred_components
1052
+
1053
+ # At least one address component was replaced, see [google.maps.
1054
+ # addressvalidation.v1.Address.address_components] for details.
1055
+ # Corresponds to the JSON property `hasReplacedComponents`
1056
+ # @return [Boolean]
1057
+ attr_accessor :has_replaced_components
1058
+ alias_method :has_replaced_components?, :has_replaced_components
1059
+
1060
+ # At least one address component cannot be categorized or validated, see [google.
1061
+ # maps.addressvalidation.v1.Address.address_components] for details.
1062
+ # Corresponds to the JSON property `hasUnconfirmedComponents`
1063
+ # @return [Boolean]
1064
+ attr_accessor :has_unconfirmed_components
1065
+ alias_method :has_unconfirmed_components?, :has_unconfirmed_components
1066
+
1067
+ # The granularity of the **input** address. This is the result of parsing the
1068
+ # input address and does not give any validation signals. For validation signals,
1069
+ # refer to `validation_granularity` below. For example, if the input address
1070
+ # includes a specific apartment number, then the `input_granularity` here will
1071
+ # be `SUB_PREMISE`. If we cannot match the apartment number in the databases or
1072
+ # the apartment number is invalid, the `validation_granularity` will likely be `
1073
+ # PREMISE` or below.
1074
+ # Corresponds to the JSON property `inputGranularity`
1075
+ # @return [String]
1076
+ attr_accessor :input_granularity
1077
+
1078
+ # The granularity level that the API can fully **validate** the address to. For
1079
+ # example, an `validation_granularity` of `PREMISE` indicates all address
1080
+ # components at the level of `PREMISE` or more coarse can be validated. Per
1081
+ # address component validation result can be found in [google.maps.
1082
+ # addressvalidation.v1.Address.address_components].
1083
+ # Corresponds to the JSON property `validationGranularity`
1084
+ # @return [String]
1085
+ attr_accessor :validation_granularity
1086
+
1087
+ def initialize(**args)
1088
+ update!(**args)
1089
+ end
1090
+
1091
+ # Update properties of this object
1092
+ def update!(**args)
1093
+ @address_complete = args[:address_complete] if args.key?(:address_complete)
1094
+ @geocode_granularity = args[:geocode_granularity] if args.key?(:geocode_granularity)
1095
+ @has_inferred_components = args[:has_inferred_components] if args.key?(:has_inferred_components)
1096
+ @has_replaced_components = args[:has_replaced_components] if args.key?(:has_replaced_components)
1097
+ @has_unconfirmed_components = args[:has_unconfirmed_components] if args.key?(:has_unconfirmed_components)
1098
+ @input_granularity = args[:input_granularity] if args.key?(:input_granularity)
1099
+ @validation_granularity = args[:validation_granularity] if args.key?(:validation_granularity)
1100
+ end
1101
+ end
1102
+
1103
+ # An object that represents a latitude/longitude pair. This is expressed as a
1104
+ # pair of doubles to represent degrees latitude and degrees longitude. Unless
1105
+ # specified otherwise, this object must conform to the WGS84 standard. Values
1106
+ # must be within normalized ranges.
1107
+ class GoogleTypeLatLng
1108
+ include Google::Apis::Core::Hashable
1109
+
1110
+ # The latitude in degrees. It must be in the range [-90.0, +90.0].
1111
+ # Corresponds to the JSON property `latitude`
1112
+ # @return [Float]
1113
+ attr_accessor :latitude
1114
+
1115
+ # The longitude in degrees. It must be in the range [-180.0, +180.0].
1116
+ # Corresponds to the JSON property `longitude`
1117
+ # @return [Float]
1118
+ attr_accessor :longitude
1119
+
1120
+ def initialize(**args)
1121
+ update!(**args)
1122
+ end
1123
+
1124
+ # Update properties of this object
1125
+ def update!(**args)
1126
+ @latitude = args[:latitude] if args.key?(:latitude)
1127
+ @longitude = args[:longitude] if args.key?(:longitude)
1128
+ end
1129
+ end
1130
+
1131
+ # Represents a postal address, e.g. for postal delivery or payments addresses.
1132
+ # Given a postal address, a postal service can deliver items to a premise, P.O.
1133
+ # Box or similar. It is not intended to model geographical locations (roads,
1134
+ # towns, mountains). In typical usage an address would be created via user input
1135
+ # or from importing existing data, depending on the type of process. Advice on
1136
+ # address input / editing: - Use an internationalization-ready address widget
1137
+ # such as https://github.com/google/libaddressinput) - Users should not be
1138
+ # presented with UI elements for input or editing of fields outside countries
1139
+ # where that field is used. For more guidance on how to use this schema, please
1140
+ # see: https://support.google.com/business/answer/6397478
1141
+ class GoogleTypePostalAddress
1142
+ include Google::Apis::Core::Hashable
1143
+
1144
+ # Unstructured address lines describing the lower levels of an address. Because
1145
+ # values in address_lines do not have type information and may sometimes contain
1146
+ # multiple values in a single field (e.g. "Austin, TX"), it is important that
1147
+ # the line order is clear. The order of address lines should be "envelope order"
1148
+ # for the country/region of the address. In places where this can vary (e.g.
1149
+ # Japan), address_language is used to make it explicit (e.g. "ja" for large-to-
1150
+ # small ordering and "ja-Latn" or "en" for small-to-large). This way, the most
1151
+ # specific line of an address can be selected based on the language. The minimum
1152
+ # permitted structural representation of an address consists of a region_code
1153
+ # with all remaining information placed in the address_lines. It would be
1154
+ # possible to format such an address very approximately without geocoding, but
1155
+ # no semantic reasoning could be made about any of the address components until
1156
+ # it was at least partially resolved. Creating an address only containing a
1157
+ # region_code and address_lines, and then geocoding is the recommended way to
1158
+ # handle completely unstructured addresses (as opposed to guessing which parts
1159
+ # of the address should be localities or administrative areas).
1160
+ # Corresponds to the JSON property `addressLines`
1161
+ # @return [Array<String>]
1162
+ attr_accessor :address_lines
1163
+
1164
+ # Optional. Highest administrative subdivision which is used for postal
1165
+ # addresses of a country or region. For example, this can be a state, a province,
1166
+ # an oblast, or a prefecture. Specifically, for Spain this is the province and
1167
+ # not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many
1168
+ # countries don't use an administrative area in postal addresses. E.g. in
1169
+ # Switzerland this should be left unpopulated.
1170
+ # Corresponds to the JSON property `administrativeArea`
1171
+ # @return [String]
1172
+ attr_accessor :administrative_area
1173
+
1174
+ # Optional. BCP-47 language code of the contents of this address (if known).
1175
+ # This is often the UI language of the input form or is expected to match one of
1176
+ # the languages used in the address' country/region, or their transliterated
1177
+ # equivalents. This can affect formatting in certain countries, but is not
1178
+ # critical to the correctness of the data and will never affect any validation
1179
+ # or other non-formatting related operations. If this value is not known, it
1180
+ # should be omitted (rather than specifying a possibly incorrect default).
1181
+ # Examples: "zh-Hant", "ja", "ja-Latn", "en".
1182
+ # Corresponds to the JSON property `languageCode`
1183
+ # @return [String]
1184
+ attr_accessor :language_code
1185
+
1186
+ # Optional. Generally refers to the city/town portion of the address. Examples:
1187
+ # US city, IT comune, UK post town. In regions of the world where localities are
1188
+ # not well defined or do not fit into this structure well, leave locality empty
1189
+ # and use address_lines.
1190
+ # Corresponds to the JSON property `locality`
1191
+ # @return [String]
1192
+ attr_accessor :locality
1193
+
1194
+ # Optional. The name of the organization at the address.
1195
+ # Corresponds to the JSON property `organization`
1196
+ # @return [String]
1197
+ attr_accessor :organization
1198
+
1199
+ # Optional. Postal code of the address. Not all countries use or require postal
1200
+ # codes to be present, but where they are used, they may trigger additional
1201
+ # validation with other parts of the address (e.g. state/zip validation in the U.
1202
+ # S.A.).
1203
+ # Corresponds to the JSON property `postalCode`
1204
+ # @return [String]
1205
+ attr_accessor :postal_code
1206
+
1207
+ # Optional. The recipient at the address. This field may, under certain
1208
+ # circumstances, contain multiline information. For example, it might contain "
1209
+ # care of" information.
1210
+ # Corresponds to the JSON property `recipients`
1211
+ # @return [Array<String>]
1212
+ attr_accessor :recipients
1213
+
1214
+ # Required. CLDR region code of the country/region of the address. This is never
1215
+ # inferred and it is up to the user to ensure the value is correct. See https://
1216
+ # cldr.unicode.org/ and https://www.unicode.org/cldr/charts/30/supplemental/
1217
+ # territory_information.html for details. Example: "CH" for Switzerland.
1218
+ # Corresponds to the JSON property `regionCode`
1219
+ # @return [String]
1220
+ attr_accessor :region_code
1221
+
1222
+ # The schema revision of the `PostalAddress`. This must be set to 0, which is
1223
+ # the latest revision. All new revisions **must** be backward compatible with
1224
+ # old revisions.
1225
+ # Corresponds to the JSON property `revision`
1226
+ # @return [Fixnum]
1227
+ attr_accessor :revision
1228
+
1229
+ # Optional. Additional, country-specific, sorting code. This is not used in most
1230
+ # regions. Where it is used, the value is either a string like "CEDEX",
1231
+ # optionally followed by a number (e.g. "CEDEX 7"), or just a number alone,
1232
+ # representing the "sector code" (Jamaica), "delivery area indicator" (Malawi)
1233
+ # or "post office indicator" (e.g. Côte d'Ivoire).
1234
+ # Corresponds to the JSON property `sortingCode`
1235
+ # @return [String]
1236
+ attr_accessor :sorting_code
1237
+
1238
+ # Optional. Sublocality of the address. For example, this can be neighborhoods,
1239
+ # boroughs, districts.
1240
+ # Corresponds to the JSON property `sublocality`
1241
+ # @return [String]
1242
+ attr_accessor :sublocality
1243
+
1244
+ def initialize(**args)
1245
+ update!(**args)
1246
+ end
1247
+
1248
+ # Update properties of this object
1249
+ def update!(**args)
1250
+ @address_lines = args[:address_lines] if args.key?(:address_lines)
1251
+ @administrative_area = args[:administrative_area] if args.key?(:administrative_area)
1252
+ @language_code = args[:language_code] if args.key?(:language_code)
1253
+ @locality = args[:locality] if args.key?(:locality)
1254
+ @organization = args[:organization] if args.key?(:organization)
1255
+ @postal_code = args[:postal_code] if args.key?(:postal_code)
1256
+ @recipients = args[:recipients] if args.key?(:recipients)
1257
+ @region_code = args[:region_code] if args.key?(:region_code)
1258
+ @revision = args[:revision] if args.key?(:revision)
1259
+ @sorting_code = args[:sorting_code] if args.key?(:sorting_code)
1260
+ @sublocality = args[:sublocality] if args.key?(:sublocality)
1261
+ end
1262
+ end
1263
+ end
1264
+ end
1265
+ end