tech.carpentum.sdk.payment.internal.generated.infrastructure.ApiResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of payment-client-v2 Show documentation
Show all versions of payment-client-v2 Show documentation
Carpentum Payment system Java SDK
package tech.carpentum.sdk.payment.internal.generated.infrastructure
enum class ResponseType {
Success, Informational, Redirection, ClientError, ServerError
}
sealed interface Response
abstract class ApiResponse(val responseType: ResponseType): Response {
abstract val statusCode: Int
abstract val headers: Map>
}
data class Success(
val data: T,
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
): ApiResponse(ResponseType.Success)
data class Informational(
val statusText: String,
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.Informational)
data class Redirection(
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.Redirection)
data class ClientError(
val message: String? = null,
val body: Any? = null,
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.ClientError)
data class ServerError(
val message: String? = null,
val body: Any? = null,
override val statusCode: Int = -1,
override val headers: Map>
): ApiResponse(ResponseType.ServerError)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy