diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f406ff1..5589e3a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.57" + ".": "0.1.0-alpha.58" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index a3a2c77..1e6aa3d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit/open-transit-49611a380a238e29ad714c2f6d66a35ada42e3931d2aad2839afd1f13b585de1.yml -openapi_spec_hash: b03acca245aef78353d3b7a6a4a62eb2 -config_hash: ff7ff57d4c7f9c3f7a4f9bae39aa00e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit/open-transit-da4eecc88401fd486b0b8ac2a7b3f442748713e3128d878c7f3e24ea7f65f31d.yml +openapi_spec_hash: 8df6b1871782bcd2bd8fb1fb2bbc2694 +config_hash: c28ddf5b7754155603d9fd1c5fcaeeff diff --git a/CHANGELOG.md b/CHANGELOG.md index bf52abd..e124223 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.1.0-alpha.58 (2026-07-11) + +Full Changelog: [v0.1.0-alpha.57...v0.1.0-alpha.58](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.57...v0.1.0-alpha.58) + +### Features + +* **api:** api update ([ffd90e5](https://github.com/OneBusAway/java-sdk/commit/ffd90e56729fd60114d01d28f590bf769ea346b9)) +* **api:** api update ([59381cc](https://github.com/OneBusAway/java-sdk/commit/59381ccbe54b6046cc2bc362cef6be0ec99abb99)) + ## 0.1.0-alpha.57 (2026-06-08) Full Changelog: [v0.1.0-alpha.56...v0.1.0-alpha.57](https://github.com/OneBusAway/java-sdk/compare/v0.1.0-alpha.56...v0.1.0-alpha.57) diff --git a/README.md b/README.md index 64f61c6..b1bad67 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.57) -[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.57/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.57) +[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-java)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.58) +[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.58/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.58) @@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.57). +The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). Javadocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-java/0.1.0-alpha.58). @@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.onebusaway.org](https://de ### Gradle ```kotlin -implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.57") +implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.58") ``` ### Maven @@ -35,7 +35,7 @@ implementation("org.onebusaway:onebusaway-sdk-java:0.1.0-alpha.57") org.onebusaway onebusaway-sdk-java - 0.1.0-alpha.57 + 0.1.0-alpha.58 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 53cee8d..5843b5d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "org.onebusaway" - version = "0.1.0-alpha.57" // x-release-please-version + version = "0.1.0-alpha.58" // x-release-please-version } subprojects { diff --git a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParams.kt b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParams.kt index c4b1ee9..66049f2 100644 --- a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParams.kt +++ b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParams.kt @@ -6,16 +6,15 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull import org.onebusaway.core.Params -import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers import org.onebusaway.core.http.QueryParams /** routes-for-location */ class RoutesForLocationListParams private constructor( - private val lat: Double, - private val lon: Double, + private val lat: Double?, private val latSpan: Double?, + private val lon: Double?, private val lonSpan: Double?, private val query: String?, private val radius: Double?, @@ -23,12 +22,14 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - fun lat(): Double = lat - - fun lon(): Double = lon + /** If omitted, defaults to 0.0. */ + fun lat(): Optional = Optional.ofNullable(lat) fun latSpan(): Optional = Optional.ofNullable(latSpan) + /** If omitted, defaults to 0.0. */ + fun lon(): Optional = Optional.ofNullable(lon) + fun lonSpan(): Optional = Optional.ofNullable(lonSpan) fun query(): Optional = Optional.ofNullable(query) @@ -45,14 +46,10 @@ private constructor( companion object { + @JvmStatic fun none(): RoutesForLocationListParams = builder().build() + /** * Returns a mutable builder for constructing an instance of [RoutesForLocationListParams]. - * - * The following fields are required: - * ```java - * .lat() - * .lon() - * ``` */ @JvmStatic fun builder() = Builder() } @@ -61,8 +58,8 @@ private constructor( class Builder internal constructor() { private var lat: Double? = null - private var lon: Double? = null private var latSpan: Double? = null + private var lon: Double? = null private var lonSpan: Double? = null private var query: String? = null private var radius: Double? = null @@ -72,8 +69,8 @@ private constructor( @JvmSynthetic internal fun from(routesForLocationListParams: RoutesForLocationListParams) = apply { lat = routesForLocationListParams.lat - lon = routesForLocationListParams.lon latSpan = routesForLocationListParams.latSpan + lon = routesForLocationListParams.lon lonSpan = routesForLocationListParams.lonSpan query = routesForLocationListParams.query radius = routesForLocationListParams.radius @@ -81,9 +78,18 @@ private constructor( additionalQueryParams = routesForLocationListParams.additionalQueryParams.toBuilder() } - fun lat(lat: Double) = apply { this.lat = lat } + /** If omitted, defaults to 0.0. */ + fun lat(lat: Double?) = apply { this.lat = lat } + + /** + * Alias for [Builder.lat]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun lat(lat: Double) = lat(lat as Double?) - fun lon(lon: Double) = apply { this.lon = lon } + /** Alias for calling [Builder.lat] with `lat.orElse(null)`. */ + fun lat(lat: Optional) = lat(lat.getOrNull()) fun latSpan(latSpan: Double?) = apply { this.latSpan = latSpan } @@ -97,6 +103,19 @@ private constructor( /** Alias for calling [Builder.latSpan] with `latSpan.orElse(null)`. */ fun latSpan(latSpan: Optional) = latSpan(latSpan.getOrNull()) + /** If omitted, defaults to 0.0. */ + fun lon(lon: Double?) = apply { this.lon = lon } + + /** + * Alias for [Builder.lon]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun lon(lon: Double) = lon(lon as Double?) + + /** Alias for calling [Builder.lon] with `lon.orElse(null)`. */ + fun lon(lon: Optional) = lon(lon.getOrNull()) + fun lonSpan(lonSpan: Double?) = apply { this.lonSpan = lonSpan } /** @@ -228,20 +247,12 @@ private constructor( * Returns an immutable instance of [RoutesForLocationListParams]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .lat() - * .lon() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ fun build(): RoutesForLocationListParams = RoutesForLocationListParams( - checkRequired("lat", lat), - checkRequired("lon", lon), + lat, latSpan, + lon, lonSpan, query, radius, @@ -255,9 +266,9 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - put("lat", lat.toString()) - put("lon", lon.toString()) + lat?.let { put("lat", it.toString()) } latSpan?.let { put("latSpan", it.toString()) } + lon?.let { put("lon", it.toString()) } lonSpan?.let { put("lonSpan", it.toString()) } query?.let { put("query", it) } radius?.let { put("radius", it.toString()) } @@ -272,8 +283,8 @@ private constructor( return other is RoutesForLocationListParams && lat == other.lat && - lon == other.lon && latSpan == other.latSpan && + lon == other.lon && lonSpan == other.lonSpan && query == other.query && radius == other.radius && @@ -284,8 +295,8 @@ private constructor( override fun hashCode(): Int = Objects.hash( lat, - lon, latSpan, + lon, lonSpan, query, radius, @@ -294,5 +305,5 @@ private constructor( ) override fun toString() = - "RoutesForLocationListParams{lat=$lat, lon=$lon, latSpan=$latSpan, lonSpan=$lonSpan, query=$query, radius=$radius, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "RoutesForLocationListParams{lat=$lat, latSpan=$latSpan, lon=$lon, lonSpan=$lonSpan, query=$query, radius=$radius, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParams.kt b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParams.kt index d153274..13b092c 100644 --- a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParams.kt +++ b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParams.kt @@ -6,16 +6,15 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull import org.onebusaway.core.Params -import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers import org.onebusaway.core.http.QueryParams /** stops-for-location */ class StopsForLocationListParams private constructor( - private val lat: Double, - private val lon: Double, + private val lat: Double?, private val latSpan: Double?, + private val lon: Double?, private val lonSpan: Double?, private val query: String?, private val radius: Double?, @@ -23,13 +22,15 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - fun lat(): Double = lat - - fun lon(): Double = lon + /** If omitted, defaults to 0.0. */ + fun lat(): Optional = Optional.ofNullable(lat) /** An alternative to radius to set the search bounding box (optional) */ fun latSpan(): Optional = Optional.ofNullable(latSpan) + /** If omitted, defaults to 0.0. */ + fun lon(): Optional = Optional.ofNullable(lon) + /** An alternative to radius to set the search bounding box (optional) */ fun lonSpan(): Optional = Optional.ofNullable(lonSpan) @@ -49,14 +50,10 @@ private constructor( companion object { + @JvmStatic fun none(): StopsForLocationListParams = builder().build() + /** * Returns a mutable builder for constructing an instance of [StopsForLocationListParams]. - * - * The following fields are required: - * ```java - * .lat() - * .lon() - * ``` */ @JvmStatic fun builder() = Builder() } @@ -65,8 +62,8 @@ private constructor( class Builder internal constructor() { private var lat: Double? = null - private var lon: Double? = null private var latSpan: Double? = null + private var lon: Double? = null private var lonSpan: Double? = null private var query: String? = null private var radius: Double? = null @@ -76,8 +73,8 @@ private constructor( @JvmSynthetic internal fun from(stopsForLocationListParams: StopsForLocationListParams) = apply { lat = stopsForLocationListParams.lat - lon = stopsForLocationListParams.lon latSpan = stopsForLocationListParams.latSpan + lon = stopsForLocationListParams.lon lonSpan = stopsForLocationListParams.lonSpan query = stopsForLocationListParams.query radius = stopsForLocationListParams.radius @@ -85,9 +82,18 @@ private constructor( additionalQueryParams = stopsForLocationListParams.additionalQueryParams.toBuilder() } - fun lat(lat: Double) = apply { this.lat = lat } + /** If omitted, defaults to 0.0. */ + fun lat(lat: Double?) = apply { this.lat = lat } + + /** + * Alias for [Builder.lat]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun lat(lat: Double) = lat(lat as Double?) - fun lon(lon: Double) = apply { this.lon = lon } + /** Alias for calling [Builder.lat] with `lat.orElse(null)`. */ + fun lat(lat: Optional) = lat(lat.getOrNull()) /** An alternative to radius to set the search bounding box (optional) */ fun latSpan(latSpan: Double?) = apply { this.latSpan = latSpan } @@ -102,6 +108,19 @@ private constructor( /** Alias for calling [Builder.latSpan] with `latSpan.orElse(null)`. */ fun latSpan(latSpan: Optional) = latSpan(latSpan.getOrNull()) + /** If omitted, defaults to 0.0. */ + fun lon(lon: Double?) = apply { this.lon = lon } + + /** + * Alias for [Builder.lon]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun lon(lon: Double) = lon(lon as Double?) + + /** Alias for calling [Builder.lon] with `lon.orElse(null)`. */ + fun lon(lon: Optional) = lon(lon.getOrNull()) + /** An alternative to radius to set the search bounding box (optional) */ fun lonSpan(lonSpan: Double?) = apply { this.lonSpan = lonSpan } @@ -236,20 +255,12 @@ private constructor( * Returns an immutable instance of [StopsForLocationListParams]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .lat() - * .lon() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ fun build(): StopsForLocationListParams = StopsForLocationListParams( - checkRequired("lat", lat), - checkRequired("lon", lon), + lat, latSpan, + lon, lonSpan, query, radius, @@ -263,9 +274,9 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - put("lat", lat.toString()) - put("lon", lon.toString()) + lat?.let { put("lat", it.toString()) } latSpan?.let { put("latSpan", it.toString()) } + lon?.let { put("lon", it.toString()) } lonSpan?.let { put("lonSpan", it.toString()) } query?.let { put("query", it) } radius?.let { put("radius", it.toString()) } @@ -280,8 +291,8 @@ private constructor( return other is StopsForLocationListParams && lat == other.lat && - lon == other.lon && latSpan == other.latSpan && + lon == other.lon && lonSpan == other.lonSpan && query == other.query && radius == other.radius && @@ -292,8 +303,8 @@ private constructor( override fun hashCode(): Int = Objects.hash( lat, - lon, latSpan, + lon, lonSpan, query, radius, @@ -302,5 +313,5 @@ private constructor( ) override fun toString() = - "StopsForLocationListParams{lat=$lat, lon=$lon, latSpan=$latSpan, lonSpan=$lonSpan, query=$query, radius=$radius, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "StopsForLocationListParams{lat=$lat, latSpan=$latSpan, lon=$lon, lonSpan=$lonSpan, query=$query, radius=$radius, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParams.kt b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParams.kt index 0b4a6fd..174ef80 100644 --- a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParams.kt +++ b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParams.kt @@ -13,35 +13,35 @@ import org.onebusaway.core.http.QueryParams /** Retrieve trips for a given location */ class TripsForLocationListParams private constructor( - private val lat: Float, private val latSpan: Float, - private val lon: Float, private val lonSpan: Float, private val includeSchedule: Boolean?, private val includeTrip: Boolean?, + private val lat: Float?, + private val lon: Float?, private val time: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { - /** The latitude coordinate of the search center */ - fun lat(): Float = lat - /** Latitude span of the search bounding box */ fun latSpan(): Float = latSpan - /** The longitude coordinate of the search center */ - fun lon(): Float = lon - /** Longitude span of the search bounding box */ fun lonSpan(): Float = lonSpan /** Whether to include full schedule elements in the tripDetails section. Defaults to false. */ fun includeSchedule(): Optional = Optional.ofNullable(includeSchedule) - /** Whether to include full trip elements in the references section. Defaults to false. */ + /** Whether to include full trip elements in the references section. Defaults to true. */ fun includeTrip(): Optional = Optional.ofNullable(includeTrip) + /** The latitude coordinate of the search center. If omitted, defaults to 0.0. */ + fun lat(): Optional = Optional.ofNullable(lat) + + /** The longitude coordinate of the search center. If omitted, defaults to 0.0. */ + fun lon(): Optional = Optional.ofNullable(lon) + /** Specific time for the query. Defaults to the current time. */ fun time(): Optional = Optional.ofNullable(time) @@ -60,9 +60,7 @@ private constructor( * * The following fields are required: * ```java - * .lat() * .latSpan() - * .lon() * .lonSpan() * ``` */ @@ -72,38 +70,32 @@ private constructor( /** A builder for [TripsForLocationListParams]. */ class Builder internal constructor() { - private var lat: Float? = null private var latSpan: Float? = null - private var lon: Float? = null private var lonSpan: Float? = null private var includeSchedule: Boolean? = null private var includeTrip: Boolean? = null + private var lat: Float? = null + private var lon: Float? = null private var time: Long? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(tripsForLocationListParams: TripsForLocationListParams) = apply { - lat = tripsForLocationListParams.lat latSpan = tripsForLocationListParams.latSpan - lon = tripsForLocationListParams.lon lonSpan = tripsForLocationListParams.lonSpan includeSchedule = tripsForLocationListParams.includeSchedule includeTrip = tripsForLocationListParams.includeTrip + lat = tripsForLocationListParams.lat + lon = tripsForLocationListParams.lon time = tripsForLocationListParams.time additionalHeaders = tripsForLocationListParams.additionalHeaders.toBuilder() additionalQueryParams = tripsForLocationListParams.additionalQueryParams.toBuilder() } - /** The latitude coordinate of the search center */ - fun lat(lat: Float) = apply { this.lat = lat } - /** Latitude span of the search bounding box */ fun latSpan(latSpan: Float) = apply { this.latSpan = latSpan } - /** The longitude coordinate of the search center */ - fun lon(lon: Float) = apply { this.lon = lon } - /** Longitude span of the search bounding box */ fun lonSpan(lonSpan: Float) = apply { this.lonSpan = lonSpan } @@ -125,7 +117,7 @@ private constructor( fun includeSchedule(includeSchedule: Optional) = includeSchedule(includeSchedule.getOrNull()) - /** Whether to include full trip elements in the references section. Defaults to false. */ + /** Whether to include full trip elements in the references section. Defaults to true. */ fun includeTrip(includeTrip: Boolean?) = apply { this.includeTrip = includeTrip } /** @@ -138,6 +130,32 @@ private constructor( /** Alias for calling [Builder.includeTrip] with `includeTrip.orElse(null)`. */ fun includeTrip(includeTrip: Optional) = includeTrip(includeTrip.getOrNull()) + /** The latitude coordinate of the search center. If omitted, defaults to 0.0. */ + fun lat(lat: Float?) = apply { this.lat = lat } + + /** + * Alias for [Builder.lat]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun lat(lat: Float) = lat(lat as Float?) + + /** Alias for calling [Builder.lat] with `lat.orElse(null)`. */ + fun lat(lat: Optional) = lat(lat.getOrNull()) + + /** The longitude coordinate of the search center. If omitted, defaults to 0.0. */ + fun lon(lon: Float?) = apply { this.lon = lon } + + /** + * Alias for [Builder.lon]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun lon(lon: Float) = lon(lon as Float?) + + /** Alias for calling [Builder.lon] with `lon.orElse(null)`. */ + fun lon(lon: Optional) = lon(lon.getOrNull()) + /** Specific time for the query. Defaults to the current time. */ fun time(time: Long?) = apply { this.time = time } @@ -256,9 +274,7 @@ private constructor( * * The following fields are required: * ```java - * .lat() * .latSpan() - * .lon() * .lonSpan() * ``` * @@ -266,12 +282,12 @@ private constructor( */ fun build(): TripsForLocationListParams = TripsForLocationListParams( - checkRequired("lat", lat), checkRequired("latSpan", latSpan), - checkRequired("lon", lon), checkRequired("lonSpan", lonSpan), includeSchedule, includeTrip, + lat, + lon, time, additionalHeaders.build(), additionalQueryParams.build(), @@ -283,12 +299,12 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - put("lat", lat.toString()) put("latSpan", latSpan.toString()) - put("lon", lon.toString()) put("lonSpan", lonSpan.toString()) includeSchedule?.let { put("includeSchedule", it.toString()) } includeTrip?.let { put("includeTrip", it.toString()) } + lat?.let { put("lat", it.toString()) } + lon?.let { put("lon", it.toString()) } time?.let { put("time", it.toString()) } putAll(additionalQueryParams) } @@ -300,12 +316,12 @@ private constructor( } return other is TripsForLocationListParams && - lat == other.lat && latSpan == other.latSpan && - lon == other.lon && lonSpan == other.lonSpan && includeSchedule == other.includeSchedule && includeTrip == other.includeTrip && + lat == other.lat && + lon == other.lon && time == other.time && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams @@ -313,17 +329,17 @@ private constructor( override fun hashCode(): Int = Objects.hash( - lat, latSpan, - lon, lonSpan, includeSchedule, includeTrip, + lat, + lon, time, additionalHeaders, additionalQueryParams, ) override fun toString() = - "TripsForLocationListParams{lat=$lat, latSpan=$latSpan, lon=$lon, lonSpan=$lonSpan, includeSchedule=$includeSchedule, includeTrip=$includeTrip, time=$time, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "TripsForLocationListParams{latSpan=$latSpan, lonSpan=$lonSpan, includeSchedule=$includeSchedule, includeTrip=$includeTrip, lat=$lat, lon=$lon, time=$time, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsync.kt b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsync.kt index 4139e16..c529a03 100644 --- a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsync.kt +++ b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsync.kt @@ -25,16 +25,24 @@ interface RoutesForLocationServiceAsync { fun withOptions(modifier: Consumer): RoutesForLocationServiceAsync /** routes-for-location */ - fun list( - params: RoutesForLocationListParams - ): CompletableFuture = list(params, RequestOptions.none()) + fun list(): CompletableFuture = + list(RoutesForLocationListParams.none()) /** @see list */ fun list( - params: RoutesForLocationListParams, + params: RoutesForLocationListParams = RoutesForLocationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** @see list */ + fun list( + params: RoutesForLocationListParams = RoutesForLocationListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(RoutesForLocationListParams.none(), requestOptions) + /** * A view of [RoutesForLocationServiceAsync] that provides access to raw HTTP responses for each * method. @@ -54,15 +62,25 @@ interface RoutesForLocationServiceAsync { * Returns a raw HTTP response for `get /api/where/routes-for-location.json`, but is * otherwise the same as [RoutesForLocationServiceAsync.list]. */ + fun list(): CompletableFuture> = + list(RoutesForLocationListParams.none()) + + /** @see list */ fun list( - params: RoutesForLocationListParams + params: RoutesForLocationListParams = RoutesForLocationListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: RoutesForLocationListParams = RoutesForLocationListParams.none() ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( - params: RoutesForLocationListParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + requestOptions: RequestOptions + ): CompletableFuture> = + list(RoutesForLocationListParams.none(), requestOptions) } } diff --git a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsync.kt b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsync.kt index 678d52a..2df3ef6 100644 --- a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsync.kt +++ b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsync.kt @@ -25,15 +25,24 @@ interface StopsForLocationServiceAsync { fun withOptions(modifier: Consumer): StopsForLocationServiceAsync /** stops-for-location */ - fun list(params: StopsForLocationListParams): CompletableFuture = - list(params, RequestOptions.none()) + fun list(): CompletableFuture = + list(StopsForLocationListParams.none()) /** @see list */ fun list( - params: StopsForLocationListParams, + params: StopsForLocationListParams = StopsForLocationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** @see list */ + fun list( + params: StopsForLocationListParams = StopsForLocationListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(StopsForLocationListParams.none(), requestOptions) + /** * A view of [StopsForLocationServiceAsync] that provides access to raw HTTP responses for each * method. @@ -53,15 +62,25 @@ interface StopsForLocationServiceAsync { * Returns a raw HTTP response for `get /api/where/stops-for-location.json`, but is * otherwise the same as [StopsForLocationServiceAsync.list]. */ + fun list(): CompletableFuture> = + list(StopsForLocationListParams.none()) + + /** @see list */ fun list( - params: StopsForLocationListParams + params: StopsForLocationListParams = StopsForLocationListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: StopsForLocationListParams = StopsForLocationListParams.none() ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( - params: StopsForLocationListParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + requestOptions: RequestOptions + ): CompletableFuture> = + list(StopsForLocationListParams.none(), requestOptions) } } diff --git a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationService.kt b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationService.kt index 2500877..3b8861d 100644 --- a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationService.kt +++ b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationService.kt @@ -25,15 +25,23 @@ interface RoutesForLocationService { fun withOptions(modifier: Consumer): RoutesForLocationService /** routes-for-location */ - fun list(params: RoutesForLocationListParams): RoutesForLocationListResponse = - list(params, RequestOptions.none()) + fun list(): RoutesForLocationListResponse = list(RoutesForLocationListParams.none()) /** @see list */ fun list( - params: RoutesForLocationListParams, + params: RoutesForLocationListParams = RoutesForLocationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): RoutesForLocationListResponse + /** @see list */ + fun list( + params: RoutesForLocationListParams = RoutesForLocationListParams.none() + ): RoutesForLocationListResponse = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): RoutesForLocationListResponse = + list(RoutesForLocationListParams.none(), requestOptions) + /** * A view of [RoutesForLocationService] that provides access to raw HTTP responses for each * method. @@ -54,15 +62,25 @@ interface RoutesForLocationService { * otherwise the same as [RoutesForLocationService.list]. */ @MustBeClosed - fun list( - params: RoutesForLocationListParams - ): HttpResponseFor = list(params, RequestOptions.none()) + fun list(): HttpResponseFor = + list(RoutesForLocationListParams.none()) /** @see list */ @MustBeClosed fun list( - params: RoutesForLocationListParams, + params: RoutesForLocationListParams = RoutesForLocationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: RoutesForLocationListParams = RoutesForLocationListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(RoutesForLocationListParams.none(), requestOptions) } } diff --git a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationService.kt b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationService.kt index ab1b432..7424248 100644 --- a/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationService.kt +++ b/onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationService.kt @@ -25,15 +25,23 @@ interface StopsForLocationService { fun withOptions(modifier: Consumer): StopsForLocationService /** stops-for-location */ - fun list(params: StopsForLocationListParams): StopsForLocationListResponse = - list(params, RequestOptions.none()) + fun list(): StopsForLocationListResponse = list(StopsForLocationListParams.none()) /** @see list */ fun list( - params: StopsForLocationListParams, + params: StopsForLocationListParams = StopsForLocationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): StopsForLocationListResponse + /** @see list */ + fun list( + params: StopsForLocationListParams = StopsForLocationListParams.none() + ): StopsForLocationListResponse = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): StopsForLocationListResponse = + list(StopsForLocationListParams.none(), requestOptions) + /** * A view of [StopsForLocationService] that provides access to raw HTTP responses for each * method. @@ -54,15 +62,25 @@ interface StopsForLocationService { * otherwise the same as [StopsForLocationService.list]. */ @MustBeClosed - fun list( - params: StopsForLocationListParams - ): HttpResponseFor = list(params, RequestOptions.none()) + fun list(): HttpResponseFor = + list(StopsForLocationListParams.none()) /** @see list */ @MustBeClosed fun list( - params: StopsForLocationListParams, + params: StopsForLocationListParams = StopsForLocationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: StopsForLocationListParams = StopsForLocationListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(StopsForLocationListParams.none(), requestOptions) } } diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParamsTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParamsTest.kt index f5bbb0c..81ff08d 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParamsTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/routesforlocation/RoutesForLocationListParamsTest.kt @@ -12,8 +12,8 @@ internal class RoutesForLocationListParamsTest { fun create() { RoutesForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) @@ -25,8 +25,8 @@ internal class RoutesForLocationListParamsTest { val params = RoutesForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) @@ -38,8 +38,8 @@ internal class RoutesForLocationListParamsTest { .isEqualTo( QueryParams.builder() .put("lat", "0.0") - .put("lon", "0.0") .put("latSpan", "0.0") + .put("lon", "0.0") .put("lonSpan", "0.0") .put("query", "query") .put("radius", "0.0") @@ -49,11 +49,10 @@ internal class RoutesForLocationListParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = RoutesForLocationListParams.builder().lat(0.0).lon(0.0).build() + val params = RoutesForLocationListParams.builder().build() val queryParams = params._queryParams() - assertThat(queryParams) - .isEqualTo(QueryParams.builder().put("lat", "0.0").put("lon", "0.0").build()) + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) } } diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParamsTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParamsTest.kt index 768453e..06cf2b1 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParamsTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/stopsforlocation/StopsForLocationListParamsTest.kt @@ -12,8 +12,8 @@ internal class StopsForLocationListParamsTest { fun create() { StopsForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) @@ -25,8 +25,8 @@ internal class StopsForLocationListParamsTest { val params = StopsForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) @@ -38,8 +38,8 @@ internal class StopsForLocationListParamsTest { .isEqualTo( QueryParams.builder() .put("lat", "0.0") - .put("lon", "0.0") .put("latSpan", "0.0") + .put("lon", "0.0") .put("lonSpan", "0.0") .put("query", "query") .put("radius", "0.0") @@ -49,11 +49,10 @@ internal class StopsForLocationListParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = StopsForLocationListParams.builder().lat(0.0).lon(0.0).build() + val params = StopsForLocationListParams.builder().build() val queryParams = params._queryParams() - assertThat(queryParams) - .isEqualTo(QueryParams.builder().put("lat", "0.0").put("lon", "0.0").build()) + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) } } diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParamsTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParamsTest.kt index c44330e..8555383 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParamsTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/models/tripsforlocation/TripsForLocationListParamsTest.kt @@ -11,12 +11,12 @@ internal class TripsForLocationListParamsTest { @Test fun create() { TripsForLocationListParams.builder() - .lat(0.0f) .latSpan(0.0f) - .lon(0.0f) .lonSpan(0.0f) .includeSchedule(true) .includeTrip(true) + .lat(0.0f) + .lon(0.0f) .time(0L) .build() } @@ -25,12 +25,12 @@ internal class TripsForLocationListParamsTest { fun queryParams() { val params = TripsForLocationListParams.builder() - .lat(0.0f) .latSpan(0.0f) - .lon(0.0f) .lonSpan(0.0f) .includeSchedule(true) .includeTrip(true) + .lat(0.0f) + .lon(0.0f) .time(0L) .build() @@ -39,12 +39,12 @@ internal class TripsForLocationListParamsTest { assertThat(queryParams) .isEqualTo( QueryParams.builder() - .put("lat", "0.0") .put("latSpan", "0.0") - .put("lon", "0.0") .put("lonSpan", "0.0") .put("includeSchedule", "true") .put("includeTrip", "true") + .put("lat", "0.0") + .put("lon", "0.0") .put("time", "0") .build() ) @@ -52,24 +52,11 @@ internal class TripsForLocationListParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = - TripsForLocationListParams.builder() - .lat(0.0f) - .latSpan(0.0f) - .lon(0.0f) - .lonSpan(0.0f) - .build() + val params = TripsForLocationListParams.builder().latSpan(0.0f).lonSpan(0.0f).build() val queryParams = params._queryParams() assertThat(queryParams) - .isEqualTo( - QueryParams.builder() - .put("lat", "0.0") - .put("latSpan", "0.0") - .put("lon", "0.0") - .put("lonSpan", "0.0") - .build() - ) + .isEqualTo(QueryParams.builder().put("latSpan", "0.0").put("lonSpan", "0.0").build()) } } diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncTest.kt index c1ef31c..7e0d985 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncTest.kt @@ -24,8 +24,8 @@ internal class RoutesForLocationServiceAsyncTest { routesForLocationServiceAsync.list( RoutesForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncTest.kt index 9af0137..c6a60a2 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncTest.kt @@ -24,8 +24,8 @@ internal class StopsForLocationServiceAsyncTest { stopsForLocationServiceAsync.list( StopsForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncTest.kt index debd1d8..6fa468d 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncTest.kt @@ -23,12 +23,12 @@ internal class TripsForLocationServiceAsyncTest { val tripsForLocationsFuture = tripsForLocationServiceAsync.list( TripsForLocationListParams.builder() - .lat(0.0f) .latSpan(0.0f) - .lon(0.0f) .lonSpan(0.0f) .includeSchedule(true) .includeTrip(true) + .lat(0.0f) + .lon(0.0f) .time(0L) .build() ) diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceTest.kt index 376eeee..3df0d31 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceTest.kt @@ -24,8 +24,8 @@ internal class RoutesForLocationServiceTest { routesForLocationService.list( RoutesForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceTest.kt index be4b08c..69e3280 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceTest.kt @@ -24,8 +24,8 @@ internal class StopsForLocationServiceTest { stopsForLocationService.list( StopsForLocationListParams.builder() .lat(0.0) - .lon(0.0) .latSpan(0.0) + .lon(0.0) .lonSpan(0.0) .query("query") .radius(0.0) diff --git a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceTest.kt b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceTest.kt index 1042ce0..80c84fc 100644 --- a/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceTest.kt +++ b/onebusaway-sdk-java-core/src/test/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceTest.kt @@ -23,12 +23,12 @@ internal class TripsForLocationServiceTest { val tripsForLocations = tripsForLocationService.list( TripsForLocationListParams.builder() - .lat(0.0f) .latSpan(0.0f) - .lon(0.0f) .lonSpan(0.0f) .includeSchedule(true) .includeTrip(true) + .lat(0.0f) + .lon(0.0f) .time(0L) .build() )