com.lithic.api.models.V2ReportResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lithic-java-core Show documentation
Show all versions of lithic-java-core Show documentation
The Lithic Developer API is designed to provide a predictable programmatic
interface for accessing your Lithic account through an API and transaction
webhooks. Note that your API key is a secret and should be treated as such.
Don't share it with anyone, including us. We will never ask you for it.
The newest version!
// File generated from our OpenAPI spec by Stainless.
package com.lithic.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.lithic.api.core.ExcludeMissing
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonMissing
import com.lithic.api.core.JsonValue
import com.lithic.api.core.NoAutoDetect
import com.lithic.api.core.toImmutable
import java.util.Objects
import java.util.Optional
@JsonDeserialize(builder = V2ReportResponse.Builder::class)
@NoAutoDetect
class V2ReportResponse
private constructor(
private val reportToken: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
fun reportToken(): Optional =
Optional.ofNullable(reportToken.getNullable("report_token"))
@JsonProperty("report_token") @ExcludeMissing fun _reportToken() = reportToken
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): V2ReportResponse = apply {
if (!validated) {
reportToken()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var reportToken: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(v2ReportResponse: V2ReportResponse) = apply {
this.reportToken = v2ReportResponse.reportToken
additionalProperties(v2ReportResponse.additionalProperties)
}
fun reportToken(reportToken: String) = reportToken(JsonField.of(reportToken))
@JsonProperty("report_token")
@ExcludeMissing
fun reportToken(reportToken: JsonField) = apply { this.reportToken = reportToken }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): V2ReportResponse =
V2ReportResponse(reportToken, additionalProperties.toImmutable())
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is V2ReportResponse && this.reportToken == other.reportToken && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(reportToken, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"V2ReportResponse{reportToken=$reportToken, additionalProperties=$additionalProperties}"
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy