From f8dcccc746f962f5a44879208a402af77d7750d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 06:22:37 +0000 Subject: [PATCH] chore(client)!: refactor exception structure and methods # Migration Previously you would access error JSON on an exception via `exception.error()._additionalProperties()`, which would return `Map`. Now you would access this via `exception.body()`, which returns `JsonValue`. You should no longer assume that the returned error JSON is an object. You can check via `exception.body().asObject()`. --- .../onebusaway/core/handlers/ErrorHandler.kt | 151 ++++++------------ .../onebusaway/errors/BadRequestException.kt | 72 ++++++++- .../errors/InternalServerException.kt | 87 +++++++++- .../onebusaway/errors/NotFoundException.kt | 68 +++++++- .../onebusaway/errors/OnebusawaySdkError.kt | 80 ---------- .../errors/OnebusawaySdkServiceException.kt | 22 ++- .../errors/PermissionDeniedException.kt | 72 ++++++++- .../onebusaway/errors/RateLimitException.kt | 72 ++++++++- .../errors/UnauthorizedException.kt | 72 ++++++++- .../errors/UnexpectedStatusCodeException.kt | 88 +++++++++- .../errors/UnprocessableEntityException.kt | 72 ++++++++- .../AgenciesWithCoverageServiceAsyncImpl.kt | 5 +- .../services/async/AgencyServiceAsyncImpl.kt | 5 +- .../ArrivalAndDepartureServiceAsyncImpl.kt | 5 +- .../services/async/BlockServiceAsyncImpl.kt | 5 +- .../services/async/ConfigServiceAsyncImpl.kt | 5 +- .../async/CurrentTimeServiceAsyncImpl.kt | 5 +- .../ReportProblemWithStopServiceAsyncImpl.kt | 5 +- .../ReportProblemWithTripServiceAsyncImpl.kt | 5 +- .../RouteIdsForAgencyServiceAsyncImpl.kt | 5 +- .../services/async/RouteServiceAsyncImpl.kt | 5 +- .../async/RoutesForAgencyServiceAsyncImpl.kt | 5 +- .../RoutesForLocationServiceAsyncImpl.kt | 5 +- .../async/ScheduleForRouteServiceAsyncImpl.kt | 5 +- .../async/ScheduleForStopServiceAsyncImpl.kt | 5 +- .../async/SearchForRouteServiceAsyncImpl.kt | 5 +- .../async/SearchForStopServiceAsyncImpl.kt | 5 +- .../services/async/ShapeServiceAsyncImpl.kt | 5 +- .../async/StopIdsForAgencyServiceAsyncImpl.kt | 5 +- .../services/async/StopServiceAsyncImpl.kt | 5 +- .../async/StopsForAgencyServiceAsyncImpl.kt | 5 +- .../async/StopsForLocationServiceAsyncImpl.kt | 5 +- .../async/StopsForRouteServiceAsyncImpl.kt | 5 +- .../async/TripDetailServiceAsyncImpl.kt | 5 +- .../async/TripForVehicleServiceAsyncImpl.kt | 5 +- .../services/async/TripServiceAsyncImpl.kt | 5 +- .../async/TripsForLocationServiceAsyncImpl.kt | 5 +- .../async/TripsForRouteServiceAsyncImpl.kt | 5 +- .../VehiclesForAgencyServiceAsyncImpl.kt | 5 +- .../AgenciesWithCoverageServiceImpl.kt | 5 +- .../services/blocking/AgencyServiceImpl.kt | 5 +- .../ArrivalAndDepartureServiceImpl.kt | 5 +- .../services/blocking/BlockServiceImpl.kt | 5 +- .../services/blocking/ConfigServiceImpl.kt | 5 +- .../blocking/CurrentTimeServiceImpl.kt | 5 +- .../ReportProblemWithStopServiceImpl.kt | 5 +- .../ReportProblemWithTripServiceImpl.kt | 5 +- .../blocking/RouteIdsForAgencyServiceImpl.kt | 5 +- .../services/blocking/RouteServiceImpl.kt | 5 +- .../blocking/RoutesForAgencyServiceImpl.kt | 5 +- .../blocking/RoutesForLocationServiceImpl.kt | 5 +- .../blocking/ScheduleForRouteServiceImpl.kt | 5 +- .../blocking/ScheduleForStopServiceImpl.kt | 5 +- .../blocking/SearchForRouteServiceImpl.kt | 5 +- .../blocking/SearchForStopServiceImpl.kt | 5 +- .../services/blocking/ShapeServiceImpl.kt | 5 +- .../blocking/StopIdsForAgencyServiceImpl.kt | 5 +- .../services/blocking/StopServiceImpl.kt | 5 +- .../blocking/StopsForAgencyServiceImpl.kt | 5 +- .../blocking/StopsForLocationServiceImpl.kt | 5 +- .../blocking/StopsForRouteServiceImpl.kt | 5 +- .../blocking/TripDetailServiceImpl.kt | 5 +- .../blocking/TripForVehicleServiceImpl.kt | 5 +- .../services/blocking/TripServiceImpl.kt | 5 +- .../blocking/TripsForLocationServiceImpl.kt | 5 +- .../blocking/TripsForRouteServiceImpl.kt | 5 +- .../blocking/VehiclesForAgencyServiceImpl.kt | 5 +- .../onebusaway/services/ErrorHandlingTest.kt | 56 ++++--- 68 files changed, 787 insertions(+), 405 deletions(-) delete mode 100644 onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkError.kt diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/handlers/ErrorHandler.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/handlers/ErrorHandler.kt index 60f452ff..757aada9 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/handlers/ErrorHandler.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/handlers/ErrorHandler.kt @@ -1,125 +1,80 @@ -@file:JvmName("ErrorHandler") +// File generated from our OpenAPI spec by Stainless. package org.onebusaway.core.handlers import com.fasterxml.jackson.databind.json.JsonMapper -import java.io.ByteArrayInputStream -import java.io.InputStream -import org.onebusaway.core.http.Headers +import org.onebusaway.core.JsonMissing +import org.onebusaway.core.JsonValue import org.onebusaway.core.http.HttpResponse import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.errors.BadRequestException import org.onebusaway.errors.InternalServerException import org.onebusaway.errors.NotFoundException -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.errors.PermissionDeniedException import org.onebusaway.errors.RateLimitException import org.onebusaway.errors.UnauthorizedException import org.onebusaway.errors.UnexpectedStatusCodeException import org.onebusaway.errors.UnprocessableEntityException -internal fun errorHandler(jsonMapper: JsonMapper): Handler { - val handler = jsonHandler(jsonMapper) +internal fun errorHandler(jsonMapper: JsonMapper): Handler { + val handler = jsonHandler(jsonMapper) - return object : Handler { - override fun handle(response: HttpResponse): OnebusawaySdkError = + return object : Handler { + override fun handle(response: HttpResponse): JsonValue = try { handler.handle(response) } catch (e: Exception) { - OnebusawaySdkError.builder().build() + JsonMissing.of() } } } -internal fun Handler.withErrorHandler( - errorHandler: Handler -): Handler = +internal fun Handler.withErrorHandler(errorHandler: Handler): Handler = object : Handler { - override fun handle(response: HttpResponse): T { + override fun handle(response: HttpResponse): T = when (val statusCode = response.statusCode()) { - in 200..299 -> { - return this@withErrorHandler.handle(response) - } - 400 -> { - val buffered = response.buffered() - throw BadRequestException( - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } - 401 -> { - val buffered = response.buffered() - throw UnauthorizedException( - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } - 403 -> { - val buffered = response.buffered() - throw PermissionDeniedException( - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } - 404 -> { - val buffered = response.buffered() - throw NotFoundException( - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } - 422 -> { - val buffered = response.buffered() - throw UnprocessableEntityException( - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } - 429 -> { - val buffered = response.buffered() - throw RateLimitException( - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } - in 500..599 -> { - val buffered = response.buffered() - throw InternalServerException( - statusCode, - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } - else -> { - val buffered = response.buffered() - throw UnexpectedStatusCodeException( - statusCode, - buffered.headers(), - stringHandler().handle(buffered), - errorHandler.handle(buffered), - ) - } + in 200..299 -> this@withErrorHandler.handle(response) + 400 -> + throw BadRequestException.builder() + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() + 401 -> + throw UnauthorizedException.builder() + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() + 403 -> + throw PermissionDeniedException.builder() + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() + 404 -> + throw NotFoundException.builder() + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() + 422 -> + throw UnprocessableEntityException.builder() + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() + 429 -> + throw RateLimitException.builder() + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() + in 500..599 -> + throw InternalServerException.builder() + .statusCode(statusCode) + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() + else -> + throw UnexpectedStatusCodeException.builder() + .statusCode(statusCode) + .headers(response.headers()) + .body(errorHandler.handle(response)) + .build() } - } } - -private fun HttpResponse.buffered(): HttpResponse { - val body = body().readBytes() - - return object : HttpResponse { - override fun statusCode(): Int = this@buffered.statusCode() - - override fun headers(): Headers = this@buffered.headers() - - override fun body(): InputStream = ByteArrayInputStream(body) - - override fun close() = this@buffered.close() - } -} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/BadRequestException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/BadRequestException.kt index acec7658..e943a170 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/BadRequestException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/BadRequestException.kt @@ -1,6 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class BadRequestException(headers: Headers, body: String, error: OnebusawaySdkError) : - OnebusawaySdkServiceException(400, headers, body, error) +class BadRequestException +private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : + OnebusawaySdkServiceException("400: $body", cause) { + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + override fun statusCode(): Int = 400 + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [BadRequestException]. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [BadRequestException]. */ + class Builder internal constructor() { + + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(badRequestException: BadRequestException) = apply { + headers = badRequestException.headers + body = badRequestException.body + cause = badRequestException.cause + } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [BadRequestException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BadRequestException = + BadRequestException( + checkRequired("headers", headers), + checkRequired("body", body), + cause, + ) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/InternalServerException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/InternalServerException.kt index b99d5f01..22fd5d15 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/InternalServerException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/InternalServerException.kt @@ -1,10 +1,85 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class InternalServerException( - statusCode: Int, - headers: Headers, - body: String, - error: OnebusawaySdkError, -) : OnebusawaySdkServiceException(statusCode, headers, body, error) +class InternalServerException +private constructor( + private val statusCode: Int, + private val headers: Headers, + private val body: JsonValue, + cause: Throwable?, +) : OnebusawaySdkServiceException("$statusCode: $body", cause) { + + override fun statusCode(): Int = statusCode + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [InternalServerException]. + * + * The following fields are required: + * ```kotlin + * .statusCode() + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [InternalServerException]. */ + class Builder internal constructor() { + + private var statusCode: Int? = null + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(internalServerException: InternalServerException) = apply { + statusCode = internalServerException.statusCode + headers = internalServerException.headers + body = internalServerException.body + cause = internalServerException.cause + } + + fun statusCode(statusCode: Int) = apply { this.statusCode = statusCode } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [InternalServerException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .statusCode() + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InternalServerException = + InternalServerException( + checkRequired("statusCode", statusCode), + checkRequired("headers", headers), + checkRequired("body", body), + cause, + ) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/NotFoundException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/NotFoundException.kt index 269d2498..e646a741 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/NotFoundException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/NotFoundException.kt @@ -1,6 +1,70 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class NotFoundException(headers: Headers, body: String, error: OnebusawaySdkError) : - OnebusawaySdkServiceException(404, headers, body, error) +class NotFoundException +private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : + OnebusawaySdkServiceException("404: $body", cause) { + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + override fun statusCode(): Int = 404 + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [NotFoundException]. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [NotFoundException]. */ + class Builder internal constructor() { + + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(notFoundException: NotFoundException) = apply { + headers = notFoundException.headers + body = notFoundException.body + cause = notFoundException.cause + } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [NotFoundException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): NotFoundException = + NotFoundException(checkRequired("headers", headers), checkRequired("body", body), cause) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkError.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkError.kt deleted file mode 100644 index 394ad2d3..00000000 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkError.kt +++ /dev/null @@ -1,80 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package org.onebusaway.errors - -import com.fasterxml.jackson.annotation.JsonAnyGetter -import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.annotation.JsonCreator -import java.util.Objects -import org.onebusaway.core.ExcludeMissing -import org.onebusaway.core.JsonValue -import org.onebusaway.core.NoAutoDetect -import org.onebusaway.core.immutableEmptyMap -import org.onebusaway.core.toImmutable - -@NoAutoDetect -class OnebusawaySdkError -@JsonCreator -private constructor( - @JsonAnyGetter - @ExcludeMissing - @JsonAnySetter - val additionalProperties: Map = immutableEmptyMap() -) { - - fun toBuilder() = Builder().from(this) - - companion object { - - /** Returns a mutable builder for constructing an instance of [OnebusawaySdkError]. */ - fun builder() = Builder() - } - - /** A builder for [OnebusawaySdkError]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - internal fun from(onebusawaySdkError: OnebusawaySdkError) = apply { - additionalProperties = onebusawaySdkError.additionalProperties.toMutableMap() - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [OnebusawaySdkError]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): OnebusawaySdkError = OnebusawaySdkError(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is OnebusawaySdkError && additionalProperties == other.additionalProperties /* spotless:on */ - } - - override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - - override fun toString() = "OnebusawaySdkError{additionalProperties=$additionalProperties}" -} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkServiceException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkServiceException.kt index 76edcb33..9e14f042 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkServiceException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/OnebusawaySdkServiceException.kt @@ -1,21 +1,17 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue import org.onebusaway.core.http.Headers -abstract class OnebusawaySdkServiceException( - private val statusCode: Int, - private val headers: Headers, - private val body: String, - private val error: OnebusawaySdkError, - message: String = "$statusCode: $error", - cause: Throwable? = null, -) : OnebusawaySdkException(message, cause) { - - fun statusCode(): Int = statusCode +abstract class OnebusawaySdkServiceException +protected constructor(message: String, cause: Throwable? = null) : + OnebusawaySdkException(message, cause) { - fun headers(): Headers = headers + abstract fun statusCode(): Int - fun body(): String = body + abstract fun headers(): Headers - fun error(): OnebusawaySdkError = error + abstract fun body(): JsonValue } diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/PermissionDeniedException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/PermissionDeniedException.kt index 652f6728..8e26067c 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/PermissionDeniedException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/PermissionDeniedException.kt @@ -1,6 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class PermissionDeniedException(headers: Headers, body: String, error: OnebusawaySdkError) : - OnebusawaySdkServiceException(403, headers, body, error) +class PermissionDeniedException +private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : + OnebusawaySdkServiceException("403: $body", cause) { + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + override fun statusCode(): Int = 403 + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [PermissionDeniedException]. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [PermissionDeniedException]. */ + class Builder internal constructor() { + + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(permissionDeniedException: PermissionDeniedException) = apply { + headers = permissionDeniedException.headers + body = permissionDeniedException.body + cause = permissionDeniedException.cause + } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [PermissionDeniedException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PermissionDeniedException = + PermissionDeniedException( + checkRequired("headers", headers), + checkRequired("body", body), + cause, + ) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/RateLimitException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/RateLimitException.kt index 1ef6e264..a9c28f91 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/RateLimitException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/RateLimitException.kt @@ -1,6 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class RateLimitException(headers: Headers, body: String, error: OnebusawaySdkError) : - OnebusawaySdkServiceException(429, headers, body, error) +class RateLimitException +private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : + OnebusawaySdkServiceException("429: $body", cause) { + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + override fun statusCode(): Int = 429 + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [RateLimitException]. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [RateLimitException]. */ + class Builder internal constructor() { + + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(rateLimitException: RateLimitException) = apply { + headers = rateLimitException.headers + body = rateLimitException.body + cause = rateLimitException.cause + } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [RateLimitException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RateLimitException = + RateLimitException( + checkRequired("headers", headers), + checkRequired("body", body), + cause, + ) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnauthorizedException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnauthorizedException.kt index 6c180545..50284698 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnauthorizedException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnauthorizedException.kt @@ -1,6 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class UnauthorizedException(headers: Headers, body: String, error: OnebusawaySdkError) : - OnebusawaySdkServiceException(401, headers, body, error) +class UnauthorizedException +private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : + OnebusawaySdkServiceException("401: $body", cause) { + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + override fun statusCode(): Int = 401 + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [UnauthorizedException]. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [UnauthorizedException]. */ + class Builder internal constructor() { + + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(unauthorizedException: UnauthorizedException) = apply { + headers = unauthorizedException.headers + body = unauthorizedException.body + cause = unauthorizedException.cause + } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [UnauthorizedException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): UnauthorizedException = + UnauthorizedException( + checkRequired("headers", headers), + checkRequired("body", body), + cause, + ) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnexpectedStatusCodeException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnexpectedStatusCodeException.kt index 192fed63..9361ee0f 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnexpectedStatusCodeException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnexpectedStatusCodeException.kt @@ -1,10 +1,86 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class UnexpectedStatusCodeException( - statusCode: Int, - headers: Headers, - body: String, - error: OnebusawaySdkError, -) : OnebusawaySdkServiceException(statusCode, headers, body, error) +class UnexpectedStatusCodeException +private constructor( + private val statusCode: Int, + private val headers: Headers, + private val body: JsonValue, + cause: Throwable?, +) : OnebusawaySdkServiceException("$statusCode: $body", cause) { + + override fun statusCode(): Int = statusCode + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [UnexpectedStatusCodeException]. + * + * The following fields are required: + * ```kotlin + * .statusCode() + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [UnexpectedStatusCodeException]. */ + class Builder internal constructor() { + + private var statusCode: Int? = null + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(unexpectedStatusCodeException: UnexpectedStatusCodeException) = apply { + statusCode = unexpectedStatusCodeException.statusCode + headers = unexpectedStatusCodeException.headers + body = unexpectedStatusCodeException.body + cause = unexpectedStatusCodeException.cause + } + + fun statusCode(statusCode: Int) = apply { this.statusCode = statusCode } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [UnexpectedStatusCodeException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .statusCode() + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): UnexpectedStatusCodeException = + UnexpectedStatusCodeException( + checkRequired("statusCode", statusCode), + checkRequired("headers", headers), + checkRequired("body", body), + cause, + ) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnprocessableEntityException.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnprocessableEntityException.kt index 0c86a9e3..30b6f9d4 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnprocessableEntityException.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/errors/UnprocessableEntityException.kt @@ -1,6 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + package org.onebusaway.errors +import org.onebusaway.core.JsonValue +import org.onebusaway.core.checkRequired import org.onebusaway.core.http.Headers -class UnprocessableEntityException(headers: Headers, body: String, error: OnebusawaySdkError) : - OnebusawaySdkServiceException(422, headers, body, error) +class UnprocessableEntityException +private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : + OnebusawaySdkServiceException("422: $body", cause) { + + override fun headers(): Headers = headers + + override fun body(): JsonValue = body + + override fun statusCode(): Int = 422 + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [UnprocessableEntityException]. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + */ + fun builder() = Builder() + } + + /** A builder for [UnprocessableEntityException]. */ + class Builder internal constructor() { + + private var headers: Headers? = null + private var body: JsonValue? = null + private var cause: Throwable? = null + + internal fun from(unprocessableEntityException: UnprocessableEntityException) = apply { + headers = unprocessableEntityException.headers + body = unprocessableEntityException.body + cause = unprocessableEntityException.cause + } + + fun headers(headers: Headers) = apply { this.headers = headers } + + fun body(body: JsonValue) = apply { this.body = body } + + fun cause(cause: Throwable?) = apply { this.cause = cause } + + /** + * Returns an immutable instance of [UnprocessableEntityException]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```kotlin + * .headers() + * .body() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): UnprocessableEntityException = + UnprocessableEntityException( + checkRequired("headers", headers), + checkRequired("body", body), + cause, + ) + } +} diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgenciesWithCoverageServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgenciesWithCoverageServiceAsyncImpl.kt index dc429891..926a0de8 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgenciesWithCoverageServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgenciesWithCoverageServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.AgenciesWithCoverageListParams import org.onebusaway.models.AgenciesWithCoverageListResponse @@ -37,8 +37,7 @@ internal constructor(private val clientOptions: ClientOptions) : AgenciesWithCov class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : AgenciesWithCoverageServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgencyServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgencyServiceAsyncImpl.kt index 8e1ee333..36e630a9 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgencyServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/AgencyServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.AgencyRetrieveParams import org.onebusaway.models.AgencyRetrieveResponse @@ -36,8 +36,7 @@ class AgencyServiceAsyncImpl internal constructor(private val clientOptions: Cli class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : AgencyServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ArrivalAndDepartureServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ArrivalAndDepartureServiceAsyncImpl.kt index 11aaf7f7..2e78c1cd 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ArrivalAndDepartureServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ArrivalAndDepartureServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ArrivalAndDepartureListParams import org.onebusaway.models.ArrivalAndDepartureListResponse import org.onebusaway.models.ArrivalAndDepartureRetrieveParams @@ -46,8 +46,7 @@ internal constructor(private val clientOptions: ClientOptions) : ArrivalAndDepar class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ArrivalAndDepartureServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/BlockServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/BlockServiceAsyncImpl.kt index 558a8314..72731731 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/BlockServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/BlockServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.BlockRetrieveParams import org.onebusaway.models.BlockRetrieveResponse @@ -36,8 +36,7 @@ class BlockServiceAsyncImpl internal constructor(private val clientOptions: Clie class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : BlockServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ConfigServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ConfigServiceAsyncImpl.kt index 7007d979..6ea8298d 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ConfigServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ConfigServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ConfigRetrieveParams import org.onebusaway.models.ConfigRetrieveResponse @@ -36,8 +36,7 @@ class ConfigServiceAsyncImpl internal constructor(private val clientOptions: Cli class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ConfigServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/CurrentTimeServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/CurrentTimeServiceAsyncImpl.kt index d66d2be8..9b4a27ca 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/CurrentTimeServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/CurrentTimeServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.CurrentTimeRetrieveParams import org.onebusaway.models.CurrentTimeRetrieveResponse @@ -36,8 +36,7 @@ class CurrentTimeServiceAsyncImpl internal constructor(private val clientOptions class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : CurrentTimeServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithStopServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithStopServiceAsyncImpl.kt index c5136257..25f686f6 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithStopServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithStopServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ReportProblemWithStopRetrieveParams import org.onebusaway.models.ResponseWrapper @@ -37,8 +37,7 @@ internal constructor(private val clientOptions: ClientOptions) : ReportProblemWi class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ReportProblemWithStopServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithTripServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithTripServiceAsyncImpl.kt index 92579c3d..2b84b153 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithTripServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ReportProblemWithTripServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ReportProblemWithTripRetrieveParams import org.onebusaway.models.ResponseWrapper @@ -37,8 +37,7 @@ internal constructor(private val clientOptions: ClientOptions) : ReportProblemWi class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ReportProblemWithTripServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteIdsForAgencyServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteIdsForAgencyServiceAsyncImpl.kt index 9c392af7..9c5e6245 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteIdsForAgencyServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteIdsForAgencyServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RouteIdsForAgencyListParams import org.onebusaway.models.RouteIdsForAgencyListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : RouteIdsForAgen class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RouteIdsForAgencyServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteServiceAsyncImpl.kt index ff3995d9..0a9a1741 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RouteServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RouteRetrieveParams import org.onebusaway.models.RouteRetrieveResponse @@ -36,8 +36,7 @@ class RouteServiceAsyncImpl internal constructor(private val clientOptions: Clie class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RouteServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForAgencyServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForAgencyServiceAsyncImpl.kt index d74cb10a..972d1ee1 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForAgencyServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForAgencyServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RoutesForAgencyListParams import org.onebusaway.models.RoutesForAgencyListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : RoutesForAgency class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RoutesForAgencyServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncImpl.kt index 9db3d9bc..c6c6b201 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/RoutesForLocationServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RoutesForLocationListParams import org.onebusaway.models.RoutesForLocationListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : RoutesForLocati class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RoutesForLocationServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForRouteServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForRouteServiceAsyncImpl.kt index fd1a499f..c1a22d5a 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForRouteServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForRouteServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ScheduleForRouteRetrieveParams import org.onebusaway.models.ScheduleForRouteRetrieveResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : ScheduleForRout class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ScheduleForRouteServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForStopServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForStopServiceAsyncImpl.kt index 3cb50c5f..8475e7b3 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForStopServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ScheduleForStopServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ScheduleForStopRetrieveParams import org.onebusaway.models.ScheduleForStopRetrieveResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : ScheduleForStop class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ScheduleForStopServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForRouteServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForRouteServiceAsyncImpl.kt index 10d25c28..33e30440 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForRouteServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForRouteServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.SearchForRouteListParams import org.onebusaway.models.SearchForRouteListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : SearchForRouteS class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : SearchForRouteServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForStopServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForStopServiceAsyncImpl.kt index dd8f8b9c..6baca8a9 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForStopServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/SearchForStopServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.SearchForStopListParams import org.onebusaway.models.SearchForStopListResponse @@ -36,8 +36,7 @@ class SearchForStopServiceAsyncImpl internal constructor(private val clientOptio class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : SearchForStopServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ShapeServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ShapeServiceAsyncImpl.kt index 6a95458b..6315b8c1 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ShapeServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/ShapeServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ShapeRetrieveParams import org.onebusaway.models.ShapeRetrieveResponse @@ -36,8 +36,7 @@ class ShapeServiceAsyncImpl internal constructor(private val clientOptions: Clie class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ShapeServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopIdsForAgencyServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopIdsForAgencyServiceAsyncImpl.kt index 9542c7a5..5ba4d285 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopIdsForAgencyServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopIdsForAgencyServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopIdsForAgencyListParams import org.onebusaway.models.StopIdsForAgencyListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : StopIdsForAgenc class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopIdsForAgencyServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopServiceAsyncImpl.kt index 2af04efa..64c4aaaa 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopRetrieveParams import org.onebusaway.models.StopRetrieveResponse @@ -36,8 +36,7 @@ class StopServiceAsyncImpl internal constructor(private val clientOptions: Clien class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForAgencyServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForAgencyServiceAsyncImpl.kt index 534f4067..42ef9ba9 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForAgencyServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForAgencyServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopsForAgencyListParams import org.onebusaway.models.StopsForAgencyListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : StopsForAgencyS class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopsForAgencyServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncImpl.kt index 4edd9bdb..9e63c7fa 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForLocationServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopsForLocationListParams import org.onebusaway.models.StopsForLocationListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : StopsForLocatio class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopsForLocationServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForRouteServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForRouteServiceAsyncImpl.kt index dadda3f1..f3df8997 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForRouteServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/StopsForRouteServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopsForRouteListParams import org.onebusaway.models.StopsForRouteListResponse @@ -36,8 +36,7 @@ class StopsForRouteServiceAsyncImpl internal constructor(private val clientOptio class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopsForRouteServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripDetailServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripDetailServiceAsyncImpl.kt index 32ea5d62..68b5525e 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripDetailServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripDetailServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripDetailRetrieveParams import org.onebusaway.models.TripDetailRetrieveResponse @@ -36,8 +36,7 @@ class TripDetailServiceAsyncImpl internal constructor(private val clientOptions: class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripDetailServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripForVehicleServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripForVehicleServiceAsyncImpl.kt index 21010ec2..5286fcea 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripForVehicleServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripForVehicleServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripForVehicleRetrieveParams import org.onebusaway.models.TripForVehicleRetrieveResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : TripForVehicleS class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripForVehicleServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripServiceAsyncImpl.kt index bd59f206..3c7105c3 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripRetrieveParams import org.onebusaway.models.TripRetrieveResponse @@ -36,8 +36,7 @@ class TripServiceAsyncImpl internal constructor(private val clientOptions: Clien class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncImpl.kt index cc98a673..0e487171 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForLocationServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripsForLocationListParams import org.onebusaway.models.TripsForLocationListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : TripsForLocatio class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripsForLocationServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForRouteServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForRouteServiceAsyncImpl.kt index 26534225..0515ab57 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForRouteServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/TripsForRouteServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripsForRouteListParams import org.onebusaway.models.TripsForRouteListResponse @@ -36,8 +36,7 @@ class TripsForRouteServiceAsyncImpl internal constructor(private val clientOptio class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripsForRouteServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/VehiclesForAgencyServiceAsyncImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/VehiclesForAgencyServiceAsyncImpl.kt index bc2bd781..1ee28910 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/VehiclesForAgencyServiceAsyncImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/async/VehiclesForAgencyServiceAsyncImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.async import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepareAsync -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.VehiclesForAgencyListParams import org.onebusaway.models.VehiclesForAgencyListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : VehiclesForAgen class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : VehiclesForAgencyServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgenciesWithCoverageServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgenciesWithCoverageServiceImpl.kt index 6fcbf263..9d88aaaa 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgenciesWithCoverageServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgenciesWithCoverageServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.AgenciesWithCoverageListParams import org.onebusaway.models.AgenciesWithCoverageListResponse @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : AgenciesWithCov class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : AgenciesWithCoverageService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgencyServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgencyServiceImpl.kt index b5e25ce4..5dd76deb 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgencyServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/AgencyServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.AgencyRetrieveParams import org.onebusaway.models.AgencyRetrieveResponse @@ -36,8 +36,7 @@ class AgencyServiceImpl internal constructor(private val clientOptions: ClientOp class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : AgencyService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ArrivalAndDepartureServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ArrivalAndDepartureServiceImpl.kt index eba4a940..aa0b5d0a 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ArrivalAndDepartureServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ArrivalAndDepartureServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ArrivalAndDepartureListParams import org.onebusaway.models.ArrivalAndDepartureListResponse import org.onebusaway.models.ArrivalAndDepartureRetrieveParams @@ -45,8 +45,7 @@ internal constructor(private val clientOptions: ClientOptions) : ArrivalAndDepar class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ArrivalAndDepartureService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/BlockServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/BlockServiceImpl.kt index e88c1255..e25fff12 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/BlockServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/BlockServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.BlockRetrieveParams import org.onebusaway.models.BlockRetrieveResponse @@ -36,8 +36,7 @@ class BlockServiceImpl internal constructor(private val clientOptions: ClientOpt class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : BlockService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ConfigServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ConfigServiceImpl.kt index 6798f94c..0a9d873a 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ConfigServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ConfigServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ConfigRetrieveParams import org.onebusaway.models.ConfigRetrieveResponse @@ -36,8 +36,7 @@ class ConfigServiceImpl internal constructor(private val clientOptions: ClientOp class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ConfigService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/CurrentTimeServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/CurrentTimeServiceImpl.kt index a96cf6b2..13e3e8cd 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/CurrentTimeServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/CurrentTimeServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.CurrentTimeRetrieveParams import org.onebusaway.models.CurrentTimeRetrieveResponse @@ -36,8 +36,7 @@ class CurrentTimeServiceImpl internal constructor(private val clientOptions: Cli class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : CurrentTimeService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithStopServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithStopServiceImpl.kt index a11d1949..7a4f14b9 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithStopServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithStopServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ReportProblemWithStopRetrieveParams import org.onebusaway.models.ResponseWrapper @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : ReportProblemWi class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ReportProblemWithStopService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithTripServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithTripServiceImpl.kt index e5472464..b6e09766 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithTripServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ReportProblemWithTripServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ReportProblemWithTripRetrieveParams import org.onebusaway.models.ResponseWrapper @@ -36,8 +36,7 @@ internal constructor(private val clientOptions: ClientOptions) : ReportProblemWi class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ReportProblemWithTripService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteIdsForAgencyServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteIdsForAgencyServiceImpl.kt index ceab0fbe..09c6762f 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteIdsForAgencyServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteIdsForAgencyServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RouteIdsForAgencyListParams import org.onebusaway.models.RouteIdsForAgencyListResponse @@ -36,8 +36,7 @@ class RouteIdsForAgencyServiceImpl internal constructor(private val clientOption class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RouteIdsForAgencyService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteServiceImpl.kt index 9cc19a0b..91586861 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RouteServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RouteRetrieveParams import org.onebusaway.models.RouteRetrieveResponse @@ -36,8 +36,7 @@ class RouteServiceImpl internal constructor(private val clientOptions: ClientOpt class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RouteService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForAgencyServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForAgencyServiceImpl.kt index 5513cfe1..9f311e4f 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForAgencyServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForAgencyServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RoutesForAgencyListParams import org.onebusaway.models.RoutesForAgencyListResponse @@ -36,8 +36,7 @@ class RoutesForAgencyServiceImpl internal constructor(private val clientOptions: class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RoutesForAgencyService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceImpl.kt index b618afc1..c0dbbb63 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/RoutesForLocationServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.RoutesForLocationListParams import org.onebusaway.models.RoutesForLocationListResponse @@ -36,8 +36,7 @@ class RoutesForLocationServiceImpl internal constructor(private val clientOption class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : RoutesForLocationService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForRouteServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForRouteServiceImpl.kt index c69fbaad..4b1c3ca8 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForRouteServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForRouteServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ScheduleForRouteRetrieveParams import org.onebusaway.models.ScheduleForRouteRetrieveResponse @@ -36,8 +36,7 @@ class ScheduleForRouteServiceImpl internal constructor(private val clientOptions class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ScheduleForRouteService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForStopServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForStopServiceImpl.kt index a864820c..0604ebba 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForStopServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ScheduleForStopServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ScheduleForStopRetrieveParams import org.onebusaway.models.ScheduleForStopRetrieveResponse @@ -36,8 +36,7 @@ class ScheduleForStopServiceImpl internal constructor(private val clientOptions: class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ScheduleForStopService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForRouteServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForRouteServiceImpl.kt index 3b24b474..cf53febb 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForRouteServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForRouteServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.SearchForRouteListParams import org.onebusaway.models.SearchForRouteListResponse @@ -36,8 +36,7 @@ class SearchForRouteServiceImpl internal constructor(private val clientOptions: class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : SearchForRouteService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForStopServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForStopServiceImpl.kt index 2239ce26..9009528f 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForStopServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/SearchForStopServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.SearchForStopListParams import org.onebusaway.models.SearchForStopListResponse @@ -36,8 +36,7 @@ class SearchForStopServiceImpl internal constructor(private val clientOptions: C class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : SearchForStopService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ShapeServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ShapeServiceImpl.kt index 3e0ec238..03182cef 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ShapeServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/ShapeServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.ShapeRetrieveParams import org.onebusaway.models.ShapeRetrieveResponse @@ -36,8 +36,7 @@ class ShapeServiceImpl internal constructor(private val clientOptions: ClientOpt class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ShapeService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopIdsForAgencyServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopIdsForAgencyServiceImpl.kt index ec1cc935..983d2269 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopIdsForAgencyServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopIdsForAgencyServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopIdsForAgencyListParams import org.onebusaway.models.StopIdsForAgencyListResponse @@ -36,8 +36,7 @@ class StopIdsForAgencyServiceImpl internal constructor(private val clientOptions class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopIdsForAgencyService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopServiceImpl.kt index f0205124..97907245 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopRetrieveParams import org.onebusaway.models.StopRetrieveResponse @@ -35,8 +35,7 @@ class StopServiceImpl internal constructor(private val clientOptions: ClientOpti class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForAgencyServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForAgencyServiceImpl.kt index bc21d840..35de6ab5 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForAgencyServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForAgencyServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopsForAgencyListParams import org.onebusaway.models.StopsForAgencyListResponse @@ -36,8 +36,7 @@ class StopsForAgencyServiceImpl internal constructor(private val clientOptions: class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopsForAgencyService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceImpl.kt index dc160a17..db532248 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForLocationServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopsForLocationListParams import org.onebusaway.models.StopsForLocationListResponse @@ -36,8 +36,7 @@ class StopsForLocationServiceImpl internal constructor(private val clientOptions class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopsForLocationService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForRouteServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForRouteServiceImpl.kt index ce924674..c6af9e70 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForRouteServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/StopsForRouteServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.StopsForRouteListParams import org.onebusaway.models.StopsForRouteListResponse @@ -36,8 +36,7 @@ class StopsForRouteServiceImpl internal constructor(private val clientOptions: C class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : StopsForRouteService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripDetailServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripDetailServiceImpl.kt index 86e85e12..ebdcd170 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripDetailServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripDetailServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripDetailRetrieveParams import org.onebusaway.models.TripDetailRetrieveResponse @@ -36,8 +36,7 @@ class TripDetailServiceImpl internal constructor(private val clientOptions: Clie class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripDetailService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripForVehicleServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripForVehicleServiceImpl.kt index 005d2009..b4abb27d 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripForVehicleServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripForVehicleServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripForVehicleRetrieveParams import org.onebusaway.models.TripForVehicleRetrieveResponse @@ -36,8 +36,7 @@ class TripForVehicleServiceImpl internal constructor(private val clientOptions: class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripForVehicleService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripServiceImpl.kt index 6265cc81..a185708b 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripRetrieveParams import org.onebusaway.models.TripRetrieveResponse @@ -35,8 +35,7 @@ class TripServiceImpl internal constructor(private val clientOptions: ClientOpti class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val retrieveHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceImpl.kt index 7fbd8e9d..07a0b931 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForLocationServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripsForLocationListParams import org.onebusaway.models.TripsForLocationListResponse @@ -36,8 +36,7 @@ class TripsForLocationServiceImpl internal constructor(private val clientOptions class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripsForLocationService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForRouteServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForRouteServiceImpl.kt index 9963cd5e..1af3af46 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForRouteServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/TripsForRouteServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.TripsForRouteListParams import org.onebusaway.models.TripsForRouteListResponse @@ -36,8 +36,7 @@ class TripsForRouteServiceImpl internal constructor(private val clientOptions: C class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : TripsForRouteService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/VehiclesForAgencyServiceImpl.kt b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/VehiclesForAgencyServiceImpl.kt index fc4d15df..0aebb08f 100644 --- a/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/VehiclesForAgencyServiceImpl.kt +++ b/onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/services/blocking/VehiclesForAgencyServiceImpl.kt @@ -3,6 +3,7 @@ package org.onebusaway.services.blocking import org.onebusaway.core.ClientOptions +import org.onebusaway.core.JsonValue import org.onebusaway.core.RequestOptions import org.onebusaway.core.handlers.errorHandler import org.onebusaway.core.handlers.jsonHandler @@ -13,7 +14,6 @@ import org.onebusaway.core.http.HttpResponse.Handler import org.onebusaway.core.http.HttpResponseFor import org.onebusaway.core.http.parseable import org.onebusaway.core.prepare -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.models.VehiclesForAgencyListParams import org.onebusaway.models.VehiclesForAgencyListResponse @@ -36,8 +36,7 @@ class VehiclesForAgencyServiceImpl internal constructor(private val clientOption class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : VehiclesForAgencyService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(clientOptions.jsonMapper) + private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/onebusaway-sdk-kotlin-core/src/test/kotlin/org/onebusaway/services/ErrorHandlingTest.kt b/onebusaway-sdk-kotlin-core/src/test/kotlin/org/onebusaway/services/ErrorHandlingTest.kt index 7ad7f854..eda1c85f 100644 --- a/onebusaway-sdk-kotlin-core/src/test/kotlin/org/onebusaway/services/ErrorHandlingTest.kt +++ b/onebusaway-sdk-kotlin-core/src/test/kotlin/org/onebusaway/services/ErrorHandlingTest.kt @@ -21,7 +21,6 @@ import org.onebusaway.core.jsonMapper import org.onebusaway.errors.BadRequestException import org.onebusaway.errors.InternalServerException import org.onebusaway.errors.NotFoundException -import org.onebusaway.errors.OnebusawaySdkError import org.onebusaway.errors.OnebusawaySdkException import org.onebusaway.errors.PermissionDeniedException import org.onebusaway.errors.RateLimitException @@ -34,12 +33,9 @@ internal class ErrorHandlingTest { companion object { - private val ERROR: OnebusawaySdkError = - OnebusawaySdkError.builder() - .putAdditionalProperty("errorProperty", JsonValue.from("42")) - .build() + private val ERROR_JSON: JsonValue = JsonValue.from(mapOf("errorProperty" to "42")) - private val ERROR_JSON: ByteArray = jsonMapper().writeValueAsBytes(ERROR) + private val ERROR_JSON_BYTES: ByteArray = jsonMapper().writeValueAsBytes(ERROR_JSON) private const val HEADER_NAME: String = "Error-Header" @@ -64,14 +60,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(400).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(400).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(400) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test @@ -79,14 +77,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(401).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(401).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(401) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test @@ -94,14 +94,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(403).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(403).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(403) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test @@ -109,14 +111,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(404).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(404).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(404) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test @@ -124,14 +128,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(422).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(422).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(422) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test @@ -139,14 +145,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(429).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(429).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(429) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test @@ -154,14 +162,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(500).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(500).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(500) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test @@ -169,14 +179,16 @@ internal class ErrorHandlingTest { val currentTimeService = client.currentTime() stubFor( get(anyUrl()) - .willReturn(status(999).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON)) + .willReturn( + status(999).withHeader(HEADER_NAME, HEADER_VALUE).withBody(ERROR_JSON_BYTES) + ) ) val e = assertThrows { currentTimeService.retrieve() } assertThat(e.statusCode()).isEqualTo(999) - assertThat(e.error()).isEqualTo(ERROR) assertThat(e.headers().toMap()).contains(entry(HEADER_NAME, listOf(HEADER_VALUE))) + assertThat(e.body()).isEqualTo(ERROR_JSON) } @Test