@maxim_mazurok/gapi.client.places-v1 0.0.20230716

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.
package/index.d.ts ADDED
@@ -0,0 +1,533 @@
1
+ /* Type definitions for non-npm package Places API (New) v1 0.0 */
2
+ // Project: https://www.google.com
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://places.googleapis.com/$discovery/rest?version=v1
12
+ // Revision: 20230716
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Places API (New) v1 */
18
+ function load(urlOrObject: "https://places.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
19
+ /** @deprecated Please load APIs with discovery documents. */
20
+ function load(name: "places", version: "v1"): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: "places", version: "v1", callback: () => any): void;
23
+
24
+ namespace places {
25
+ interface GoogleGeoTypeViewport {
26
+ /** Required. The high point of the viewport. */
27
+ high?:
28
+ GoogleTypeLatLng;
29
+ /** Required. The low point of the viewport. */
30
+ low?:
31
+ GoogleTypeLatLng;
32
+ }
33
+ interface GoogleMapsPlacesV1Circle {
34
+ /** Required. Center latitude and longitude. The range of latitude must be within [-90.0, 90.0]. The range of the longitude must be within [-180.0, 180.0]. */
35
+ center?:
36
+ GoogleTypeLatLng;
37
+ /** Required. Radius measured in meters. The radius must be within [0.0, 50000.0]. */
38
+ radius?:
39
+ number;
40
+ }
41
+ interface GoogleMapsPlacesV1Int32Range {
42
+ /** Upper bound. If unset, behavior is documented on the range field. */
43
+ max?:
44
+ number;
45
+ /** Lower bound. If unset, behavior is documented on the range field. */
46
+ min?:
47
+ number;
48
+ }
49
+ interface GoogleMapsPlacesV1Place {
50
+ /** Output only. Repeated components for each locality level. */
51
+ addressComponents?:
52
+ GoogleMapsPlacesV1PlaceAddressComponent[];
53
+ /** Output only. The place's address in adr microformat: http://microformats.org/wiki/adr. */
54
+ adrFormatAddress?:
55
+ string;
56
+ /** Output only. A set of data provider that must be shown with this result. */
57
+ attributions?:
58
+ GoogleMapsPlacesV1PlaceAttribution[];
59
+ /** Output only. The business status for the place. */
60
+ businessStatus?:
61
+ string;
62
+ /** Output only. Specifies if the business supports curbside pickup. */
63
+ curbsidePickup?:
64
+ boolean;
65
+ /**
66
+ * Output only. The hours of operation for the next seven days (including today). The time period starts at midnight on the date of the request and ends at 11:59 pm six days later.
67
+ * This field includes the special_days subfield of all hours, set for dates that have exceptional hours.
68
+ */
69
+ currentOpeningHours?:
70
+ GoogleMapsPlacesV1PlaceOpeningHours;
71
+ /**
72
+ * Output only. Contains an array of entries for the next seven days including information about secondary hours of a business. Secondary hours are different from a business's main
73
+ * hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. This field populates the type subfield, which draws from a predefined list
74
+ * of opening hours types (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place. This field includes the special_days subfield of all hours, set for dates that
75
+ * have exceptional hours.
76
+ */
77
+ currentSecondaryOpeningHours?:
78
+ GoogleMapsPlacesV1PlaceOpeningHours[];
79
+ /** Output only. Specifies if the business supports delivery. */
80
+ delivery?:
81
+ boolean;
82
+ /** Output only. Specifies if the business supports indoor or outdoor seating options. */
83
+ dineIn?:
84
+ boolean;
85
+ /** Output only. The localized name of the place, suitable as a short human-readable description. For example, "Google Sydney", "Starbucks", "Pyrmont", etc. */
86
+ displayName?:
87
+ GoogleTypeLocalizedText;
88
+ /**
89
+ * Output only. Contains a summary of the place. A summary is comprised of a textual overview, and also includes the language code for these if applicable. Summary text must be
90
+ * presented as-is and can not be modified or altered.
91
+ */
92
+ editorialSummary?:
93
+ GoogleMapsPlacesV1PlaceEditorialSummary;
94
+ /** Output only. A full, human-readable address for this place. */
95
+ formattedAddress?:
96
+ string;
97
+ /** Output only. A URL providing more information about this place. */
98
+ googleMapsUri?:
99
+ string;
100
+ /** Output only. Background color for icon_mask in hex format, e.g. #909CE1. */
101
+ iconBackgroundColor?:
102
+ string;
103
+ /** Output only. A truncated URL to an v2 icon mask. User can access different icon type by appending type suffix to the end (eg, ".svg" or ".png"). */
104
+ iconMaskBaseUri?:
105
+ string;
106
+ /** Output only. The unique identifier of a place. */
107
+ id?:
108
+ string;
109
+ /** Output only. A human-readable phone number for the place, in international format. */
110
+ internationalPhoneNumber?:
111
+ string;
112
+ /** Output only. The position of this place. */
113
+ location?:
114
+ GoogleTypeLatLng;
115
+ /** Output only. An ID representing this place which may be used to look up this place again (a.k.a. the API "resource" name: places/). */
116
+ name?:
117
+ string;
118
+ /** Output only. A human-readable phone number for the place, in national format. */
119
+ nationalPhoneNumber?:
120
+ string;
121
+ /** Output only. The regular hours of operation. */
122
+ openingHours?:
123
+ GoogleMapsPlacesV1PlaceOpeningHours;
124
+ /** Output only. Plus code of the place location lat/long. */
125
+ plusCode?:
126
+ GoogleMapsPlacesV1PlacePlusCode;
127
+ /** Output only. Price level of the place. */
128
+ priceLevel?:
129
+ string;
130
+ /** Output only. A rating between 1.0 and 5.0, based on user reviews of this place. */
131
+ rating?:
132
+ number;
133
+ /** Output only. Specifies if the place supports reservations. */
134
+ reservable?:
135
+ boolean;
136
+ /** Output only. List of reviews about this place. */
137
+ reviews?:
138
+ GoogleMapsPlacesV1PlaceReview[];
139
+ /**
140
+ * Output only. Contains an array of entries for information about regular secondary hours of a business. Secondary hours are different from a business's main hours. For example, a
141
+ * restaurant can specify drive through hours or delivery hours as its secondary hours. This field populates the type subfield, which draws from a predefined list of opening hours
142
+ * types (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place.
143
+ */
144
+ secondaryOpeningHours?:
145
+ GoogleMapsPlacesV1PlaceOpeningHours[];
146
+ /** Output only. Specifies if the place serves beer. */
147
+ servesBeer?:
148
+ boolean;
149
+ /** Output only. Specifies if the place serves breakfast. */
150
+ servesBreakfast?:
151
+ boolean;
152
+ /** Output only. Specifies if the place serves brunch. */
153
+ servesBrunch?:
154
+ boolean;
155
+ /** Output only. Specifies if the place serves dinner. */
156
+ servesDinner?:
157
+ boolean;
158
+ /** Output only. Specifies if the place serves lunch. */
159
+ servesLunch?:
160
+ boolean;
161
+ /** Output only. Specifies if the place serves vegetarian food. */
162
+ servesVegetarianFood?:
163
+ boolean;
164
+ /** Output only. Specifies if the place serves wine. */
165
+ servesWine?:
166
+ boolean;
167
+ /** Output only. Specifies if the business supports takeout. */
168
+ takeout?:
169
+ boolean;
170
+ /** Output only. A set of type tags for this result. For example, "political" and "locality". */
171
+ types?:
172
+ string[];
173
+ /** Output only. The total number of reviews (with or without text) for this place. */
174
+ userRatingCount?:
175
+ number;
176
+ /**
177
+ * Output only. Number of minutes this place's timezone is currently offset from UTC. This is expressed in minutes to support timezones that are offset by fractions of an hour, e.g. X
178
+ * hours and 15 minutes.
179
+ */
180
+ utcOffsetMinutes?:
181
+ number;
182
+ /** Output only. A viewport suitable for displaying the place on an average-sized map. */
183
+ viewport?:
184
+ GoogleGeoTypeViewport;
185
+ /**
186
+ * Output only. The authoritative website for this place, e.g. a business' homepage. Note that for places that are part of a chain (e.g. an IKEA store), this will usually be the
187
+ * website for the individual store, not the overall chain.
188
+ */
189
+ websiteUri?:
190
+ string;
191
+ /** Output only. Specifies if the place has an entrance that is wheelchair-accessible. */
192
+ wheelchairAccessibleEntrance?:
193
+ boolean;
194
+ }
195
+ interface GoogleMapsPlacesV1PlaceAddressComponent {
196
+ /** Output only. The language used to format this components, in CLDR notation. */
197
+ languageCode?:
198
+ string;
199
+ /** Output only. The full text description or name of the address component. For example, an address component for the country Australia may have a long_name of "Australia". */
200
+ longText?:
201
+ string;
202
+ /** Output only. An abbreviated textual name for the address component, if available. For example, an address component for the country of Australia may have a short_name of "AU". */
203
+ shortText?:
204
+ string;
205
+ /** Output only. An array indicating the type(s) of the address component. */
206
+ types?:
207
+ string[];
208
+ }
209
+ interface GoogleMapsPlacesV1PlaceAttribution {
210
+ /** Output only. Name of the Place's data provider. */
211
+ provider?:
212
+ string;
213
+ /** Output only. URI to the Place's data provider. */
214
+ providerUri?:
215
+ string;
216
+ }
217
+ interface GoogleMapsPlacesV1PlaceEditorialSummary {
218
+ /**
219
+ * Output only. A summary is comprised of a textual overview, and also includes the language code for these if applicable. Summary text must be presented as-is and can not be modified
220
+ * or altered.
221
+ */
222
+ overview?:
223
+ GoogleTypeLocalizedText;
224
+ }
225
+ interface GoogleMapsPlacesV1PlaceOpeningHours {
226
+ /** Output only. Is this place open right now? Always present unless we lack time-of-day or timezone data for these opening hours. */
227
+ openNow?:
228
+ boolean;
229
+ /**
230
+ * Output only. The periods that this place is open during the week. The periods are in chronological order, starting with Sunday in the place-local timezone. An empty (but not absent)
231
+ * value indicates a place that is never open, e.g. because it is closed temporarily for renovations.
232
+ */
233
+ periods?:
234
+ GoogleMapsPlacesV1PlaceOpeningHoursOpeningHoursPeriod[];
235
+ /** Output only. A type string used to identify the type of secondary hours. */
236
+ secondaryHourType?:
237
+ string;
238
+ /**
239
+ * Output only. Structured information for special days that fall within the period that the returned opening hours cover. Special days are days that could impact the business hours of
240
+ * a place, e.g. Christmas day. Set for current_opening_hours and current_secondary_opening_hours if there are exceptional hours.
241
+ */
242
+ specialDays?:
243
+ GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay[];
244
+ /**
245
+ * Output only. Localized strings describing the opening hours of this place, one string for each day of the week. Will be empty if the hours are unknown or could not be converted to
246
+ * localized text. Example: "Sun: 18:00–06:00"
247
+ */
248
+ weekdayDescriptions?:
249
+ string[];
250
+ }
251
+ interface GoogleMapsPlacesV1PlaceOpeningHoursOpeningHoursPeriod {
252
+ /** Output only. The time that the place starts to be closed. */
253
+ close?:
254
+ GoogleMapsPlacesV1PlaceOpeningHoursOpeningHoursPeriodOpeningHoursPoint;
255
+ /** Output only. The time that the place starts to be open. */
256
+ open?:
257
+ GoogleMapsPlacesV1PlaceOpeningHoursOpeningHoursPeriodOpeningHoursPoint;
258
+ }
259
+ interface GoogleMapsPlacesV1PlaceOpeningHoursOpeningHoursPeriodOpeningHoursPoint {
260
+ /** Output only. Date in the local timezone for the place. */
261
+ date?:
262
+ GoogleTypeDate;
263
+ /** Output only. Date of the endpoint expressed in RFC3339 format in the local timezone for the place. For example 2010-12-31. */
264
+ dateDeprecated?:
265
+ string;
266
+ /** Output only. A day of the week, as an integer in the range 0-6. 0 is Sunday, 1 is Monday, etc. */
267
+ day?:
268
+ number;
269
+ /** Output only. The hour in 2 digits. Ranges from 00 to 23. */
270
+ hour?:
271
+ number;
272
+ /** Output only. The minute in 2 digits. Ranges from 00 to 59. */
273
+ minute?:
274
+ number;
275
+ /**
276
+ * Output only. Whether or not this endpoint was truncated. Truncation occurs when the real hours are outside the times we are willing to return hours between, so we truncate the hours
277
+ * back to these boundaries. This ensures that at most 24 * 7 hours from midnight of the day of the request are returned.
278
+ */
279
+ truncated?:
280
+ boolean;
281
+ }
282
+ interface GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay {
283
+ /** Output only. The date of this special day. */
284
+ date?:
285
+ GoogleTypeDate;
286
+ }
287
+ interface GoogleMapsPlacesV1PlacePlusCode {
288
+ /**
289
+ * Output only. Place's compound code, such as "33GV+HQ, Ramberg, Norway", containing the suffix of the global code and replacing the prefix with a formatted name of a reference
290
+ * entity.
291
+ */
292
+ compoundCode?:
293
+ string;
294
+ /** Output only. Place's global (full) code, such as "9FWM33GV+HQ", representing an 1/8000 by 1/8000 degree area (~14 by 14 meters). */
295
+ globalCode?:
296
+ string;
297
+ }
298
+ interface GoogleMapsPlacesV1PlaceReview {
299
+ /** Output only. The name of the review author. */
300
+ author?:
301
+ string;
302
+ /** Output only. The author's profile photo. */
303
+ authorPhotoUri?:
304
+ string;
305
+ /** Output only. A link to the review author's profile. */
306
+ authorUri?:
307
+ string;
308
+ /**
309
+ * Output only. A BCP-47 language code indicating the original language of the review. If the review has been translated, then original_language != language. This field contains the
310
+ * main language tag only, and not the secondary tag indicating country or region. For example, all the English reviews are tagged as 'en', and not 'en-AU' or 'en-UK' and so on.This
311
+ * field is empty if there is only a rating with no review text.
312
+ */
313
+ originalLanguageCode?:
314
+ string;
315
+ /** Output only. The review text in its original language. */
316
+ originalText?:
317
+ GoogleTypeLocalizedText;
318
+ /** Output only. Timestamp for the review, expressed in seconds since epoch. */
319
+ publishTime?:
320
+ string;
321
+ /** Output only. A whole number between 1.0 and 5.0, a.k.a. the number of stars. */
322
+ rating?:
323
+ number;
324
+ /** Output only. A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. */
325
+ relativePublishTimeDescription?:
326
+ string;
327
+ /** Output only. The localized text of the review. */
328
+ text?:
329
+ GoogleTypeLocalizedText;
330
+ /**
331
+ * Output only. A boolean value indicating if the review was translated from the original language it was written in. If a review has been translated, corresponding to a value of true,
332
+ * Google recommends that you indicate this to your users. For example, you can add the following string, “Translated by Google”, to the review.
333
+ */
334
+ translated?:
335
+ boolean;
336
+ }
337
+ interface GoogleMapsPlacesV1SearchTextRequest {
338
+ /** The requested place type. Full list of types supported: https://developers.google.com/places/supported_types. Only support one included type. */
339
+ includedType?:
340
+ string;
341
+ /**
342
+ * Place details will be displayed with the preferred language if available. If the language code is unspecified or unrecognized, place details of any language may be returned, with a
343
+ * preference for English if such details exist. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport.
344
+ */
345
+ languageCode?:
346
+ string;
347
+ /**
348
+ * [Deprecated!]The region to search. Setting location would usually yields better results. Recommended to set. This location serves as a bias unless strict_restriction is set to true,
349
+ * which turns the location to a strict restriction.
350
+ */
351
+ location?:
352
+ GoogleMapsPlacesV1SearchTextRequestLocation;
353
+ /** The region to search. This location serves as a bias which means results around given location might be returned. Cannot be set along with location_restriction. */
354
+ locationBias?:
355
+ GoogleMapsPlacesV1SearchTextRequestLocationBias;
356
+ /** The region to search. This location serves as a restriction which means results outside given location will not be returned. Cannot be set along with location_bias. */
357
+ locationRestriction?:
358
+ GoogleMapsPlacesV1SearchTextRequestLocationRestriction;
359
+ /**
360
+ * Maximum number of results to return. It must be between 1 and 20, inclusively. If the number is unset, it falls back to the upper limit. If the number is set to negative or exceeds
361
+ * the upper limit, an INVALID_ARGUMENT error is returned.
362
+ */
363
+ maxResultCount?:
364
+ number;
365
+ /**
366
+ * Filter out results whose average user rating is strictly less than this limit. A valid value must be an float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... ,
367
+ * 5.0] inclusively. This is to keep parity with LocalRefinement_UserRating. The input rating will round up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate
368
+ * all results with a less than 1.0 rating.
369
+ */
370
+ minRating?:
371
+ number;
372
+ /** Used to restrict the search to places that are open at a specific time. open_now marks if a business is currently open. */
373
+ openNow?:
374
+ boolean;
375
+ /** Used to restrict the search to places that are marked as certain price levels. Users can choose any combinations of price levels. Default to select all price levels. */
376
+ priceLevels?:
377
+ string[];
378
+ /**
379
+ * [Deprecated!]Used to restrict the search to places that are within a certain price range. This is on a scale of 0 to 4. Set a minimum of 0 or set a maximum of 4 has no effect on the
380
+ * search results. Min price is default to 0 and max price is default to 4. Default value will be used if either min or max is unset.
381
+ */
382
+ priceRange?:
383
+ GoogleMapsPlacesV1Int32Range;
384
+ /** How results will be ranked in the response. */
385
+ rankPreference?:
386
+ string;
387
+ /**
388
+ * The Unicode country/region code (CLDR) of the location where the request is coming from. It is used to display the place details, like region-specific place name, if available. For
389
+ * more information, see http://www.unicode.org/reports/tr35/#unicode_region_subtag. Note that 3-digit region codes are not currently supported.
390
+ */
391
+ regionCode?:
392
+ string;
393
+ /** Used to set strict type filtering for included_type. If set to true, only results of the same type will be returned. Default to false. */
394
+ strictTypeFiltering?:
395
+ boolean;
396
+ /** Required. The text query for textual search. */
397
+ textQuery?:
398
+ string;
399
+ }
400
+ interface GoogleMapsPlacesV1SearchTextRequestLocation {
401
+ /** A rectangle box defined by northeast and southwest corner. */
402
+ rectangle?:
403
+ GoogleGeoTypeViewport;
404
+ /** Make location field a strict restriction and filter out POIs outside of the given location. If location type field is unset this field will have no effect. */
405
+ strictRestriction?:
406
+ boolean;
407
+ }
408
+ interface GoogleMapsPlacesV1SearchTextRequestLocationBias {
409
+ /** A circle defined by center point and radius. */
410
+ circle?:
411
+ GoogleMapsPlacesV1Circle;
412
+ /** A rectangle box defined by northeast and southwest corner. */
413
+ rectangle?:
414
+ GoogleGeoTypeViewport;
415
+ }
416
+ interface GoogleMapsPlacesV1SearchTextRequestLocationRestriction {
417
+ /** A rectangle box defined by northeast and southwest corner. */
418
+ rectangle?:
419
+ GoogleGeoTypeViewport;
420
+ }
421
+ interface GoogleMapsPlacesV1SearchTextResponse {
422
+ /** A list of places that meet the user's text search criteria. */
423
+ places?:
424
+ GoogleMapsPlacesV1Place[];
425
+ }
426
+ interface GoogleTypeDate {
427
+ /** Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */
428
+ day?:
429
+ number;
430
+ /** Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */
431
+ month?:
432
+ number;
433
+ /** Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */
434
+ year?:
435
+ number;
436
+ }
437
+ interface GoogleTypeLatLng {
438
+ /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
439
+ latitude?:
440
+ number;
441
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */
442
+ longitude?:
443
+ number;
444
+ }
445
+ interface GoogleTypeLocalizedText {
446
+ /** The text's BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. */
447
+ languageCode?:
448
+ string;
449
+ /** Localized string in the language corresponding to `language_code' below. */
450
+ text?:
451
+ string;
452
+ }
453
+ interface TextResource {
454
+ /** Text query based place search. */
455
+ search(request: {
456
+ /** V1 error format. */
457
+ "$.xgafv"?:
458
+ string;
459
+ /** OAuth access token. */
460
+ access_token?:
461
+ string;
462
+ /** Data format for response. */
463
+ alt?:
464
+ string;
465
+ /** JSONP */
466
+ callback?:
467
+ string;
468
+ /** Selector specifying which fields to include in a partial response. */
469
+ fields?:
470
+ string;
471
+ /** 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. */
472
+ key?:
473
+ string;
474
+ /** OAuth 2.0 token for the current user. */
475
+ oauth_token?:
476
+ string;
477
+ /** Returns response with indentations and line breaks. */
478
+ prettyPrint?:
479
+ boolean;
480
+ /** 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. */
481
+ quotaUser?:
482
+ string;
483
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
484
+ upload_protocol?:
485
+ string;
486
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
487
+ uploadType?:
488
+ string;
489
+ /** Request body */
490
+ resource:
491
+ GoogleMapsPlacesV1SearchTextRequest;
492
+ }): Request<GoogleMapsPlacesV1SearchTextResponse>;
493
+ search(request: {
494
+ /** V1 error format. */
495
+ "$.xgafv"?:
496
+ string;
497
+ /** OAuth access token. */
498
+ access_token?:
499
+ string;
500
+ /** Data format for response. */
501
+ alt?:
502
+ string;
503
+ /** JSONP */
504
+ callback?:
505
+ string;
506
+ /** Selector specifying which fields to include in a partial response. */
507
+ fields?:
508
+ string;
509
+ /** 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. */
510
+ key?:
511
+ string;
512
+ /** OAuth 2.0 token for the current user. */
513
+ oauth_token?:
514
+ string;
515
+ /** Returns response with indentations and line breaks. */
516
+ prettyPrint?:
517
+ boolean;
518
+ /** 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. */
519
+ quotaUser?:
520
+ string;
521
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
522
+ upload_protocol?:
523
+ string;
524
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
525
+ uploadType?:
526
+ string;
527
+ },
528
+ body: GoogleMapsPlacesV1SearchTextRequest): Request<GoogleMapsPlacesV1SearchTextResponse>;
529
+ }
530
+
531
+ const Text: TextResource;
532
+ }
533
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.places-v1",
3
+ "version": "0.0.20230716",
4
+ "description": "TypeScript typings for Places API (New) v1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,79 @@
1
+ # TypeScript typings for Places API (New) v1
2
+
3
+
4
+ For detailed description please check [documentation](https://www.google.com).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Places API (New):
9
+
10
+ ```
11
+ npm install @types/gapi.client.places-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('https://places.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.places
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('places', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.places
39
+ });
40
+ ```
41
+
42
+ Don't forget to authenticate your client before sending any request to resources:
43
+
44
+ ```typescript
45
+ // declare client_id registered in Google Developers Console
46
+ var client_id = '',
47
+ scope = [
48
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
49
+ 'https://www.googleapis.com/auth/cloud-platform',
50
+
51
+ // Private Service: https://www.googleapis.com/auth/maps-platform.places
52
+ 'https://www.googleapis.com/auth/maps-platform.places',
53
+
54
+ // Private Service: https://www.googleapis.com/auth/maps-platform.places.textsearch
55
+ 'https://www.googleapis.com/auth/maps-platform.places.textsearch',
56
+ ],
57
+ immediate = true;
58
+ // ...
59
+
60
+ gapi.auth.authorize(
61
+ { client_id: client_id, scope: scope, immediate: immediate },
62
+ authResult => {
63
+ if (authResult && !authResult.error) {
64
+ /* handle successful authorization */
65
+ } else {
66
+ /* handle authorization error */
67
+ }
68
+ });
69
+ ```
70
+
71
+ After that you can use Places API (New) resources: <!-- TODO: make this work for multiple namespaces -->
72
+
73
+ ```typescript
74
+
75
+ /*
76
+ Text query based place search.
77
+ */
78
+ await gapi.client.places.Text.search({ });
79
+ ```
package/tests.ts ADDED
@@ -0,0 +1,101 @@
1
+ /* This is stub file for gapi.client.places-v1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20230716
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://places.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.places */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
19
+ 'https://www.googleapis.com/auth/cloud-platform',
20
+ /** Private Service: https://www.googleapis.com/auth/maps-platform.places */
21
+ 'https://www.googleapis.com/auth/maps-platform.places',
22
+ /** Private Service: https://www.googleapis.com/auth/maps-platform.places.textsearch */
23
+ 'https://www.googleapis.com/auth/maps-platform.places.textsearch',
24
+ ];
25
+ const immediate = false;
26
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
27
+ if (authResult && !authResult.error) {
28
+ /** handle successful authorization */
29
+ run();
30
+ } else {
31
+ /** handle authorization error */
32
+ }
33
+ });
34
+
35
+ async function run() {
36
+ /** Text query based place search. */
37
+ await gapi.client.places.Text.search({
38
+ }, {
39
+ includedType: "Test string",
40
+ languageCode: "Test string",
41
+ location: {
42
+ rectangle: {
43
+ high: {
44
+ latitude: 42,
45
+ longitude: 42,
46
+ },
47
+ low: {
48
+ latitude: 42,
49
+ longitude: 42,
50
+ },
51
+ },
52
+ strictRestriction: true,
53
+ },
54
+ locationBias: {
55
+ circle: {
56
+ center: {
57
+ latitude: 42,
58
+ longitude: 42,
59
+ },
60
+ radius: 42,
61
+ },
62
+ rectangle: {
63
+ high: {
64
+ latitude: 42,
65
+ longitude: 42,
66
+ },
67
+ low: {
68
+ latitude: 42,
69
+ longitude: 42,
70
+ },
71
+ },
72
+ },
73
+ locationRestriction: {
74
+ rectangle: {
75
+ high: {
76
+ latitude: 42,
77
+ longitude: 42,
78
+ },
79
+ low: {
80
+ latitude: 42,
81
+ longitude: 42,
82
+ },
83
+ },
84
+ },
85
+ maxResultCount: 42,
86
+ minRating: 42,
87
+ openNow: true,
88
+ priceLevels: [
89
+ "Test string"
90
+ ],
91
+ priceRange: {
92
+ max: 42,
93
+ min: 42,
94
+ },
95
+ rankPreference: "Test string",
96
+ regionCode: "Test string",
97
+ strictTypeFiltering: true,
98
+ textQuery: "Test string",
99
+ });
100
+ }
101
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }