Class: Google::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesRequest

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

Request proto for AutocompletePlaces.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleMapsPlacesV1AutocompletePlacesRequest

Returns a new instance of GoogleMapsPlacesV1AutocompletePlacesRequest.



200
201
202
# File 'lib/google/apis/places_v1/classes.rb', line 200

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

Instance Attribute Details

#include_query_predictionsBoolean Also known as: include_query_predictions?

Optional. If true, the response will include both Place and query predictions. Otherwise the response will only return Place predictions. Corresponds to the JSON property includeQueryPredictions

Returns:

  • (Boolean)


110
111
112
# File 'lib/google/apis/places_v1/classes.rb', line 110

def include_query_predictions
  @include_query_predictions
end

#included_primary_typesArray<String>

Optional. Included primary Place type (for example, "restaurant" or " gas_station") in Place Types (https://developers.google.com/maps/documentation/ places/web-service/place-types), or only (regions), or only (cities). A Place is only returned if its primary type is included in this list. Up to 5 values can be specified. If no types are specified, all Place types are returned. Corresponds to the JSON property includedPrimaryTypes

Returns:

  • (Array<String>)


121
122
123
# File 'lib/google/apis/places_v1/classes.rb', line 121

def included_primary_types
  @included_primary_types
end

#included_region_codesArray<String>

Optional. Only include results in the specified regions, specified as up to 15 CLDR two-character region codes. An empty set will not restrict the results. If both location_restriction and included_region_codes are set, the results will be located in the area of intersection. Corresponds to the JSON property includedRegionCodes

Returns:

  • (Array<String>)


129
130
131
# File 'lib/google/apis/places_v1/classes.rb', line 129

def included_region_codes
  @included_region_codes
end

#inputString

Required. The text string on which to search. Corresponds to the JSON property input

Returns:

  • (String)


134
135
136
# File 'lib/google/apis/places_v1/classes.rb', line 134

def input
  @input
end

#input_offsetFixnum

Optional. A zero-based Unicode character offset of input indicating the cursor position in input. The cursor position may influence what predictions are returned. If empty, defaults to the length of input. Corresponds to the JSON property inputOffset

Returns:

  • (Fixnum)


141
142
143
# File 'lib/google/apis/places_v1/classes.rb', line 141

def input_offset
  @input_offset
end

#language_codeString

Optional. The language in which to return results. Defaults to en-US. The results may be in mixed languages if the language used in input is different from language_code or if the returned Place does not have a translation from the local language to language_code. Corresponds to the JSON property languageCode

Returns:

  • (String)


149
150
151
# File 'lib/google/apis/places_v1/classes.rb', line 149

def language_code
  @language_code
end

#location_biasGoogle::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesRequestLocationBias

The region to search. The results may be biased around the specified region. Corresponds to the JSON property locationBias



154
155
156
# File 'lib/google/apis/places_v1/classes.rb', line 154

def location_bias
  @location_bias
end

#location_restrictionGoogle::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesRequestLocationRestriction

The region to search. The results will be restricted to the specified region. Corresponds to the JSON property locationRestriction



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

def location_restriction
  @location_restriction
end

#originGoogle::Apis::PlacesV1::GoogleTypeLatLng

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. Corresponds to the JSON property origin



167
168
169
# File 'lib/google/apis/places_v1/classes.rb', line 167

def origin
  @origin
end

#region_codeString

Optional. The region code, specified as a CLDR two-character region code. This affects address formatting, result ranking, and may influence what results are returned. This does not restrict results to the specified region. To restrict results to a region, use region_code_restriction. Corresponds to the JSON property regionCode

Returns:

  • (String)


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

def region_code
  @region_code
end

#session_tokenString

Optional. A string which identifies an Autocomplete session for billing purposes. Must be a URL and filename safe base64 string with at most 36 ASCII characters in length. Otherwise an INVALID_ARGUMENT error is returned. The session begins when the user starts typing a query, and concludes when they select a place and a call to Place Details or Address Validation is made. Each session can have multiple queries, followed by one Place Details or Address Validation request. The credentials used for each request within a session must belong to the same Google Cloud Console project. Once a session has concluded, the token is no longer valid; your app must generate a fresh token for each session. If the session_token parameter is omitted, or if you reuse a session token, the session is charged as if no session token was provided ( each request is billed separately). We recommend the following guidelines: * Use session tokens for all Place Autocomplete calls. * Generate a fresh token for each session. Using a version 4 UUID is recommended. * Ensure that the credentials used for all Place Autocomplete, Place Details, and Address Validation requests within a session belong to the same Cloud Console project.

  • Be sure to pass a unique session token for each new session. Using the same token for more than one session will result in each request being billed individually. Corresponds to the JSON property sessionToken

Returns:

  • (String)


198
199
200
# File 'lib/google/apis/places_v1/classes.rb', line 198

def session_token
  @session_token
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/google/apis/places_v1/classes.rb', line 205

def update!(**args)
  @include_query_predictions = args[:include_query_predictions] if args.key?(:include_query_predictions)
  @included_primary_types = args[:included_primary_types] if args.key?(:included_primary_types)
  @included_region_codes = args[:included_region_codes] if args.key?(:included_region_codes)
  @input = args[:input] if args.key?(:input)
  @input_offset = args[:input_offset] if args.key?(:input_offset)
  @language_code = args[:language_code] if args.key?(:language_code)
  @location_bias = args[:location_bias] if args.key?(:location_bias)
  @location_restriction = args[:location_restriction] if args.key?(:location_restriction)
  @origin = args[:origin] if args.key?(:origin)
  @region_code = args[:region_code] if args.key?(:region_code)
  @session_token = args[:session_token] if args.key?(:session_token)
end