Class: Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1AddressComponent

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/addressvalidation_v1/classes.rb,
lib/google/apis/addressvalidation_v1/representations.rb,
lib/google/apis/addressvalidation_v1/representations.rb

Overview

Represents an address component, such as a street, city, or state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleMapsAddressvalidationV1AddressComponent

Returns a new instance of GoogleMapsAddressvalidationV1AddressComponent.



215
216
217
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 215

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#component_nameGoogle::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1ComponentName

A wrapper for the name of the component. Corresponds to the JSON property componentName



168
169
170
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 168

def component_name
  @component_name
end

#component_typeString

The type of the address component. See Table 2: Additional types returned by the Places service for a list of possible types. Corresponds to the JSON property componentType

Returns:

  • (String)


175
176
177
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 175

def component_type
  @component_type
end

#confirmation_levelString

Indicates the level of certainty that we have that the component is correct. Corresponds to the JSON property confirmationLevel

Returns:

  • (String)


180
181
182
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 180

def confirmation_level
  @confirmation_level
end

#inferredBoolean Also known as: inferred?

Indicates that the component was not part of the input, but we inferred it for the address location and believe it should be provided for a complete address. Corresponds to the JSON property inferred

Returns:

  • (Boolean)


186
187
188
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 186

def inferred
  @inferred
end

#replacedBoolean Also known as: replaced?

Indicates the name of the component was replaced with a completely different one, for example a wrong postal code being replaced with one that is correct for the address. This is not a cosmetic change, the input component has been changed to a different one. Corresponds to the JSON property replaced

Returns:

  • (Boolean)


195
196
197
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 195

def replaced
  @replaced
end

#spell_correctedBoolean Also known as: spell_corrected?

Indicates a correction to a misspelling in the component name. The API does not always flag changes from one spelling variant to another, such as when changing "centre" to "center". It also does not always flag common misspellings, such as when changing "Amphitheater Pkwy" to "Amphitheatre Pkwy". Corresponds to the JSON property spellCorrected

Returns:

  • (Boolean)


204
205
206
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 204

def spell_corrected
  @spell_corrected
end

#unexpectedBoolean Also known as: unexpected?

Indicates an address component that is not expected to be present in a postal address for the given region. We have retained it only because it was part of the input. Corresponds to the JSON property unexpected

Returns:

  • (Boolean)


212
213
214
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 212

def unexpected
  @unexpected
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



220
221
222
223
224
225
226
227
228
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 220

def update!(**args)
  @component_name = args[:component_name] if args.key?(:component_name)
  @component_type = args[:component_type] if args.key?(:component_type)
  @confirmation_level = args[:confirmation_level] if args.key?(:confirmation_level)
  @inferred = args[:inferred] if args.key?(:inferred)
  @replaced = args[:replaced] if args.key?(:replaced)
  @spell_corrected = args[:spell_corrected] if args.key?(:spell_corrected)
  @unexpected = args[:unexpected] if args.key?(:unexpected)
end