Class: Google::Apis::AirqualityV1::AirQualityService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::AirqualityV1::AirQualityService
- Defined in:
- lib/google/apis/airquality_v1/service.rb
Overview
Air Quality API
The Air Quality API.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://airquality.$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
-
#initialize ⇒ AirQualityService
constructor
A new instance of AirQualityService.
-
#lookup_current_conditions(lookup_current_conditions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::LookupCurrentConditionsResponse
The Current Conditions endpoint provides hourly air quality information in more than 100 countries, up to a 500 x 500 meters resolution.
-
#lookup_forecast(lookup_forecast_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::LookupForecastResponse
Returns air quality forecast for a specific location for a given time range.
-
#lookup_history(lookup_history_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::LookupHistoryResponse
Returns air quality history for a specific location for a given time range.
-
#lookup_map_type_heatmap_tile_heatmap_tile(map_type, zoom, x, y, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::HttpBody
Returns a bytes array containing the data of the tile PNG image.
Constructor Details
#initialize ⇒ AirQualityService
Returns a new instance of AirQualityService.
47 48 49 50 51 52 |
# File 'lib/google/apis/airquality_v1/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-airquality_v1', client_version: Google::Apis::AirqualityV1::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/airquality_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/airquality_v1/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#lookup_current_conditions(lookup_current_conditions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::LookupCurrentConditionsResponse
The Current Conditions endpoint provides hourly air quality information in more than 100 countries, up to a 500 x 500 meters resolution. Includes over 70 local indexes and global air quality index and categories.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/google/apis/airquality_v1/service.rb', line 75 def lookup_current_conditions(lookup_current_conditions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/currentConditions:lookup', ) command.request_representation = Google::Apis::AirqualityV1::LookupCurrentConditionsRequest::Representation command.request_object = lookup_current_conditions_request_object command.response_representation = Google::Apis::AirqualityV1::LookupCurrentConditionsResponse::Representation command.response_class = Google::Apis::AirqualityV1::LookupCurrentConditionsResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#lookup_forecast(lookup_forecast_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::LookupForecastResponse
Returns air quality forecast for a specific location for a given time range.
105 106 107 108 109 110 111 112 113 114 |
# File 'lib/google/apis/airquality_v1/service.rb', line 105 def lookup_forecast(lookup_forecast_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/forecast:lookup', ) command.request_representation = Google::Apis::AirqualityV1::LookupForecastRequest::Representation command.request_object = lookup_forecast_request_object command.response_representation = Google::Apis::AirqualityV1::LookupForecastResponse::Representation command.response_class = Google::Apis::AirqualityV1::LookupForecastResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#lookup_history(lookup_history_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::LookupHistoryResponse
Returns air quality history for a specific location for a given time range.
135 136 137 138 139 140 141 142 143 144 |
# File 'lib/google/apis/airquality_v1/service.rb', line 135 def lookup_history(lookup_history_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/history:lookup', ) command.request_representation = Google::Apis::AirqualityV1::LookupHistoryRequest::Representation command.request_object = lookup_history_request_object command.response_representation = Google::Apis::AirqualityV1::LookupHistoryResponse::Representation command.response_class = Google::Apis::AirqualityV1::LookupHistoryResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#lookup_map_type_heatmap_tile_heatmap_tile(map_type, zoom, x, y, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AirqualityV1::HttpBody
Returns a bytes array containing the data of the tile PNG image.
179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/google/apis/airquality_v1/service.rb', line 179 def lookup_map_type_heatmap_tile_heatmap_tile(map_type, zoom, x, y, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/mapTypes/{mapType}/heatmapTiles/{zoom}/{x}/{y}', ) command.response_representation = Google::Apis::AirqualityV1::HttpBody::Representation command.response_class = Google::Apis::AirqualityV1::HttpBody command.params['mapType'] = map_type unless map_type.nil? command.params['zoom'] = zoom unless zoom.nil? command.params['x'] = x unless x.nil? command.params['y'] = y unless y.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |