Class: Google::Apis::PlacesV1::MapsPlacesService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::PlacesV1::MapsPlacesService
- Defined in:
- lib/google/apis/places_v1/service.rb
Overview
Places API (New)
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://places.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#autocomplete_place(google_maps_places_v1_autocomplete_places_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesResponse
Returns predictions for the given input.
-
#get_place(name, language_code: nil, region_code: nil, session_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1Place
Get the details of a place based on its resource name, which is a string in the
places/
place_id`` format. -
#get_place_photo_media(name, max_height_px: nil, max_width_px: nil, skip_http_redirect: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1PhotoMedia
Get a photo media with a photo reference string.
-
#initialize ⇒ MapsPlacesService
constructor
A new instance of MapsPlacesService.
-
#search_place_nearby(google_maps_places_v1_search_nearby_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchNearbyResponse
Search for places near locations.
-
#search_place_text(google_maps_places_v1_search_text_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse
Text query based place search.
Constructor Details
#initialize ⇒ MapsPlacesService
Returns a new instance of MapsPlacesService.
47 48 49 50 51 52 |
# File 'lib/google/apis/places_v1/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-places_v1', client_version: Google::Apis::PlacesV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
40 41 42 |
# File 'lib/google/apis/places_v1/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'lib/google/apis/places_v1/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#autocomplete_place(google_maps_places_v1_autocomplete_places_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesResponse
Returns predictions for the given input.
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/google/apis/places_v1/service.rb', line 73 def autocomplete_place(google_maps_places_v1_autocomplete_places_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/places:autocomplete', ) command.request_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesRequest::Representation command.request_object = google_maps_places_v1_autocomplete_places_request_object command.response_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesResponse::Representation command.response_class = Google::Apis::PlacesV1::GoogleMapsPlacesV1AutocompletePlacesResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_place(name, language_code: nil, region_code: nil, session_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1Place
Get the details of a place based on its resource name, which is a string in
the places/
place_id`` format.
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/google/apis/places_v1/service.rb', line 136 def get_place(name, language_code: nil, region_code: nil, session_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1Place::Representation command.response_class = Google::Apis::PlacesV1::GoogleMapsPlacesV1Place command.params['name'] = name unless name.nil? command.query['languageCode'] = language_code unless language_code.nil? command.query['regionCode'] = region_code unless region_code.nil? command.query['sessionToken'] = session_token unless session_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_place_photo_media(name, max_height_px: nil, max_width_px: nil, skip_http_redirect: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1PhotoMedia
Get a photo media with a photo reference string.
258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/google/apis/places_v1/service.rb', line 258 def get_place_photo_media(name, max_height_px: nil, max_width_px: nil, skip_http_redirect: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1PhotoMedia::Representation command.response_class = Google::Apis::PlacesV1::GoogleMapsPlacesV1PhotoMedia command.params['name'] = name unless name.nil? command.query['maxHeightPx'] = max_height_px unless max_height_px.nil? command.query['maxWidthPx'] = max_width_px unless max_width_px.nil? command.query['skipHttpRedirect'] = skip_http_redirect unless skip_http_redirect.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#search_place_nearby(google_maps_places_v1_search_nearby_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchNearbyResponse
Search for places near locations.
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/google/apis/places_v1/service.rb', line 168 def search_place_nearby(google_maps_places_v1_search_nearby_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/places:searchNearby', ) command.request_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchNearbyRequest::Representation command.request_object = google_maps_places_v1_search_nearby_request_object command.response_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchNearbyResponse::Representation command.response_class = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchNearbyResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#search_place_text(google_maps_places_v1_search_text_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse
Text query based place search.
198 199 200 201 202 203 204 205 206 207 |
# File 'lib/google/apis/places_v1/service.rb', line 198 def search_place_text(google_maps_places_v1_search_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/places:searchText', ) command.request_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequest::Representation command.request_object = google_maps_places_v1_search_text_request_object command.response_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse::Representation command.response_class = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |