@maxim_mazurok/gapi.client.airquality-v1 0.0.20240605

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.
Files changed (3) hide show
  1. package/index.d.ts +442 -0
  2. package/package.json +20 -0
  3. package/readme.md +86 -0
package/index.d.ts ADDED
@@ -0,0 +1,442 @@
1
+ /* Type definitions for non-npm package Air Quality API v1 0.0 */
2
+ // Project: https://developers.google.com/maps/documentation/air-quality
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+
8
+ // IMPORTANT
9
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
+ // Generated from: https://airquality.googleapis.com/$discovery/rest?version=v1
12
+ // Revision: 20240605
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Air Quality API v1 */
18
+ function load(
19
+ urlOrObject: 'https://airquality.googleapis.com/$discovery/rest?version=v1'
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'airquality', version: 'v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(name: 'airquality', version: 'v1', callback: () => any): void;
25
+
26
+ namespace airquality {
27
+ interface AdditionalInfo {
28
+ /** Text representing the pollutant's main health effects. */
29
+ effects?: string;
30
+ /** Text representing the pollutant's main emission sources. */
31
+ sources?: string;
32
+ }
33
+ interface AirQualityIndex {
34
+ /** The index's numeric score. Examples: 10, 100. The value is not normalized and should only be interpreted in the context of its related air-quality index. For non-numeric indexes, this field will not be returned. Note: This field should be used for calculations, graph display, etc. For displaying the index score, you should use the AQI display field. */
35
+ aqi?: number;
36
+ /** Textual representation of the index numeric score, that may include prefix or suffix symbols, which usually represents the worst index score. Example: >100 or 10+. Note: This field should be used when you want to display the index score. For non-numeric indexes, this field is empty. */
37
+ aqiDisplay?: string;
38
+ /** Textual classification of the index numeric score interpretation. For example: "Excellent air quality". */
39
+ category?: string;
40
+ /** The index's code. This field represents the index for programming purposes by using snake case instead of spaces. Examples: "uaqi", "fra_atmo". */
41
+ code?: string;
42
+ /** The color used to represent the AQI numeric score. */
43
+ color?: Color;
44
+ /** A human readable representation of the index name. Example: "AQI (US)" */
45
+ displayName?: string;
46
+ /** The chemical symbol of the dominant pollutant. For example: "CO". */
47
+ dominantPollutant?: string;
48
+ }
49
+ interface Color {
50
+ /** The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0). */
51
+ alpha?: number;
52
+ /** The amount of blue in the color as a value in the interval [0, 1]. */
53
+ blue?: number;
54
+ /** The amount of green in the color as a value in the interval [0, 1]. */
55
+ green?: number;
56
+ /** The amount of red in the color as a value in the interval [0, 1]. */
57
+ red?: number;
58
+ }
59
+ interface Concentration {
60
+ /** Units for measuring this pollutant concentration. */
61
+ units?: string;
62
+ /** Value of pollutant concentration. */
63
+ value?: number;
64
+ }
65
+ interface CustomLocalAqi {
66
+ /** The AQI to associate the country/region with. Value should be a [valid index](/maps/documentation/air-quality/laqis) code. */
67
+ aqi?: string;
68
+ /** The country/region requiring the custom AQI. Value should be provided using [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. */
69
+ regionCode?: string;
70
+ }
71
+ interface HealthRecommendations {
72
+ /** Sports and other strenuous outdoor activities. */
73
+ athletes?: string;
74
+ /** Younger populations including children, toddlers, and babies. */
75
+ children?: string;
76
+ /** Retirees and people older than the general population. */
77
+ elderly?: string;
78
+ /** No specific sensitivities. */
79
+ generalPopulation?: string;
80
+ /** Heart and circulatory system diseases. */
81
+ heartDiseasePopulation?: string;
82
+ /** Respiratory related problems and asthma suffers. */
83
+ lungDiseasePopulation?: string;
84
+ /** Women at all stages of pregnancy. */
85
+ pregnantWomen?: string;
86
+ }
87
+ interface HourInfo {
88
+ /** A rounded down timestamp indicating the time the data refers to in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. For example: "2014-10-02T15:00:00Z". */
89
+ dateTime?: string;
90
+ /** Health advice and recommended actions related to the reported air quality conditions. Recommendations are tailored differently for populations at risk, groups with greater sensitivities to pollutants, and the general population. */
91
+ healthRecommendations?: HealthRecommendations;
92
+ /** Based on the request parameters, this list will include (up to) two air quality indexes: - Universal AQI. Will be returned if the universalAqi boolean is set to true. - Local AQI. Will be returned if the LOCAL_AQI extra computation is specified. */
93
+ indexes?: AirQualityIndex[];
94
+ /** A list of pollutants affecting the location specified in the request. Note: This field will be returned only for requests that specified one or more of the following extra computations: POLLUTANT_ADDITIONAL_INFO, DOMINANT_POLLUTANT_CONCENTRATION, POLLUTANT_CONCENTRATION. */
95
+ pollutants?: Pollutant[];
96
+ }
97
+ interface HourlyForecast {
98
+ /** A rounded down timestamp indicating the time (hour) the data refers to in RFC3339 UTC "Zulu" format. For example: "2014-10-02T15:00:00Z". */
99
+ dateTime?: string;
100
+ /** Health advice and recommended actions related to the reported air quality conditions. Recommendations are tailored differently for populations at risk, groups with greater sensitivities to pollutants, and the general population. */
101
+ healthRecommendations?: HealthRecommendations;
102
+ /** Based on the request parameters, this list will include (up to) two air quality indexes: - Universal AQI. Will be returned if the `universal_aqi` boolean is set to true. - Local AQI. Will be returned if the LOCAL_AQI extra computation is specified. */
103
+ indexes?: AirQualityIndex[];
104
+ /** A list of pollutants affecting the location specified in the request. Note: This field will be returned only for requests that specified one or more of the following extra computations: POLLUTANT_ADDITIONAL_INFO, DOMINANT_POLLUTANT_CONCENTRATION, POLLUTANT_CONCENTRATION. */
105
+ pollutants?: Pollutant[];
106
+ }
107
+ interface HttpBody {
108
+ /** The HTTP Content-Type header value specifying the content type of the body. */
109
+ contentType?: string;
110
+ /** The HTTP request/response body as raw binary. */
111
+ data?: string;
112
+ /** Application specific response metadata. Must be set in the first response for streaming APIs. */
113
+ extensions?: Array<{[P in string]: any}>;
114
+ }
115
+ interface Interval {
116
+ /** Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. */
117
+ endTime?: string;
118
+ /** Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. */
119
+ startTime?: string;
120
+ }
121
+ interface LatLng {
122
+ /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
123
+ latitude?: number;
124
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */
125
+ longitude?: number;
126
+ }
127
+ interface LookupCurrentConditionsRequest {
128
+ /** Optional. Expresses a 'country/region to AQI' relationship. Pairs a country/region with a desired AQI so that air quality data that is required for that country/region will be displayed according to the chosen AQI. This parameter can be used to specify a non-default AQI for a given country, for example, to get the US EPA index for Canada rather than the default index for Canada. */
129
+ customLocalAqis?: CustomLocalAqi[];
130
+ /** Optional. Additional features that can be optionally enabled. Specifying extra computations will result in the relevant elements and fields to be returned in the response. */
131
+ extraComputations?: string[];
132
+ /** 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 standard. Default value is en. */
133
+ languageCode?: string;
134
+ /** Required. The longitude and latitude from which the API looks for air quality current conditions data. */
135
+ location?: LatLng;
136
+ /** Optional. Determines the color palette used for data provided by the 'Universal Air Quality Index' (UAQI). This color palette is relevant just for UAQI, other AQIs have a predetermined color palette that can't be controlled. */
137
+ uaqiColorPalette?: string;
138
+ /** Optional. If set to true, the Universal AQI will be included in the 'indexes' field of the response. Default value is true. */
139
+ universalAqi?: boolean;
140
+ }
141
+ interface LookupCurrentConditionsResponse {
142
+ /** A rounded down timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. For example: "2014-10-02T15:00:00Z". */
143
+ dateTime?: string;
144
+ /** Health advice and recommended actions related to the reported air quality conditions. Recommendations are tailored differently for populations at risk, groups with greater sensitivities to pollutants, and the general population. */
145
+ healthRecommendations?: HealthRecommendations;
146
+ /** Based on the request parameters, this list will include (up to) two air quality indexes: - Universal AQI. Will be returned if the universalAqi boolean is set to true. - Local AQI. Will be returned if the LOCAL_AQI extra computation is specified. */
147
+ indexes?: AirQualityIndex[];
148
+ /** A list of pollutants affecting the location specified in the request. Note: This field will be returned only for requests that specified one or more of the following extra computations: POLLUTANT_ADDITIONAL_INFO, DOMINANT_POLLUTANT_CONCENTRATION, POLLUTANT_CONCENTRATION. */
149
+ pollutants?: Pollutant[];
150
+ /** The ISO_3166-1 alpha-2 code of the country/region corresponding to the location provided in the request. This field might be omitted from the response if the location provided in the request resides in a disputed territory. */
151
+ regionCode?: string;
152
+ }
153
+ interface LookupForecastRequest {
154
+ /** Optional. Expresses a 'country/region to AQI' relationship. Pairs a country/region with a desired AQI so that air quality data that is required for that country/region will be displayed according to the chosen AQI. This parameter can be used to specify a non-default AQI for a given country, for example, to get the US EPA index for Canada rather than the default index for Canada. */
155
+ customLocalAqis?: CustomLocalAqi[];
156
+ /** A timestamp for which to return the data for a specific point in time. The timestamp is rounded to the previous exact hour. Note: this will return hourly data for the requested timestamp only (i.e. a single hourly info element). For example, a request sent where the date_time parameter is set to 2023-01-03T11:05:49Z will be rounded down to 2023-01-03T11:00:00Z. */
157
+ dateTime?: string;
158
+ /** Optional. Additional features that can be optionally enabled. Specifying extra computations will result in the relevant elements and fields to be returned in the response. */
159
+ extraComputations?: string[];
160
+ /** 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 standard (default = 'en'). */
161
+ languageCode?: string;
162
+ /** Required. The latitude and longitude for which the API looks for air quality data. */
163
+ location?: LatLng;
164
+ /** Optional. The maximum number of hourly info records to return per page (default = 24). */
165
+ pageSize?: number;
166
+ /** Optional. A page token received from a previous forecast call. It is used to retrieve the subsequent page. */
167
+ pageToken?: string;
168
+ /** Indicates the start and end period for which to get the forecast data. The timestamp is rounded to the previous exact hour. */
169
+ period?: Interval;
170
+ /** Optional. Determines the color palette used for data provided by the 'Universal Air Quality Index' (UAQI). This color palette is relevant just for UAQI, other AQIs have a predetermined color palette that can't be controlled. */
171
+ uaqiColorPalette?: string;
172
+ /** Optional. If set to true, the Universal AQI will be included in the 'indexes' field of the response (default = true). */
173
+ universalAqi?: boolean;
174
+ }
175
+ interface LookupForecastResponse {
176
+ /** Optional. Contains the air quality information for each hour in the requested range. For example, if the request is for 48 hours of forecast there will be 48 elements of hourly forecasts. */
177
+ hourlyForecasts?: HourlyForecast[];
178
+ /** Optional. The token to retrieve the next page. */
179
+ nextPageToken?: string;
180
+ /** Optional. The ISO_3166-1 alpha-2 code of the country/region corresponding to the location provided in the request. This field might be omitted from the response if the location provided in the request resides in a disputed territory. */
181
+ regionCode?: string;
182
+ }
183
+ interface LookupHistoryRequest {
184
+ /** Optional. Expresses a 'country/region to AQI' relationship. Pairs a country/region with a desired AQI so that air quality data that is required for that country/region will be displayed according to the chosen AQI. This parameter can be used to specify a non-default AQI for a given country, for example, to get the US EPA index for Canada rather than the default index for Canada. */
185
+ customLocalAqis?: CustomLocalAqi[];
186
+ /** A timestamp for which to return historical data. The timestamp is rounded to the previous exact hour. Note: this will return hourly data for the requested timestamp only (i.e. a single hourly info element). For example, a request sent where the dateTime parameter is set to 2023-01-03T11:05:49Z will be rounded down to 2023-01-03T11:00:00Z. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". */
187
+ dateTime?: string;
188
+ /** Optional. Additional features that can be optionally enabled. Specifying extra computations will result in the relevant elements and fields to be returned in the response. */
189
+ extraComputations?: string[];
190
+ /** Number from 1 to 720 that indicates the hours range for the request. For example: A value of 48 will yield data from the last 48 hours. */
191
+ hours?: number;
192
+ /** 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 standard. Default value is en. */
193
+ languageCode?: string;
194
+ /** Required. The latitude and longitude for which the API looks for air quality history data. */
195
+ location?: LatLng;
196
+ /** Optional. The maximum number of hourly info records to return per page. The default is 72 and the max value is 168 (7 days of data). */
197
+ pageSize?: number;
198
+ /** Optional. A page token received from a previous history call. It is used to retrieve the subsequent page. Note that when providing a value for this parameter all other parameters provided must match the call that provided the page token (the previous call). */
199
+ pageToken?: string;
200
+ /** Indicates the start and end period for which to get the historical data. The timestamp is rounded to the previous exact hour. */
201
+ period?: Interval;
202
+ /** Optional. Determines the color palette used for data provided by the 'Universal Air Quality Index' (UAQI). This color palette is relevant just for UAQI, other AQIs have a predetermined color palette that can't be controlled. */
203
+ uaqiColorPalette?: string;
204
+ /** Optional. If set to true, the Universal AQI will be included in the 'indexes' field of the response. Default value is true. */
205
+ universalAqi?: boolean;
206
+ }
207
+ interface LookupHistoryResponse {
208
+ /** Optional. Contains the air quality information for each hour in the requested range. For example, if the request is for 48 hours of history there will be 48 elements of hourly info. */
209
+ hoursInfo?: HourInfo[];
210
+ /** Optional. The token to retrieve the next page. */
211
+ nextPageToken?: string;
212
+ /** Optional. The ISO_3166-1 alpha-2 code of the country/region corresponding to the location provided in the request. This field might be omitted from the response if the location provided in the request resides in a disputed territory. */
213
+ regionCode?: string;
214
+ }
215
+ interface Pollutant {
216
+ /** Additional information about the pollutant. */
217
+ additionalInfo?: AdditionalInfo;
218
+ /** The pollutant's code name. For example: "so2". A list of all available codes could be found [here](/maps/documentation/air-quality/pollutants#reported_pollutants). */
219
+ code?: string;
220
+ /** The pollutant's concentration level measured by one of the standard air pollutation measure units. */
221
+ concentration?: Concentration;
222
+ /** The pollutant's display name. For example: "NOx". */
223
+ displayName?: string;
224
+ /** The pollutant's full name. For chemical compounds, this is the IUPAC name. Example: "Sulfur Dioxide". For more information about the IUPAC names table, see https://iupac.org/what-we-do/periodic-table-of-elements/ */
225
+ fullName?: string;
226
+ }
227
+ interface CurrentConditionsResource {
228
+ /** 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. */
229
+ lookup(request: {
230
+ /** V1 error format. */
231
+ '$.xgafv'?: string;
232
+ /** OAuth access token. */
233
+ access_token?: string;
234
+ /** Data format for response. */
235
+ alt?: string;
236
+ /** JSONP */
237
+ callback?: string;
238
+ /** Selector specifying which fields to include in a partial response. */
239
+ fields?: string;
240
+ /** 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. */
241
+ key?: string;
242
+ /** OAuth 2.0 token for the current user. */
243
+ oauth_token?: string;
244
+ /** Returns response with indentations and line breaks. */
245
+ prettyPrint?: boolean;
246
+ /** 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. */
247
+ quotaUser?: string;
248
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
249
+ upload_protocol?: string;
250
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
251
+ uploadType?: string;
252
+ /** Request body */
253
+ resource: LookupCurrentConditionsRequest;
254
+ }): Request<LookupCurrentConditionsResponse>;
255
+ lookup(
256
+ request: {
257
+ /** V1 error format. */
258
+ '$.xgafv'?: string;
259
+ /** OAuth access token. */
260
+ access_token?: string;
261
+ /** Data format for response. */
262
+ alt?: string;
263
+ /** JSONP */
264
+ callback?: string;
265
+ /** Selector specifying which fields to include in a partial response. */
266
+ fields?: string;
267
+ /** 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. */
268
+ key?: string;
269
+ /** OAuth 2.0 token for the current user. */
270
+ oauth_token?: string;
271
+ /** Returns response with indentations and line breaks. */
272
+ prettyPrint?: boolean;
273
+ /** 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. */
274
+ quotaUser?: string;
275
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
276
+ upload_protocol?: string;
277
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
278
+ uploadType?: string;
279
+ },
280
+ body: LookupCurrentConditionsRequest
281
+ ): Request<LookupCurrentConditionsResponse>;
282
+ }
283
+ interface ForecastResource {
284
+ /** Returns air quality forecast for a specific location for a given time range. */
285
+ lookup(request: {
286
+ /** V1 error format. */
287
+ '$.xgafv'?: string;
288
+ /** OAuth access token. */
289
+ access_token?: string;
290
+ /** Data format for response. */
291
+ alt?: string;
292
+ /** JSONP */
293
+ callback?: string;
294
+ /** Selector specifying which fields to include in a partial response. */
295
+ fields?: string;
296
+ /** 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. */
297
+ key?: string;
298
+ /** OAuth 2.0 token for the current user. */
299
+ oauth_token?: string;
300
+ /** Returns response with indentations and line breaks. */
301
+ prettyPrint?: boolean;
302
+ /** 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. */
303
+ quotaUser?: string;
304
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
305
+ upload_protocol?: string;
306
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
307
+ uploadType?: string;
308
+ /** Request body */
309
+ resource: LookupForecastRequest;
310
+ }): Request<LookupForecastResponse>;
311
+ lookup(
312
+ request: {
313
+ /** V1 error format. */
314
+ '$.xgafv'?: string;
315
+ /** OAuth access token. */
316
+ access_token?: string;
317
+ /** Data format for response. */
318
+ alt?: string;
319
+ /** JSONP */
320
+ callback?: string;
321
+ /** Selector specifying which fields to include in a partial response. */
322
+ fields?: string;
323
+ /** 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. */
324
+ key?: string;
325
+ /** OAuth 2.0 token for the current user. */
326
+ oauth_token?: string;
327
+ /** Returns response with indentations and line breaks. */
328
+ prettyPrint?: boolean;
329
+ /** 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. */
330
+ quotaUser?: string;
331
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
332
+ upload_protocol?: string;
333
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
334
+ uploadType?: string;
335
+ },
336
+ body: LookupForecastRequest
337
+ ): Request<LookupForecastResponse>;
338
+ }
339
+ interface HistoryResource {
340
+ /** Returns air quality history for a specific location for a given time range. */
341
+ lookup(request: {
342
+ /** V1 error format. */
343
+ '$.xgafv'?: string;
344
+ /** OAuth access token. */
345
+ access_token?: string;
346
+ /** Data format for response. */
347
+ alt?: string;
348
+ /** JSONP */
349
+ callback?: string;
350
+ /** Selector specifying which fields to include in a partial response. */
351
+ fields?: string;
352
+ /** 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. */
353
+ key?: string;
354
+ /** OAuth 2.0 token for the current user. */
355
+ oauth_token?: string;
356
+ /** Returns response with indentations and line breaks. */
357
+ prettyPrint?: boolean;
358
+ /** 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. */
359
+ quotaUser?: string;
360
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
361
+ upload_protocol?: string;
362
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
363
+ uploadType?: string;
364
+ /** Request body */
365
+ resource: LookupHistoryRequest;
366
+ }): Request<LookupHistoryResponse>;
367
+ lookup(
368
+ request: {
369
+ /** V1 error format. */
370
+ '$.xgafv'?: string;
371
+ /** OAuth access token. */
372
+ access_token?: string;
373
+ /** Data format for response. */
374
+ alt?: string;
375
+ /** JSONP */
376
+ callback?: string;
377
+ /** Selector specifying which fields to include in a partial response. */
378
+ fields?: string;
379
+ /** 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. */
380
+ key?: string;
381
+ /** OAuth 2.0 token for the current user. */
382
+ oauth_token?: string;
383
+ /** Returns response with indentations and line breaks. */
384
+ prettyPrint?: boolean;
385
+ /** 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. */
386
+ quotaUser?: string;
387
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
388
+ upload_protocol?: string;
389
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
390
+ uploadType?: string;
391
+ },
392
+ body: LookupHistoryRequest
393
+ ): Request<LookupHistoryResponse>;
394
+ }
395
+ interface HeatmapTilesResource {
396
+ /** Returns a bytes array containing the data of the tile PNG image. */
397
+ lookupHeatmapTile(request?: {
398
+ /** V1 error format. */
399
+ '$.xgafv'?: string;
400
+ /** OAuth access token. */
401
+ access_token?: string;
402
+ /** Data format for response. */
403
+ alt?: string;
404
+ /** JSONP */
405
+ callback?: string;
406
+ /** Selector specifying which fields to include in a partial response. */
407
+ fields?: string;
408
+ /** 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. */
409
+ key?: string;
410
+ /** 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 */
411
+ mapType: string;
412
+ /** OAuth 2.0 token for the current user. */
413
+ oauth_token?: string;
414
+ /** Returns response with indentations and line breaks. */
415
+ prettyPrint?: boolean;
416
+ /** 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. */
417
+ quotaUser?: string;
418
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
419
+ upload_protocol?: string;
420
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
421
+ uploadType?: string;
422
+ /** Required. Defines the east-west point in the requested tile. */
423
+ x: number;
424
+ /** Required. Defines the north-south point in the requested tile. */
425
+ y: number;
426
+ /** 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 */
427
+ zoom: number;
428
+ }): Request<HttpBody>;
429
+ }
430
+ interface MapTypesResource {
431
+ heatmapTiles: HeatmapTilesResource;
432
+ }
433
+
434
+ const currentConditions: CurrentConditionsResource;
435
+
436
+ const forecast: ForecastResource;
437
+
438
+ const history: HistoryResource;
439
+
440
+ const mapTypes: MapTypesResource;
441
+ }
442
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.airquality-v1",
3
+ "version": "0.0.20240605",
4
+ "description": "TypeScript typings for Air Quality API v1",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
13
+ "url": "https://maxim.mazurok.com"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery-v1": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,86 @@
1
+ # TypeScript typings for Air Quality API v1
2
+
3
+ The Air Quality API.
4
+ For detailed description please check [documentation](https://developers.google.com/maps/documentation/air-quality).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Air Quality API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.airquality-v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load(
29
+ 'https://airquality.googleapis.com/$discovery/rest?version=v1',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.airquality
33
+ }
34
+ );
35
+ ```
36
+
37
+ ```typescript
38
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
39
+ gapi.client.load('airquality', 'v1', () => {
40
+ // now we can use:
41
+ // gapi.client.airquality
42
+ });
43
+ ```
44
+
45
+ Don't forget to authenticate your client before sending any request to resources:
46
+
47
+ ```typescript
48
+ // declare client_id registered in Google Developers Console
49
+ var client_id = '',
50
+ scope = [
51
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
52
+ 'https://www.googleapis.com/auth/cloud-platform',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ {client_id: client_id, scope: scope, immediate: immediate},
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ }
66
+ );
67
+ ```
68
+
69
+ After that you can use Air Quality API resources: <!-- TODO: make this work for multiple namespaces -->
70
+
71
+ ```typescript
72
+ /*
73
+ 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.
74
+ */
75
+ await gapi.client.airquality.currentConditions.lookup({});
76
+
77
+ /*
78
+ Returns air quality forecast for a specific location for a given time range.
79
+ */
80
+ await gapi.client.airquality.forecast.lookup({});
81
+
82
+ /*
83
+ Returns air quality history for a specific location for a given time range.
84
+ */
85
+ await gapi.client.airquality.history.lookup({});
86
+ ```