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)
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
-
#get_place(name, language_code: nil, region_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1Place
Get place details with a place id (in a name) string.
-
#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.
45 46 47 48 49 50 |
# File 'lib/google/apis/places_v1/service.rb', line 45 def initialize super('https://places.googleapis.com/', '', 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.
38 39 40 |
# File 'lib/google/apis/places_v1/service.rb', line 38 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.
43 44 45 |
# File 'lib/google/apis/places_v1/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#get_place(name, language_code: nil, region_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PlacesV1::GoogleMapsPlacesV1Place
Get place details with a place id (in a name) string.
84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/google/apis/places_v1/service.rb', line 84 def get_place(name, language_code: nil, region_code: 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['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.
202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/google/apis/places_v1/service.rb', line 202 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.
115 116 117 118 119 120 121 122 123 124 |
# File 'lib/google/apis/places_v1/service.rb', line 115 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.
145 146 147 148 149 150 151 152 153 154 |
# File 'lib/google/apis/places_v1/service.rb', line 145 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 |