address.proto 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.maps.addressvalidation.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/type/postal_address.proto";
  18. option cc_enable_arenas = true;
  19. option csharp_namespace = "Google.Maps.AddressValidation.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/maps/addressvalidation/v1;addressvalidation";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "AddressProto";
  23. option java_package = "com.google.maps.addressvalidation.v1";
  24. option objc_class_prefix = "GMPAVV1";
  25. option php_namespace = "Google\\Maps\\AddressValidation\\V1";
  26. option ruby_package = "Google::Maps::AddressValidation::V1";
  27. // Details of the address parsed from the input.
  28. message Address {
  29. // The corrected address, formatted as a single-line address following the
  30. // address formatting rules of the region where the address is located.
  31. string formatted_address = 2;
  32. // The validated address represented as a postal address.
  33. google.type.PostalAddress postal_address = 3;
  34. // Unordered list. The individual address components of the formatted and corrected address,
  35. // along with validation information. This provides information on the
  36. // validation status of the individual components.
  37. //
  38. // Address components are not ordered in a particular way. Do not make any
  39. // assumptions on the ordering of the address components in the list.
  40. repeated AddressComponent address_components = 4 [(google.api.field_behavior) = UNORDERED_LIST];
  41. // The types of components that were expected to be present in a correctly
  42. // formatted mailing address but were not found in the input AND could
  43. // not be inferred. Components of this type are not present in
  44. // `formatted_address`, `postal_address`, or `address_components`. An
  45. // example might be `['street_number', 'route']` for an input like
  46. // "Boulder, Colorado, 80301, USA". The list of possible types can be found
  47. // [here](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types).
  48. repeated string missing_component_types = 5;
  49. // The types of the components that are present in the `address_components`
  50. // but could not be confirmed to be correct. This field is provided for the
  51. // sake of convenience: its contents are equivalent to iterating through the
  52. // `address_components` to find the types of all the components where the
  53. // [confirmation_level][google.maps.addressvalidation.v1.AddressComponent.confirmation_level]
  54. // is not
  55. // [CONFIRMED][google.maps.addressvalidation.v1.AddressComponent.ConfirmationLevel.CONFIRMED]
  56. // or the
  57. // [inferred][google.maps.addressvalidation.v1.AddressComponent.inferred]
  58. // flag is not set to `true`. The list of possible types can be found
  59. // [here](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types).
  60. repeated string unconfirmed_component_types = 6;
  61. // Any tokens in the input that could not be resolved. This might be an
  62. // input that was not recognized as a valid part of an address (for example
  63. // in an input like "123235253253 Main St, San Francisco, CA, 94105", the
  64. // unresolved tokens may look like `["123235253253"]` since that does not
  65. // look like a valid street number.
  66. repeated string unresolved_tokens = 7;
  67. }
  68. // Represents an address component, such as a street, city, or state.
  69. message AddressComponent {
  70. // The different possible values for confirmation levels.
  71. enum ConfirmationLevel {
  72. // Default value. This value is unused.
  73. CONFIRMATION_LEVEL_UNSPECIFIED = 0;
  74. // We were able to verify that this component exists and makes sense in the
  75. // context of the rest of the address.
  76. CONFIRMED = 1;
  77. // This component could not be confirmed, but it is plausible that it
  78. // exists. For example, a street number within a known valid range of
  79. // numbers on a street where specific house numbers are not known.
  80. UNCONFIRMED_BUT_PLAUSIBLE = 2;
  81. // This component was not confirmed and is likely to be wrong. For
  82. // example, a neighborhood that does not fit the rest of the address.
  83. UNCONFIRMED_AND_SUSPICIOUS = 3;
  84. }
  85. // The name for this component.
  86. ComponentName component_name = 1;
  87. // The type of the address component. See
  88. // [Table 2: Additional types returned by the Places
  89. // service](https://developers.google.com/places/web-service/supported_types#table2)
  90. // for a list of possible types.
  91. string component_type = 2;
  92. // Indicates the level of certainty that we have that the component
  93. // is correct.
  94. ConfirmationLevel confirmation_level = 3;
  95. // Indicates that the component was not part of the input, but we
  96. // inferred it for the address location and believe it should be provided
  97. // for a complete address.
  98. bool inferred = 4;
  99. // Indicates the spelling of the component name was corrected in a minor way,
  100. // for example by switching two characters that appeared in the wrong order.
  101. // This indicates a cosmetic change.
  102. bool spell_corrected = 5;
  103. // Indicates the name of the component was replaced with a completely
  104. // different one, for example a wrong postal code being replaced with one that
  105. // is correct for the address. This is not a cosmetic change, the input
  106. // component has been changed to a different one.
  107. bool replaced = 6;
  108. // Indicates an address component that is not expected to be present in a
  109. // postal address for the given region. We have retained it only because it
  110. // was part of the input.
  111. bool unexpected = 7;
  112. }
  113. // A wrapper for the name of the component.
  114. message ComponentName {
  115. // The name text. For example, "5th Avenue" for a street name or "1253" for a
  116. // street number.
  117. string text = 1;
  118. // The BCP-47 language code. This will not be present if the component name is
  119. // not associated with a language, such as a street number.
  120. string language_code = 2;
  121. }