Skip to content

Commit 29370b6

Browse files
committed
Refactor field names
1 parent dd1338e commit 29370b6

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

ors-client/src/main/java/org/nitri/ors/model/route/RouteRequest.kt

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.nitri.ors.model.route
22

3+
import kotlinx.serialization.SerialName
34
import kotlinx.serialization.Serializable
45

56
@Serializable
@@ -8,26 +9,34 @@ data class RouteRequest(
89
val radiuses: List<Double>? = null,
910
val bearings: List<List<Double>>? = null,
1011
val elevation: Boolean? = null,
11-
val extra_info: List<String>? = null,
12+
@SerialName("extra_info")
13+
val extraInfo: List<String>? = null,
1214
val instructions: Boolean? = null,
13-
val instructions_format: String? = null,
15+
@SerialName("instructions_format")
16+
val instructionsFormat: String? = null,
1417
val language: String? = null,
1518
val preference: String? = null,
1619
val units: String? = null,
1720
val geometry: Boolean? = null,
18-
val geometry_simplify: Boolean? = null,
19-
val roundabout_exits: Boolean? = null,
21+
@SerialName("geometry_simplify")
22+
val geometrySimplify: Boolean? = null,
23+
@SerialName("roundabout_exits")
24+
val roundaboutExits: Boolean? = null,
2025
val attributes: List<String>? = null,
2126
val maneuvers: Boolean? = null,
22-
val continue_straight: Boolean? = null,
27+
@SerialName("continue_straight")
28+
val continueStraight: Boolean? = null,
2329
val options: RouteOptions? = null
2430
)
2531

2632
@Serializable
2733
data class RouteOptions(
28-
val avoid_features: List<String>? = null,
29-
val avoid_polygons: AvoidPolygons? = null,
30-
val profile_params: ProfileParams? = null
34+
@SerialName("avoid_features")
35+
val avoidFeatures: List<String>? = null,
36+
@SerialName("avoid_polygons")
37+
val avoidPolygons: AvoidPolygons? = null,
38+
@SerialName("profile_params")
39+
val profileParams: ProfileParams? = null
3140
)
3241

3342
@Serializable
@@ -56,8 +65,12 @@ data class WeightingFactor(
5665

5766
@Serializable
5867
data class Restrictions(
59-
val max_height: Double? = null,
60-
val max_width: Double? = null,
61-
val max_weight: Double? = null,
62-
val max_length: Double? = null
68+
@SerialName("max_height")
69+
val maxHeight: Double? = null,
70+
@SerialName("max_width")
71+
val maxWidth: Double? = null,
72+
@SerialName("max_weight")
73+
val maxWeight: Double? = null,
74+
@SerialName("max_length")
75+
val maxLength: Double? = null
6376
)

ors-client/src/main/java/org/nitri/ors/model/route/RouteResponse.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.nitri.ors.model.route
22

3+
import kotlinx.serialization.SerialName
34
import kotlinx.serialization.Serializable
45
import org.nitri.ors.model.meta.Metadata
56

@@ -15,7 +16,8 @@ data class Route(
1516
val summary: RouteSummary,
1617
val segments: List<Segment>,
1718
val geometry: String? = null,
18-
val way_points: List<Int>? = null
19+
@SerialName("way_points")
20+
val wayPoints: List<Int>? = null
1921
)
2022

2123
@Serializable
@@ -33,7 +35,8 @@ data class Segment(
3335
val steps: List<Step>? = null,
3436
val ascent: Double? = null,
3537
val descent: Double? = null,
36-
val detourfactor: Double? = null,
38+
@SerialName("detour_factor")
39+
val detourFactor: Double? = null,
3740
val percentage: Double? = null
3841
)
3942

@@ -44,7 +47,9 @@ data class Step(
4447
val instruction: String,
4548
val name: String,
4649
val type: Int,
47-
val way_points: List<Int>,
48-
val exit_number: Int? = null
50+
@SerialName("way_points")
51+
val wayPoints: List<Int>,
52+
@SerialName("exit_number")
53+
val exitNumber: Int? = null
4954
)
5055

0 commit comments

Comments
 (0)