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.



343
344
345
# File 'lib/google/apis/places_v1/classes.rb', line 343

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

Instance Attribute Details

#include_pure_service_area_businessesBoolean Also known as: include_pure_service_area_businesses?

Optional. Include pure service area businesses if the field is set to true. Pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers. Those businesses do not have a physical address or location on Google Maps. Places will not return fields including location, plus_code, and other location related fields for these businesses. Corresponds to the JSON property includePureServiceAreaBusinesses

Returns:

  • (Boolean)


246
247
248
# File 'lib/google/apis/places_v1/classes.rb', line 246

def include_pure_service_area_businesses
  @include_pure_service_area_businesses
end

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


253
254
255
# File 'lib/google/apis/places_v1/classes.rb', line 253

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


264
265
266
# File 'lib/google/apis/places_v1/classes.rb', line 264

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


272
273
274
# File 'lib/google/apis/places_v1/classes.rb', line 272

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)


277
278
279
# File 'lib/google/apis/places_v1/classes.rb', line 277

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)


284
285
286
# File 'lib/google/apis/places_v1/classes.rb', line 284

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)


292
293
294
# File 'lib/google/apis/places_v1/classes.rb', line 292

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



297
298
299
# File 'lib/google/apis/places_v1/classes.rb', line 297

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



302
303
304
# File 'lib/google/apis/places_v1/classes.rb', line 302

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



310
311
312
# File 'lib/google/apis/places_v1/classes.rb', line 310

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)


318
319
320
# File 'lib/google/apis/places_v1/classes.rb', line 318

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)


341
342
343
# File 'lib/google/apis/places_v1/classes.rb', line 341

def session_token
  @session_token
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/apis/places_v1/classes.rb', line 348

def update!(**args)
  @include_pure_service_area_businesses = args[:include_pure_service_area_businesses] if args.key?(:include_pure_service_area_businesses)
  @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