Class: Google::Apis::AirqualityV1::AirQualityService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/airquality_v1/service.rb

Overview

Air Quality API

The Air Quality API.

Examples:

require 'google/apis/airquality_v1'

Airquality = Google::Apis::AirqualityV1 # Alias the module
service = Airquality::AirQualityService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://airquality.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAirQualityService

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

#keyString

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.

Returns:

  • (String)

    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_userString

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.

Returns:

  • (String)

    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.

Parameters:

  • lookup_current_conditions_request_object (Google::Apis::AirqualityV1::LookupCurrentConditionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • lookup_forecast_request_object (Google::Apis::AirqualityV1::LookupForecastRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • lookup_history_request_object (Google::Apis::AirqualityV1::LookupHistoryRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • map_type (String)

    Required. The type of the air quality heatmap. Defines the pollutant that the map will graphically represent. Allowed values: - UAQI_RED_GREEN (UAQI, red- green palette) - UAQI_INDIGO_PERSIAN (UAQI, indigo-persian palette) - PM25_INDIGO_PERSIAN - GBR_DEFRA - DEU_UBA - CAN_EC - FRA_ATMO - US_AQI

  • zoom (Fixnum)

    Required. The map's zoom level. Defines how large or small the contents of a map appear in a map view. Zoom level 0 is the entire world in a single tile. Zoom level 1 is the entire world in 4 tiles. Zoom level 2 is the entire world in 16 tiles. Zoom level 16 is the entire world in 65,536 tiles. Allowed values: 0-16

  • x (Fixnum)

    Required. Defines the east-west point in the requested tile.

  • y (Fixnum)

    Required. Defines the north-south point in the requested tile.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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}', options)
  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