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.



564
565
566
# File 'lib/google/apis/places_v1/classes.rb', line 564

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)


527
528
529
# File 'lib/google/apis/places_v1/classes.rb', line 527

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)


533
534
535
# File 'lib/google/apis/places_v1/classes.rb', line 533

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)


539
540
541
# File 'lib/google/apis/places_v1/classes.rb', line 539

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



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

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



554
555
556
# File 'lib/google/apis/places_v1/classes.rb', line 554

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>)


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

def types
  @types
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



569
570
571
572
573
574
575
576
# File 'lib/google/apis/places_v1/classes.rb', line 569

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