Class: Google::Apis::PollenV1::PollenService

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

Overview

Pollen API

The Pollen API.

Examples:

require 'google/apis/pollen_v1'

Pollen = Google::Apis::PollenV1 # Alias the module
service = Pollen::PollenService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePollenService

Returns a new instance of PollenService.



47
48
49
50
51
52
# File 'lib/google/apis/pollen_v1/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-pollen_v1',
        client_version: Google::Apis::PollenV1::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/pollen_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/pollen_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#lookup_forecast(days: nil, language_code: nil, location_latitude: nil, location_longitude: nil, page_size: nil, page_token: nil, plants_description: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PollenV1::LookupForecastResponse

Returns up to 5 days of daily pollen information in more than 65 countries, up to 1km resolution.

Parameters:

  • days (Fixnum) (defaults to: nil)

    Required. A number that indicates how many forecast days to request (minimum value 1, maximum value is 5).

  • language_code (String) (defaults to: nil)

    Optional. Allows the client to choose the language for the response. If data cannot be provided for that language, the API uses the closest match. Allowed values rely on the IETF BCP-47 standard. The default value is "en".

  • location_latitude (Float) (defaults to: nil)

    The latitude in degrees. It must be in the range [-90.0, +90.0].

  • location_longitude (Float) (defaults to: nil)

    The longitude in degrees. It must be in the range [-180.0, +180.0].

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of daily info records to return per page. The default and max value is 5, indicating 5 days of data.

  • page_token (String) (defaults to: nil)

    Optional. A page token received from a previous daily call. It is used to retrieve the subsequent page. Note that when providing a value for the page token, all other request parameters provided must match the previous call that provided the page token.

  • plants_description (Boolean) (defaults to: nil)

    Optional. Contains general information about plants, including details on their seasonality, special shapes and colors, information about allergic cross- reactions, and plant photos. The default value is "true".

  • 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



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/google/apis/pollen_v1/service.rb', line 96

def lookup_forecast(days: nil, language_code: nil, location_latitude: nil, location_longitude: nil, page_size: nil, page_token: nil, plants_description: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/forecast:lookup', options)
  command.response_representation = Google::Apis::PollenV1::LookupForecastResponse::Representation
  command.response_class = Google::Apis::PollenV1::LookupForecastResponse
  command.query['days'] = days unless days.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['location.latitude'] = location_latitude unless location_latitude.nil?
  command.query['location.longitude'] = location_longitude unless location_longitude.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['plantsDescription'] = plants_description unless plants_description.nil?
  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::PollenV1::HttpBody

Returns a byte array containing the data of the tile PNG image.

Parameters:

  • map_type (String)

    Required. The type of the pollen heatmap. Defines the combination of pollen type and index that the map will graphically represent.

  • 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



143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/google/apis/pollen_v1/service.rb', line 143

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::PollenV1::HttpBody::Representation
  command.response_class = Google::Apis::PollenV1::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