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.



206
207
208
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 206

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



159
160
161
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 159

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)


166
167
168
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 166

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)


171
172
173
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 171

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)


177
178
179
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 177

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)


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

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)


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

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)


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

def unexpected
  @unexpected
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



211
212
213
214
215
216
217
218
219
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 211

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