Class: Google::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction

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

Overview

Prediction results for a Place Autocomplete prediction.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction

Returns a new instance of GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionPlacePrediction.



572
573
574
# File 'lib/google/apis/places_v1/classes.rb', line 572

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

Instance Attribute Details

#distance_metersFixnum

The length of the geodesic in meters from origin if origin is specified. Certain predictions such as routes may not populate this field. Corresponds to the JSON property distanceMeters

Returns:

  • (Fixnum)


535
536
537
# File 'lib/google/apis/places_v1/classes.rb', line 535

def distance_meters
  @distance_meters
end

#placeString

The resource name of the suggested Place. This name can be used in other APIs that accept Place names. Corresponds to the JSON property place

Returns:

  • (String)


541
542
543
# File 'lib/google/apis/places_v1/classes.rb', line 541

def place
  @place
end

#place_idString

The unique identifier of the suggested Place. This identifier can be used in other APIs that accept Place IDs. Corresponds to the JSON property placeId

Returns:

  • (String)


547
548
549
# File 'lib/google/apis/places_v1/classes.rb', line 547

def place_id
  @place_id
end

#structured_formatGoogle::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionStructuredFormat

Contains a breakdown of a Place or query prediction into main text and secondary text. For Place predictions, the main text contains the specific name of the Place. For query predictions, the main text contains the query. The secondary text contains additional disambiguating features (such as a city or region) to further identify the Place or refine the query. Corresponds to the JSON property structuredFormat



556
557
558
# File 'lib/google/apis/places_v1/classes.rb', line 556

def structured_format
  @structured_format
end

#textGoogle::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesResponseSuggestionFormattableText

Text representing a Place or query prediction. The text may be used as is or formatted. Corresponds to the JSON property text



562
563
564
# File 'lib/google/apis/places_v1/classes.rb', line 562

def text
  @text
end

#typesArray<String>

List of types that apply to this Place from Table A or Table B in https:// developers.google.com/maps/documentation/places/web-service/place-types. A type is a categorization of a Place. Places with shared types will share similar characteristics. Corresponds to the JSON property types

Returns:

  • (Array<String>)


570
571
572
# File 'lib/google/apis/places_v1/classes.rb', line 570

def types
  @types
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



577
578
579
580
581
582
583
584
# File 'lib/google/apis/places_v1/classes.rb', line 577

def update!(**args)
  @distance_meters = args[:distance_meters] if args.key?(:distance_meters)
  @place = args[:place] if args.key?(:place)
  @place_id = args[:place_id] if args.key?(:place_id)
  @structured_format = args[:structured_format] if args.key?(:structured_format)
  @text = args[:text] if args.key?(:text)
  @types = args[:types] if args.key?(:types)
end