-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoogle-maps.yaml
642 lines (630 loc) · 18.4 KB
/
google-maps.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
swagger: '2.0'
info:
description: Google Maps API Specification Wrapper
version: 1.0.0
title: Google Maps API
# put the contact info for your development or API team
contact:
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
# host: maps.googleapis.com
# all paths will be relative to the basePath specified
# basePath: /maps/api
schemes:
- https
securityDefinitions:
Bearer:
type: apiKey
name: 'Authorization: Bearer '
in: header
apiKey:
type: apiKey
name: key
in: query
consumes:
- application/json
- application/x-www-form-urlencoded
produces:
- application/json
- application/xml
security:
- apiKey: []
Bearer: []
# Global Header parameters will be here
parameters:
Access-Control-Allow-Origin:
name: Access-Control-Allow-Origin
description: Header to enable CORS requests
in: header
type: string
required: false
Access-Control-Allow-Headers:
name: Access-Control-Allow-Headers
in: header
description: Comma De-limited List of allowed headers
type: string
required: false
Address:
name: address
in: query
description: The street address that we would like to Geocode. Needs to be in the native land's postal format
type: string
required: true
Components:
name: components
in: query
description: The filter values we want from the Geocoder
type: string
required: false
Key:
name: key
in: query
description: The API Key for our web app
type: string
required: true
Bounds:
name: bounds
in: query
description: Bounding box of our map viewport to bias geocoder results
type: string
required: false
Callback:
name: callback
in: query
description: Callback function signature to be used to load the map
type: string
required: true
Output:
name: output
description: The format that response data is delivered. Either json or xml
in: query
type: string
required: true
Origin:
name: origin
description: The starting point of your trip
in: query
type: string
required: true
Destination:
name: destination
description: The intended location to travel to
in: query
type: string
required: true
TravelMode:
name: mode
description: The preferred method of transportation when calculating directions
in: query
type: string
required: true
TransitMode:
name: transit_mode
description: Specified preferred modes of transit. Only for transit direction requests
in: query
type: array
items:
type: string
required: false
TransitRoutingPreference:
name: transit_routing_preference
description: Transit route preferences. Biases returned options, not optimal by default
in: query
type: array
items:
type: string
required: false
UnitSystem:
name: units
description: Unit system used when showing results
in: query
type: string
required: true
Waypoints:
name: waypoints
description: An array of Waypoints
in: query
type: array
items:
type: string
required: false
OptimizeWaypoints:
name: optimizeWaypoints
description: Flag for indicating Wapoint optimaization
in: query
type: boolean
required: false
Alternatives:
name: alternatives
description: Flag for indicating the desire for multiple route alternatives
in: query
type: boolean
required: false
Avoid:
name: avoid
description: Collection of route features that should be avoided
in: query
type: array
items:
type: string
required: false
Language:
name: language
in: query
description: The language to return results
type: string
required: false
Region:
name: region
in: query
description: The region code in ccTLD format
type: string
required: true
ArrivalTime:
name: arrival_time
in: query
description: Specifies the desired time of arrival for transit directions
type: integer
required: false
DepartureTime:
name: departure_time
in: query
description: Specifies the desired time of departure for transit
type: integer
required: false
TrafficModel:
name: traffic_model
in: query
description: Assumptions to use when calculating travel time, while in traffic
type: string
required: false
definitions:
DirectionResponse:
title: directionresults
properties:
status:
type: string
description: Message communicating the state of a given request
geocoded_waypoints:
type: array
items:
type: object
description: Array containing geocoding for start, destination, and waypoints of a trip
routes:
type: array
items:
type: object
description: Array of routes from origin to destination
available_travel_modes:
type: array
items:
type: object
description: A collection of available travel modes. An alternative to a requested mode
GeocodedWaypoint:
title: geocoded_waypoint
properties:
geocoder_status:
type: string
description: Status code from the requested geocoding operation
partial_match:
type: array
items:
type: object
description: A collection of alternative suggestions for an incomplete match query
place_id:
type: string
description: An unique identifier that may be used with other Google APIs
types:
type: string
description: The resulting geocoding address type
Route:
title: route
properties:
summary:
type: string
description: Brief text description for the route, as to disambiguate it from alternatives
legs:
type: array
items:
type: object
description: Collection of legs within a given route. Legs are present as per waypoints / destination specified
waypoint_order:
type: array
items:
type: object
description: A collection of ordered waypoints within the calculated route. May be open to optimization
overview_polyline:
type: object
description: Holds a "points" object, which is an encoded polyline representation of a route
bounds:
type: object
description: Holds the viewport bounding box of the overview_plyline
copyrights:
type: string
description: The copyright text for the given route. Data is handled by app clients
warnings:
type: array
items:
type: string
description: A collection of warnings, associated with given directions
fare:
type: object
description: Represents the total fare costs on a given route
Fare:
title: fare
properties:
currency:
type: string
description: An ISO 4217 currency code, signifying what currency we are dealing with
value:
type: string
description: The total fare amount in the specified currency
text:
type: string
description: The total fare amount, formatted in the language
Leg:
title: leg
properties:
steps:
type: array
items:
type: object
description: An array of ps denoting information about each separate step of a given leg
distance:
type: object
description: Indicates the total distance covered by a given leg
duration:
type: object
description: The amount of time to cover a given leg of a trip
duration_in_traffic:
type: object
description: The amount of time estimated to complete a leg of the trip. Based on traveler history.
departure_time:
type: object
description: Estimated departure time of a transportation provider. Only works for transit directions
start_location:
type: string
description: The longitudinal coordinates of the current leg of the trip
end_location:
type: string
description: The longituinal coordinates of the given destination of a Leg
start_address:
type: string
description: A human readable version of the origin's address
end_address:
type: string
description: A human readable version of the Leg's destination
Step:
title: step
properties:
html_instructions:
type: string
description: Formatted instructions for a given step
distance:
type: string
description: Distance between current and next step
duration:
type: string
description: The typical time to perform a given step, until the next step
start_location:
type: object
description: The location of the step's origin, as a lat/long pair
end_location:
type: string
description: The location of the last point within a set, as a lat/long pair
polyline:
type: array
description: a collection of points that are a smoothed path of a given step
items:
type: object
steps:
type: array
items:
type: object
description: Detailed walking / driving directions
TransitDetails:
title: transit_details
properties:
arrival_stop:
type: object
description: Object containing the name and longitudinal coords. of a given stop
departure_stop:
type: object
description: Object containing the name and coordinate data of a destination
arrival_time:
type: object
description: Object containing the arrival time to the destination
departure_time:
type: object
description: Object containing the departure time from the origin
headsign:
type: string
description: Specific direction to travel along within a route line
headway:
type: integer
description: Specific number of seconds between departures, at a given transi station
num_stops:
type: integer
description: Number of stops in a given step, including the arrival stop
agencies:
type: array
items:
type: object
description: An array, holding an Object containing information on the line's operator
url:
type: string
description: THe URL for the transit line, provided by the transit agency
icon:
type: string
description: The URL for the icon related to a given line
Line:
title: agencies
properties:
name:
type: string
description: THe full name of the transit line
short_name:
type: string
description: The short name of the transit line
color:
type: string
description: The Hex color code for transit line signage
agencies:
type: array
description: Array containing a TransitAgency object
items:
type: object
url:
type: string
description: The URL for the given transit line
icon:
type: string
description: The URL for the transit line's icon
text_color:
type: string
description: The Hex color code for the transit signage text
vehicle:
type: object
description: The type of vehicle used on this transit line
TransitAgency:
title: TransitAgency
properties:
name:
type: string
description: The name of the transit agency
phone:
type: string
description: The phone number of the transit agency
url:
type: string
description: The URL of the transit agency's website
Vehicle:
title: vehicle
properties:
name:
type: string
description: The name of the vehicle on a transit line
type:
type: string
description: Type of vehicle that runs along the lines of a route.
icon:
type: string
description: URL for a vehicle's icon
local_icon:
type: string
description: URL for another vehicle's icon, relative to the local filesystem
GeocodeResponse:
title: geocode_response
properties:
results:
type: array
items:
type: object
description: List of values encapsulated in your response
status:
type: string
description: The human translation of your HTTP Response Status
error_message:
type: string
description: An additional message attached to Non 2XX responses
Geometry:
title: geometry
properties:
location:
type: array
items:
type: object
description: The geocoded lat/lon value of a given address
location_type:
type: string
description: Stores additional data of a specific location
viewport:
type: array
items:
type: object
description: Contains a recommended viewport for displaying the results; as a pair of lat/lon values
bounds:
type: array
items:
type: object
description: Stores a bounding box with fully contains our result
AddressComponents:
title: address_components
properties:
types:
type: array
description: an array indicating the type of the address component
items:
type: string
long_name:
type: string
description: is the full text description or name of the address component as returned by the Geocoder.
short_name:
type: string
description: is an abbreviated textual name for the address component, if available. For example, an address component for the state of Alaska may have a long_name of "Alaska" and a short_name of "AK" using the 2-letter postal abbreviation.
GeocodeResult:
title: results
properties:
types:
type: array
description: An array containing feature tags for a location
items:
type: string
formatted_address:
type: string
description: A human readable version of the location's address
address_components:
type: array
description: an array containing the separate components applicable to this address.
items:
type: object
postcode_localities:
type: array
description: an array containing the separate components applicable to this address.
items:
type: string
geometry:
type: object
description: Contains location and visual data for a given result
Error:
title: error
required:
- type
properties:
type:
type: string
description: The type of error returned. Can be api_connection_error, api_error, authentication_error, card_error, invalid_request_error, or rate_limit_error.
message:
type: string
description: A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
code:
type: string
description: For card errors, a short string from amongst those listed on the right describing the kind of card error that occurred.
param:
type: string
description: The parameter the error relates to if the error is parameter-specific. You can use this to display a message near the correct form field, for example.
paths:
/js:
parameters:
- $ref: "#/parameters/Output"
- $ref: "#/parameters/Callback"
- $ref: '#/parameters/Key'
get:
summary: Load map
operationId: initMap
description: Requests a fresh google map
produces:
- application/json
- application/xml
responses:
200:
$ref: '#/responses/JsResponse'
/geocode:
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Address'
- $ref: '#/parameters/Bounds'
- $ref: '#/parameters/Language'
- $ref: '#/parameters/Region'
- $ref: '#/parameters/Components'
get:
summary: Geocode a given address
operationId: GeocodeAddr
description: Retrieve lat/long coordinates from a given postal address
produces:
- application/xml
- application/json
responses:
200:
$ref: '#/responses/GeocodeResponse'
400:
$ref: '#/responses/400'
401:
$ref: '#/responses/401'
429:
$ref: '#/responses/429'
502:
$ref: '#/responses/502'
/directions:
parameters:
- $ref: '#/parameters/Origin'
- $ref: '#/parameters/Destination'
- $ref: '#/parameters/Key'
- $ref: '#/parameters/TravelMode'
- $ref: '#/parameters/Waypoints'
- $ref: '#/parameters/Alternatives'
- $ref: '#/parameters/Language'
- $ref: '#/parameters/UnitSystem'
- $ref: '#/parameters/Region'
- $ref: '#/parameters/ArrivalTime'
- $ref: '#/parameters/DepartureTime'
- $ref: '#/parameters/TrafficModel'
- $ref: '#/parameters/TransitMode'
- $ref: '#/parameters/TransitRoutingPreference'
get:
summary: Get directions to a given destination
description: Generates routes between a given origin location, and destination
produces:
- application/json
responses:
200:
$ref: '#/responses/DirectionResponse'
400:
$ref: '#/responses/400'
402:
$ref: '#/responses/402'
429:
$ref: '#/responses/429'
502:
$ref: '#/responses/502'
responses:
DirectionResponse:
description: Response from a Directions API request
schema:
$ref: '#/definitions/DirectionResponse'
GeocodeResponse:
description: Response from a Geocoding request
schema:
$ref: '#/definitions/GeocodeResponse'
JsResponse:
description: OK
schema:
type: file
400:
description: Bad Request
schema:
$ref: '#/definitions/Error'
401:
description: Unauthorized
schema:
$ref: '#/definitions/Error'
402:
description: Request Failed
schema:
$ref: '#/definitions/Error'
404:
description: Not Found
schema:
$ref: '#/definitions/Error'
409:
description: Conflict
schema:
$ref: '#/definitions/Error'
429:
description: Too Many Requests
schema:
$ref: '#/definitions/Error'
502:
description: Server Error
schema:
$ref: '#/definitions/Error'
503:
description: Server Error
schema:
$ref: '#/definitions/Error'
504:
description: Server Error
schema:
$ref: '#/definitions/Error'