Skip to content

Commit 65ebc19

Browse files
committed
Final API changes for v9
1 parent a3d6e6f commit 65ebc19

10 files changed

Lines changed: 117 additions & 116 deletions

File tree

__tests__/routing.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const optimizedRouteRequest: OptimizedRouteRequest = {
6767
},
6868
units: DistanceUnit.Mi,
6969
dateTime: {
70-
type: 0,
70+
type: "depart_now",
7171
},
7272
};
7373
const mockRouteRes = {

src/generated/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ models/MatrixResponse.ts
7777
models/MatrixWaypoint.ts
7878
models/MotorScooterCostingOptions.ts
7979
models/MotorcycleCostingOptions.ts
80+
models/NearestRoadsCostingModel.ts
8081
models/NearestRoadsRequest.ts
8182
models/NodeId.ts
8283
models/NodeType.ts
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.20.0
1+
7.21.0

src/generated/models/BaseTraceRequest.ts

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,6 @@ import {
3434
TimeConstraintV1ToJSON,
3535
TimeConstraintV1ToJSONTyped,
3636
} from "./TimeConstraintV1";
37-
import type { DistanceUnit } from "./DistanceUnit";
38-
import {
39-
DistanceUnitFromJSON,
40-
DistanceUnitFromJSONTyped,
41-
DistanceUnitToJSON,
42-
DistanceUnitToJSONTyped,
43-
} from "./DistanceUnit";
44-
import type { RoutingLanguages } from "./RoutingLanguages";
45-
import {
46-
RoutingLanguagesFromJSON,
47-
RoutingLanguagesFromJSONTyped,
48-
RoutingLanguagesToJSON,
49-
RoutingLanguagesToJSONTyped,
50-
} from "./RoutingLanguages";
5137
import type { MapMatchWaypoint } from "./MapMatchWaypoint";
5238
import {
5339
MapMatchWaypointFromJSON,
@@ -62,24 +48,6 @@ import {
6248
* @interface BaseTraceRequest
6349
*/
6450
export interface BaseTraceRequest {
65-
/**
66-
*
67-
* @type {DistanceUnit}
68-
* @memberof BaseTraceRequest
69-
*/
70-
units?: DistanceUnit;
71-
/**
72-
*
73-
* @type {RoutingLanguages}
74-
* @memberof BaseTraceRequest
75-
*/
76-
language?: RoutingLanguages;
77-
/**
78-
* The level of directional narrative to include. Locations and times will always be returned, but narrative generation verbosity can be controlled with this parameter.
79-
* @type {BaseTraceRequestDirectionsTypeEnum}
80-
* @memberof BaseTraceRequest
81-
*/
82-
directionsType?: BaseTraceRequestDirectionsTypeEnum;
8351
/**
8452
* An identifier to disambiguate requests (echoed by the server).
8553
* @type {string}
@@ -125,17 +93,6 @@ export interface BaseTraceRequest {
12593
shapeMatch?: BaseTraceRequestShapeMatchEnum;
12694
}
12795

128-
/**
129-
* @export
130-
*/
131-
export const BaseTraceRequestDirectionsTypeEnum = {
132-
None: "none",
133-
Maneuvers: "maneuvers",
134-
Instructions: "instructions",
135-
} as const;
136-
export type BaseTraceRequestDirectionsTypeEnum =
137-
(typeof BaseTraceRequestDirectionsTypeEnum)[keyof typeof BaseTraceRequestDirectionsTypeEnum];
138-
13996
/**
14097
* @export
14198
*/
@@ -169,14 +126,6 @@ export function BaseTraceRequestFromJSONTyped(
169126
return json;
170127
}
171128
return {
172-
units:
173-
json["units"] == null ? undefined : DistanceUnitFromJSON(json["units"]),
174-
language:
175-
json["language"] == null
176-
? undefined
177-
: RoutingLanguagesFromJSON(json["language"]),
178-
directionsType:
179-
json["directions_type"] == null ? undefined : json["directions_type"],
180129
id: json["id"] == null ? undefined : json["id"],
181130
shape:
182131
json["shape"] == null
@@ -210,9 +159,6 @@ export function BaseTraceRequestToJSONTyped(
210159
}
211160

212161
return {
213-
units: DistanceUnitToJSON(value["units"]),
214-
language: RoutingLanguagesToJSON(value["language"]),
215-
directions_type: value["directionsType"],
216162
id: value["id"],
217163
shape:
218164
value["shape"] == null
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* Stadia Maps Geospatial APIs
5+
* The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
6+
*
7+
* The version of the OpenAPI document: 11.0.0
8+
* Contact: support@stadiamaps.com
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
/**
16+
* A routing profile that determines which roads are eligible for matching (e.g. trucks probably aren't on sidewalks, so the search will snap to the nearest truck-accessible road).
17+
* @export
18+
*/
19+
export const NearestRoadsCostingModel = {
20+
Auto: "auto",
21+
Bus: "bus",
22+
Taxi: "taxi",
23+
Truck: "truck",
24+
Bicycle: "bicycle",
25+
Bikeshare: "bikeshare",
26+
MotorScooter: "motor_scooter",
27+
Motorcycle: "motorcycle",
28+
Pedestrian: "pedestrian",
29+
LowSpeedVehicle: "low_speed_vehicle",
30+
} as const;
31+
export type NearestRoadsCostingModel =
32+
(typeof NearestRoadsCostingModel)[keyof typeof NearestRoadsCostingModel];
33+
34+
export function instanceOfNearestRoadsCostingModel(value: any): boolean {
35+
for (const key in NearestRoadsCostingModel) {
36+
if (Object.prototype.hasOwnProperty.call(NearestRoadsCostingModel, key)) {
37+
if (
38+
NearestRoadsCostingModel[
39+
key as keyof typeof NearestRoadsCostingModel
40+
] === value
41+
) {
42+
return true;
43+
}
44+
}
45+
}
46+
return false;
47+
}
48+
49+
export function NearestRoadsCostingModelFromJSON(
50+
json: any,
51+
): NearestRoadsCostingModel {
52+
return NearestRoadsCostingModelFromJSONTyped(json, false);
53+
}
54+
55+
export function NearestRoadsCostingModelFromJSONTyped(
56+
json: any,
57+
ignoreDiscriminator: boolean,
58+
): NearestRoadsCostingModel {
59+
return json as NearestRoadsCostingModel;
60+
}
61+
62+
export function NearestRoadsCostingModelToJSON(
63+
value?: NearestRoadsCostingModel | null,
64+
): any {
65+
return value as any;
66+
}
67+
68+
export function NearestRoadsCostingModelToJSONTyped(
69+
value: any,
70+
ignoreDiscriminator: boolean,
71+
): NearestRoadsCostingModel {
72+
return value as NearestRoadsCostingModel;
73+
}

src/generated/models/NearestRoadsRequest.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
*/
1414

1515
import { mapValues } from "../runtime";
16-
import type { CostingModel } from "./CostingModel";
17-
import {
18-
CostingModelFromJSON,
19-
CostingModelFromJSONTyped,
20-
CostingModelToJSON,
21-
CostingModelToJSONTyped,
22-
} from "./CostingModel";
2316
import type { CostingOptions } from "./CostingOptions";
2417
import {
2518
CostingOptionsFromJSON,
@@ -34,6 +27,13 @@ import {
3427
CoordinateToJSON,
3528
CoordinateToJSONTyped,
3629
} from "./Coordinate";
30+
import type { NearestRoadsCostingModel } from "./NearestRoadsCostingModel";
31+
import {
32+
NearestRoadsCostingModelFromJSON,
33+
NearestRoadsCostingModelFromJSONTyped,
34+
NearestRoadsCostingModelToJSON,
35+
NearestRoadsCostingModelToJSONTyped,
36+
} from "./NearestRoadsCostingModel";
3737

3838
/**
3939
*
@@ -49,10 +49,10 @@ export interface NearestRoadsRequest {
4949
locations: Array<Coordinate>;
5050
/**
5151
*
52-
* @type {CostingModel}
52+
* @type {NearestRoadsCostingModel}
5353
* @memberof NearestRoadsRequest
5454
*/
55-
costing?: CostingModel;
55+
costing?: NearestRoadsCostingModel;
5656
/**
5757
*
5858
* @type {CostingOptions}
@@ -93,7 +93,7 @@ export function NearestRoadsRequestFromJSONTyped(
9393
costing:
9494
json["costing"] == null
9595
? undefined
96-
: CostingModelFromJSON(json["costing"]),
96+
: NearestRoadsCostingModelFromJSON(json["costing"]),
9797
costingOptions:
9898
json["costing_options"] == null
9999
? undefined
@@ -116,7 +116,7 @@ export function NearestRoadsRequestToJSONTyped(
116116

117117
return {
118118
locations: (value["locations"] as Array<any>).map(CoordinateToJSON),
119-
costing: CostingModelToJSON(value["costing"]),
119+
costing: NearestRoadsCostingModelToJSON(value["costing"]),
120120
costing_options: CostingOptionsToJSON(value["costingOptions"]),
121121
verbose: value["verbose"],
122122
};

src/generated/models/TimeConstraintV1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
import { mapValues } from "../runtime";
1616
/**
17-
* Specifies the time context for time-dependent routing (e.g., to account for traffic patterns or time-based access restrictions). Defaults to "depart_now" for traffic-influenced routing profiles like `auto_traffic`.
17+
* Specifies the time context for time-dependent routing (e.g., to account for traffic patterns or time-based access restrictions). Defaults to depart_now for traffic-influenced routing profiles like `auto_traffic`.
1818
* @export
1919
* @interface TimeConstraintV1
2020
*/
2121
export interface TimeConstraintV1 {
2222
/**
23-
* The type of time constraint: "depart_now" = depart now (current time), "depart_at" = depart at the specified time, "arrive_at" = arrive by the specified time.
23+
* The type of time constraint: `depart_now` = depart now (current time), `depart_at` = depart at the specified time, `arrive_at` = arrive by the specified time.
2424
* @type {TimeConstraintV1TypeEnum}
2525
* @memberof TimeConstraintV1
2626
*/

src/generated/models/TraceAttributesRequest.ts

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ import {
4848
DistanceUnitToJSON,
4949
DistanceUnitToJSONTyped,
5050
} from "./DistanceUnit";
51-
import type { RoutingLanguages } from "./RoutingLanguages";
52-
import {
53-
RoutingLanguagesFromJSON,
54-
RoutingLanguagesFromJSONTyped,
55-
RoutingLanguagesToJSON,
56-
RoutingLanguagesToJSONTyped,
57-
} from "./RoutingLanguages";
5851
import type { MapMatchWaypoint } from "./MapMatchWaypoint";
5952
import {
6053
MapMatchWaypointFromJSON,
@@ -112,24 +105,6 @@ export interface TraceAttributesRequest {
112105
* @memberof TraceAttributesRequest
113106
*/
114107
shapeMatch?: TraceAttributesRequestShapeMatchEnum;
115-
/**
116-
*
117-
* @type {DistanceUnit}
118-
* @memberof TraceAttributesRequest
119-
*/
120-
units?: DistanceUnit;
121-
/**
122-
*
123-
* @type {RoutingLanguages}
124-
* @memberof TraceAttributesRequest
125-
*/
126-
language?: RoutingLanguages;
127-
/**
128-
* The level of directional narrative to include. Locations and times will always be returned, but narrative generation verbosity can be controlled with this parameter.
129-
* @type {TraceAttributesRequestDirectionsTypeEnum}
130-
* @memberof TraceAttributesRequest
131-
*/
132-
directionsType?: TraceAttributesRequestDirectionsTypeEnum;
133108
/**
134109
* If present, provides either a whitelist or a blacklist of keys to include/exclude in the response. This key is optional, and if omitted from the request, all available info will be returned.
135110
* @type {TraceAttributeFilterOptions}
@@ -144,6 +119,12 @@ export interface TraceAttributesRequest {
144119
* @memberof TraceAttributesRequest
145120
*/
146121
elevationInterval?: number;
122+
/**
123+
*
124+
* @type {DistanceUnit}
125+
* @memberof TraceAttributesRequest
126+
*/
127+
units?: DistanceUnit;
147128
}
148129

149130
/**
@@ -157,17 +138,6 @@ export const TraceAttributesRequestShapeMatchEnum = {
157138
export type TraceAttributesRequestShapeMatchEnum =
158139
(typeof TraceAttributesRequestShapeMatchEnum)[keyof typeof TraceAttributesRequestShapeMatchEnum];
159140

160-
/**
161-
* @export
162-
*/
163-
export const TraceAttributesRequestDirectionsTypeEnum = {
164-
None: "none",
165-
Maneuvers: "maneuvers",
166-
Instructions: "instructions",
167-
} as const;
168-
export type TraceAttributesRequestDirectionsTypeEnum =
169-
(typeof TraceAttributesRequestDirectionsTypeEnum)[keyof typeof TraceAttributesRequestDirectionsTypeEnum];
170-
171141
/**
172142
* Check if a given object implements the TraceAttributesRequest interface.
173143
*/
@@ -209,14 +179,6 @@ export function TraceAttributesRequestFromJSONTyped(
209179
? undefined
210180
: TimeConstraintV1FromJSON(json["date_time"]),
211181
shapeMatch: json["shape_match"] == null ? undefined : json["shape_match"],
212-
units:
213-
json["units"] == null ? undefined : DistanceUnitFromJSON(json["units"]),
214-
language:
215-
json["language"] == null
216-
? undefined
217-
: RoutingLanguagesFromJSON(json["language"]),
218-
directionsType:
219-
json["directions_type"] == null ? undefined : json["directions_type"],
220182
filters:
221183
json["filters"] == null
222184
? undefined
@@ -225,6 +187,8 @@ export function TraceAttributesRequestFromJSONTyped(
225187
json["elevation_interval"] == null
226188
? undefined
227189
: json["elevation_interval"],
190+
units:
191+
json["units"] == null ? undefined : DistanceUnitFromJSON(json["units"]),
228192
};
229193
}
230194

@@ -253,10 +217,8 @@ export function TraceAttributesRequestToJSONTyped(
253217
costing_options: CostingOptionsToJSON(value["costingOptions"]),
254218
date_time: TimeConstraintV1ToJSON(value["dateTime"]),
255219
shape_match: value["shapeMatch"],
256-
units: DistanceUnitToJSON(value["units"]),
257-
language: RoutingLanguagesToJSON(value["language"]),
258-
directions_type: value["directionsType"],
259220
filters: TraceAttributeFilterOptionsToJSON(value["filters"]),
260221
elevation_interval: value["elevationInterval"],
222+
units: DistanceUnitToJSON(value["units"]),
261223
};
262224
}

src/generated/models/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export * from "./MatrixResponse";
7474
export * from "./MatrixWaypoint";
7575
export * from "./MotorScooterCostingOptions";
7676
export * from "./MotorcycleCostingOptions";
77+
export * from "./NearestRoadsCostingModel";
7778
export * from "./NearestRoadsRequest";
7879
export * from "./NodeId";
7980
export * from "./NodeType";

0 commit comments

Comments
 (0)