google-apis-pollen_v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,182 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module PollenV1
24
+
25
+ class Color
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class Date
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class DayInfo
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class HttpBody
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class IndexInfo
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class LookupForecastResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class PlantDescription
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class PlantInfo
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class PollenTypeInfo
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class Color
80
+ # @private
81
+ class Representation < Google::Apis::Core::JsonRepresentation
82
+ property :alpha, as: 'alpha'
83
+ property :blue, as: 'blue'
84
+ property :green, as: 'green'
85
+ property :red, as: 'red'
86
+ end
87
+ end
88
+
89
+ class Date
90
+ # @private
91
+ class Representation < Google::Apis::Core::JsonRepresentation
92
+ property :day, as: 'day'
93
+ property :month, as: 'month'
94
+ property :year, as: 'year'
95
+ end
96
+ end
97
+
98
+ class DayInfo
99
+ # @private
100
+ class Representation < Google::Apis::Core::JsonRepresentation
101
+ property :date, as: 'date', class: Google::Apis::PollenV1::Date, decorator: Google::Apis::PollenV1::Date::Representation
102
+
103
+ collection :plant_info, as: 'plantInfo', class: Google::Apis::PollenV1::PlantInfo, decorator: Google::Apis::PollenV1::PlantInfo::Representation
104
+
105
+ collection :pollen_type_info, as: 'pollenTypeInfo', class: Google::Apis::PollenV1::PollenTypeInfo, decorator: Google::Apis::PollenV1::PollenTypeInfo::Representation
106
+
107
+ end
108
+ end
109
+
110
+ class HttpBody
111
+ # @private
112
+ class Representation < Google::Apis::Core::JsonRepresentation
113
+ property :content_type, as: 'contentType'
114
+ property :data, :base64 => true, as: 'data'
115
+ collection :extensions, as: 'extensions'
116
+ end
117
+ end
118
+
119
+ class IndexInfo
120
+ # @private
121
+ class Representation < Google::Apis::Core::JsonRepresentation
122
+ property :category, as: 'category'
123
+ property :code, as: 'code'
124
+ property :color, as: 'color', class: Google::Apis::PollenV1::Color, decorator: Google::Apis::PollenV1::Color::Representation
125
+
126
+ property :display_name, as: 'displayName'
127
+ property :index_description, as: 'indexDescription'
128
+ property :value, as: 'value'
129
+ end
130
+ end
131
+
132
+ class LookupForecastResponse
133
+ # @private
134
+ class Representation < Google::Apis::Core::JsonRepresentation
135
+ collection :daily_info, as: 'dailyInfo', class: Google::Apis::PollenV1::DayInfo, decorator: Google::Apis::PollenV1::DayInfo::Representation
136
+
137
+ property :next_page_token, as: 'nextPageToken'
138
+ property :region_code, as: 'regionCode'
139
+ end
140
+ end
141
+
142
+ class PlantDescription
143
+ # @private
144
+ class Representation < Google::Apis::Core::JsonRepresentation
145
+ property :cross_reaction, as: 'crossReaction'
146
+ property :family, as: 'family'
147
+ property :picture, as: 'picture'
148
+ property :picture_closeup, as: 'pictureCloseup'
149
+ property :season, as: 'season'
150
+ property :special_colors, as: 'specialColors'
151
+ property :special_shapes, as: 'specialShapes'
152
+ property :type, as: 'type'
153
+ end
154
+ end
155
+
156
+ class PlantInfo
157
+ # @private
158
+ class Representation < Google::Apis::Core::JsonRepresentation
159
+ property :code, as: 'code'
160
+ property :display_name, as: 'displayName'
161
+ property :in_season, as: 'inSeason'
162
+ property :index_info, as: 'indexInfo', class: Google::Apis::PollenV1::IndexInfo, decorator: Google::Apis::PollenV1::IndexInfo::Representation
163
+
164
+ property :plant_description, as: 'plantDescription', class: Google::Apis::PollenV1::PlantDescription, decorator: Google::Apis::PollenV1::PlantDescription::Representation
165
+
166
+ end
167
+ end
168
+
169
+ class PollenTypeInfo
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ property :code, as: 'code'
173
+ property :display_name, as: 'displayName'
174
+ collection :health_recommendations, as: 'healthRecommendations'
175
+ property :in_season, as: 'inSeason'
176
+ property :index_info, as: 'indexInfo', class: Google::Apis::PollenV1::IndexInfo, decorator: Google::Apis::PollenV1::IndexInfo::Representation
177
+
178
+ end
179
+ end
180
+ end
181
+ end
182
+ end
@@ -0,0 +1,165 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module PollenV1
23
+ # Pollen API
24
+ #
25
+ # The Pollen API.
26
+ #
27
+ # @example
28
+ # require 'google/apis/pollen_v1'
29
+ #
30
+ # Pollen = Google::Apis::PollenV1 # Alias the module
31
+ # service = Pollen::PollenService.new
32
+ #
33
+ # @see https://developers.google.com/maps/documentation/pollen
34
+ class PollenService < Google::Apis::Core::BaseService
35
+ DEFAULT_ENDPOINT_TEMPLATE = "https://pollen.$UNIVERSE_DOMAIN$/"
36
+
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
49
+ client_name: 'google-apis-pollen_v1',
50
+ client_version: Google::Apis::PollenV1::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Returns up to 5 days of daily pollen information in more than 65 countries, up
55
+ # to 1km resolution.
56
+ # @param [Fixnum] days
57
+ # Required. A number that indicates how many forecast days to request (minimum
58
+ # value 1, maximum value is 5).
59
+ # @param [String] language_code
60
+ # Optional. Allows the client to choose the language for the response. If data
61
+ # cannot be provided for that language the API uses the closest match. Allowed
62
+ # values rely on the IETF BCP-47 standard. Default value is "en".
63
+ # @param [Float] location_latitude
64
+ # The latitude in degrees. It must be in the range [-90.0, +90.0].
65
+ # @param [Float] location_longitude
66
+ # The longitude in degrees. It must be in the range [-180.0, +180.0].
67
+ # @param [Fixnum] page_size
68
+ # Optional. The maximum number of daily info records to return per page. The
69
+ # default and max value is 5 (5 days of data).
70
+ # @param [String] page_token
71
+ # Optional. A page token received from a previous daily call. It is used to
72
+ # retrieve the subsequent page. Note that when providing a value for the page
73
+ # token all other request parameters provided must match the previous call that
74
+ # provided the page token.
75
+ # @param [Boolean] plants_description
76
+ # Optional. Contains general information about plants, including details on
77
+ # their seasonality, special shapes and colors, information about allergic cross-
78
+ # reactions, and plant photos.
79
+ # @param [String] fields
80
+ # Selector specifying which fields to include in a partial response.
81
+ # @param [String] quota_user
82
+ # Available to use for quota purposes for server-side applications. Can be any
83
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
84
+ # @param [Google::Apis::RequestOptions] options
85
+ # Request-specific options
86
+ #
87
+ # @yield [result, err] Result & error if block supplied
88
+ # @yieldparam result [Google::Apis::PollenV1::LookupForecastResponse] parsed result object
89
+ # @yieldparam err [StandardError] error object if request failed
90
+ #
91
+ # @return [Google::Apis::PollenV1::LookupForecastResponse]
92
+ #
93
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
94
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
95
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
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)
97
+ command = make_simple_command(:get, 'v1/forecast:lookup', options)
98
+ command.response_representation = Google::Apis::PollenV1::LookupForecastResponse::Representation
99
+ command.response_class = Google::Apis::PollenV1::LookupForecastResponse
100
+ command.query['days'] = days unless days.nil?
101
+ command.query['languageCode'] = language_code unless language_code.nil?
102
+ command.query['location.latitude'] = location_latitude unless location_latitude.nil?
103
+ command.query['location.longitude'] = location_longitude unless location_longitude.nil?
104
+ command.query['pageSize'] = page_size unless page_size.nil?
105
+ command.query['pageToken'] = page_token unless page_token.nil?
106
+ command.query['plantsDescription'] = plants_description unless plants_description.nil?
107
+ command.query['fields'] = fields unless fields.nil?
108
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
109
+ execute_or_queue_command(command, &block)
110
+ end
111
+
112
+ # Returns a byte array containing the data of the tile PNG image.
113
+ # @param [String] map_type
114
+ # Required. The type of the pollen heatmap. Defines the combination of pollen
115
+ # type and index that the map will graphically represent.
116
+ # @param [Fixnum] zoom
117
+ # Required. The map's zoom level. Defines how large or small the contents of a
118
+ # map appear in a map view. * Zoom level 0 is the entire world in a single tile.
119
+ # * Zoom level 1 is the entire world in 4 tiles. * Zoom level 2 is the entire
120
+ # world in 16 tiles. * Zoom level 16 is the entire world in 65,536 tiles.
121
+ # Allowed values: 0-16
122
+ # @param [Fixnum] x
123
+ # Required. Defines the east-west point in the requested tile.
124
+ # @param [Fixnum] y
125
+ # Required. Defines the north-south point in the requested tile.
126
+ # @param [String] fields
127
+ # Selector specifying which fields to include in a partial response.
128
+ # @param [String] quota_user
129
+ # Available to use for quota purposes for server-side applications. Can be any
130
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
131
+ # @param [Google::Apis::RequestOptions] options
132
+ # Request-specific options
133
+ #
134
+ # @yield [result, err] Result & error if block supplied
135
+ # @yieldparam result [Google::Apis::PollenV1::HttpBody] parsed result object
136
+ # @yieldparam err [StandardError] error object if request failed
137
+ #
138
+ # @return [Google::Apis::PollenV1::HttpBody]
139
+ #
140
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
141
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
142
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
143
+ def lookup_map_type_heatmap_tile_heatmap_tile(map_type, zoom, x, y, fields: nil, quota_user: nil, options: nil, &block)
144
+ command = make_simple_command(:get, 'v1/mapTypes/{mapType}/heatmapTiles/{zoom}/{x}/{y}', options)
145
+ command.response_representation = Google::Apis::PollenV1::HttpBody::Representation
146
+ command.response_class = Google::Apis::PollenV1::HttpBody
147
+ command.params['mapType'] = map_type unless map_type.nil?
148
+ command.params['zoom'] = zoom unless zoom.nil?
149
+ command.params['x'] = x unless x.nil?
150
+ command.params['y'] = y unless y.nil?
151
+ command.query['fields'] = fields unless fields.nil?
152
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
153
+ execute_or_queue_command(command, &block)
154
+ end
155
+
156
+ protected
157
+
158
+ def apply_command_defaults(command)
159
+ command.query['key'] = key unless key.nil?
160
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
161
+ end
162
+ end
163
+ end
164
+ end
165
+ end
@@ -0,0 +1,36 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/pollen_v1/service.rb'
16
+ require 'google/apis/pollen_v1/classes.rb'
17
+ require 'google/apis/pollen_v1/representations.rb'
18
+ require 'google/apis/pollen_v1/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Pollen API
23
+ #
24
+ # The Pollen API.
25
+ #
26
+ # @see https://developers.google.com/maps/documentation/pollen
27
+ module PollenV1
28
+ # Version of the Pollen API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V1'
31
+
32
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
33
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/pollen_v1"
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-pollen_v1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-06-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.15.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.a
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.15.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.a
33
+ description: This is the simple REST client for Pollen API V1. Simple REST clients
34
+ are Ruby client libraries that provide access to Google services via their HTTP
35
+ REST API endpoints. These libraries are generated and updated automatically based
36
+ on the discovery documents published by the service, and they handle most concerns
37
+ such as authentication, pagination, retry, timeouts, and logging. You can use this
38
+ client to access the Pollen API, but note that some services may provide a separate
39
+ modern client that is easier to use.
40
+ email: googleapis-packages@google.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - ".yardopts"
46
+ - CHANGELOG.md
47
+ - LICENSE.md
48
+ - OVERVIEW.md
49
+ - lib/google-apis-pollen_v1.rb
50
+ - lib/google/apis/pollen_v1.rb
51
+ - lib/google/apis/pollen_v1/classes.rb
52
+ - lib/google/apis/pollen_v1/gem_version.rb
53
+ - lib/google/apis/pollen_v1/representations.rb
54
+ - lib/google/apis/pollen_v1/service.rb
55
+ homepage: https://github.com/google/google-api-ruby-client
56
+ licenses:
57
+ - Apache-2.0
58
+ metadata:
59
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-pollen_v1/CHANGELOG.md
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-pollen_v1/v0.1.0
62
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-pollen_v1
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '2.7'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubygems_version: 3.5.6
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Simple REST client for Pollen API V1
82
+ test_files: []