com.increase.api.models.DigitalCardProfileCloneParams.kt Maven / Gradle / Ivy
The newest version!
// File generated from our OpenAPI spec by Stainless.
package com.increase.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.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonValue
import com.increase.api.core.NoAutoDetect
import com.increase.api.core.toUnmodifiable
import com.increase.api.models.*
import java.util.Objects
class DigitalCardProfileCloneParams
constructor(
private val digitalCardProfileId: String,
private val appIconFileId: String?,
private val backgroundImageFileId: String?,
private val cardDescription: String?,
private val contactEmail: String?,
private val contactPhone: String?,
private val contactWebsite: String?,
private val description: String?,
private val issuerName: String?,
private val textColor: TextColor?,
private val additionalQueryParams: Map>,
private val additionalHeaders: Map>,
private val additionalBodyProperties: Map,
) {
fun digitalCardProfileId(): String = digitalCardProfileId
fun appIconFileId(): String? = appIconFileId
fun backgroundImageFileId(): String? = backgroundImageFileId
fun cardDescription(): String? = cardDescription
fun contactEmail(): String? = contactEmail
fun contactPhone(): String? = contactPhone
fun contactWebsite(): String? = contactWebsite
fun description(): String? = description
fun issuerName(): String? = issuerName
fun textColor(): TextColor? = textColor
internal fun getBody(): DigitalCardProfileCloneBody {
return DigitalCardProfileCloneBody(
appIconFileId,
backgroundImageFileId,
cardDescription,
contactEmail,
contactPhone,
contactWebsite,
description,
issuerName,
textColor,
additionalBodyProperties,
)
}
internal fun getQueryParams(): Map> = additionalQueryParams
internal fun getHeaders(): Map> = additionalHeaders
fun getPathParam(index: Int): String {
return when (index) {
0 -> digitalCardProfileId
else -> ""
}
}
@JsonDeserialize(builder = DigitalCardProfileCloneBody.Builder::class)
@NoAutoDetect
class DigitalCardProfileCloneBody
internal constructor(
private val appIconFileId: String?,
private val backgroundImageFileId: String?,
private val cardDescription: String?,
private val contactEmail: String?,
private val contactPhone: String?,
private val contactWebsite: String?,
private val description: String?,
private val issuerName: String?,
private val textColor: TextColor?,
private val additionalProperties: Map,
) {
private var hashCode: Int = 0
/** The identifier of the File containing the card's icon image. */
@JsonProperty("app_icon_file_id") fun appIconFileId(): String? = appIconFileId
/** The identifier of the File containing the card's front image. */
@JsonProperty("background_image_file_id")
fun backgroundImageFileId(): String? = backgroundImageFileId
/** A user-facing description for the card itself. */
@JsonProperty("card_description") fun cardDescription(): String? = cardDescription
/** An email address the user can contact to receive support for their card. */
@JsonProperty("contact_email") fun contactEmail(): String? = contactEmail
/** A phone number the user can contact to receive support for their card. */
@JsonProperty("contact_phone") fun contactPhone(): String? = contactPhone
/** A website the user can visit to view and receive support for their card. */
@JsonProperty("contact_website") fun contactWebsite(): String? = contactWebsite
/** A description you can use to identify the Card Profile. */
@JsonProperty("description") fun description(): String? = description
/** A user-facing description for whoever is issuing the card. */
@JsonProperty("issuer_name") fun issuerName(): String? = issuerName
/** The Card's text color, specified as an RGB triple. The default is white. */
@JsonProperty("text_color") fun textColor(): TextColor? = textColor
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is DigitalCardProfileCloneBody &&
this.appIconFileId == other.appIconFileId &&
this.backgroundImageFileId == other.backgroundImageFileId &&
this.cardDescription == other.cardDescription &&
this.contactEmail == other.contactEmail &&
this.contactPhone == other.contactPhone &&
this.contactWebsite == other.contactWebsite &&
this.description == other.description &&
this.issuerName == other.issuerName &&
this.textColor == other.textColor &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
appIconFileId,
backgroundImageFileId,
cardDescription,
contactEmail,
contactPhone,
contactWebsite,
description,
issuerName,
textColor,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"DigitalCardProfileCloneBody{appIconFileId=$appIconFileId, backgroundImageFileId=$backgroundImageFileId, cardDescription=$cardDescription, contactEmail=$contactEmail, contactPhone=$contactPhone, contactWebsite=$contactWebsite, description=$description, issuerName=$issuerName, textColor=$textColor, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var appIconFileId: String? = null
private var backgroundImageFileId: String? = null
private var cardDescription: String? = null
private var contactEmail: String? = null
private var contactPhone: String? = null
private var contactWebsite: String? = null
private var description: String? = null
private var issuerName: String? = null
private var textColor: TextColor? = null
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(digitalCardProfileCloneBody: DigitalCardProfileCloneBody) = apply {
this.appIconFileId = digitalCardProfileCloneBody.appIconFileId
this.backgroundImageFileId = digitalCardProfileCloneBody.backgroundImageFileId
this.cardDescription = digitalCardProfileCloneBody.cardDescription
this.contactEmail = digitalCardProfileCloneBody.contactEmail
this.contactPhone = digitalCardProfileCloneBody.contactPhone
this.contactWebsite = digitalCardProfileCloneBody.contactWebsite
this.description = digitalCardProfileCloneBody.description
this.issuerName = digitalCardProfileCloneBody.issuerName
this.textColor = digitalCardProfileCloneBody.textColor
additionalProperties(digitalCardProfileCloneBody.additionalProperties)
}
/** The identifier of the File containing the card's icon image. */
@JsonProperty("app_icon_file_id")
fun appIconFileId(appIconFileId: String) = apply { this.appIconFileId = appIconFileId }
/** The identifier of the File containing the card's front image. */
@JsonProperty("background_image_file_id")
fun backgroundImageFileId(backgroundImageFileId: String) = apply {
this.backgroundImageFileId = backgroundImageFileId
}
/** A user-facing description for the card itself. */
@JsonProperty("card_description")
fun cardDescription(cardDescription: String) = apply {
this.cardDescription = cardDescription
}
/** An email address the user can contact to receive support for their card. */
@JsonProperty("contact_email")
fun contactEmail(contactEmail: String) = apply { this.contactEmail = contactEmail }
/** A phone number the user can contact to receive support for their card. */
@JsonProperty("contact_phone")
fun contactPhone(contactPhone: String) = apply { this.contactPhone = contactPhone }
/** A website the user can visit to view and receive support for their card. */
@JsonProperty("contact_website")
fun contactWebsite(contactWebsite: String) = apply {
this.contactWebsite = contactWebsite
}
/** A description you can use to identify the Card Profile. */
@JsonProperty("description")
fun description(description: String) = apply { this.description = description }
/** A user-facing description for whoever is issuing the card. */
@JsonProperty("issuer_name")
fun issuerName(issuerName: String) = apply { this.issuerName = issuerName }
/** The Card's text color, specified as an RGB triple. The default is white. */
@JsonProperty("text_color")
fun textColor(textColor: TextColor) = apply { this.textColor = textColor }
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(): DigitalCardProfileCloneBody =
DigitalCardProfileCloneBody(
appIconFileId,
backgroundImageFileId,
cardDescription,
contactEmail,
contactPhone,
contactWebsite,
description,
issuerName,
textColor,
additionalProperties.toUnmodifiable(),
)
}
}
fun _additionalQueryParams(): Map> = additionalQueryParams
fun _additionalHeaders(): Map> = additionalHeaders
fun _additionalBodyProperties(): Map = additionalBodyProperties
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is DigitalCardProfileCloneParams &&
this.digitalCardProfileId == other.digitalCardProfileId &&
this.appIconFileId == other.appIconFileId &&
this.backgroundImageFileId == other.backgroundImageFileId &&
this.cardDescription == other.cardDescription &&
this.contactEmail == other.contactEmail &&
this.contactPhone == other.contactPhone &&
this.contactWebsite == other.contactWebsite &&
this.description == other.description &&
this.issuerName == other.issuerName &&
this.textColor == other.textColor &&
this.additionalQueryParams == other.additionalQueryParams &&
this.additionalHeaders == other.additionalHeaders &&
this.additionalBodyProperties == other.additionalBodyProperties
}
override fun hashCode(): Int {
return Objects.hash(
digitalCardProfileId,
appIconFileId,
backgroundImageFileId,
cardDescription,
contactEmail,
contactPhone,
contactWebsite,
description,
issuerName,
textColor,
additionalQueryParams,
additionalHeaders,
additionalBodyProperties,
)
}
override fun toString() =
"DigitalCardProfileCloneParams{digitalCardProfileId=$digitalCardProfileId, appIconFileId=$appIconFileId, backgroundImageFileId=$backgroundImageFileId, cardDescription=$cardDescription, contactEmail=$contactEmail, contactPhone=$contactPhone, contactWebsite=$contactWebsite, description=$description, issuerName=$issuerName, textColor=$textColor, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
@NoAutoDetect
class Builder {
private var digitalCardProfileId: String? = null
private var appIconFileId: String? = null
private var backgroundImageFileId: String? = null
private var cardDescription: String? = null
private var contactEmail: String? = null
private var contactPhone: String? = null
private var contactWebsite: String? = null
private var description: String? = null
private var issuerName: String? = null
private var textColor: TextColor? = null
private var additionalQueryParams: MutableMap> = mutableMapOf()
private var additionalHeaders: MutableMap> = mutableMapOf()
private var additionalBodyProperties: MutableMap = mutableMapOf()
internal fun from(digitalCardProfileCloneParams: DigitalCardProfileCloneParams) = apply {
this.digitalCardProfileId = digitalCardProfileCloneParams.digitalCardProfileId
this.appIconFileId = digitalCardProfileCloneParams.appIconFileId
this.backgroundImageFileId = digitalCardProfileCloneParams.backgroundImageFileId
this.cardDescription = digitalCardProfileCloneParams.cardDescription
this.contactEmail = digitalCardProfileCloneParams.contactEmail
this.contactPhone = digitalCardProfileCloneParams.contactPhone
this.contactWebsite = digitalCardProfileCloneParams.contactWebsite
this.description = digitalCardProfileCloneParams.description
this.issuerName = digitalCardProfileCloneParams.issuerName
this.textColor = digitalCardProfileCloneParams.textColor
additionalQueryParams(digitalCardProfileCloneParams.additionalQueryParams)
additionalHeaders(digitalCardProfileCloneParams.additionalHeaders)
additionalBodyProperties(digitalCardProfileCloneParams.additionalBodyProperties)
}
/** The identifier of the Digital Card Profile to clone. */
fun digitalCardProfileId(digitalCardProfileId: String) = apply {
this.digitalCardProfileId = digitalCardProfileId
}
/** The identifier of the File containing the card's icon image. */
fun appIconFileId(appIconFileId: String) = apply { this.appIconFileId = appIconFileId }
/** The identifier of the File containing the card's front image. */
fun backgroundImageFileId(backgroundImageFileId: String) = apply {
this.backgroundImageFileId = backgroundImageFileId
}
/** A user-facing description for the card itself. */
fun cardDescription(cardDescription: String) = apply {
this.cardDescription = cardDescription
}
/** An email address the user can contact to receive support for their card. */
fun contactEmail(contactEmail: String) = apply { this.contactEmail = contactEmail }
/** A phone number the user can contact to receive support for their card. */
fun contactPhone(contactPhone: String) = apply { this.contactPhone = contactPhone }
/** A website the user can visit to view and receive support for their card. */
fun contactWebsite(contactWebsite: String) = apply { this.contactWebsite = contactWebsite }
/** A description you can use to identify the Card Profile. */
fun description(description: String) = apply { this.description = description }
/** A user-facing description for whoever is issuing the card. */
fun issuerName(issuerName: String) = apply { this.issuerName = issuerName }
/** The Card's text color, specified as an RGB triple. The default is white. */
fun textColor(textColor: TextColor) = apply { this.textColor = textColor }
fun additionalQueryParams(additionalQueryParams: Map>) = apply {
this.additionalQueryParams.clear()
putAllQueryParams(additionalQueryParams)
}
fun putQueryParam(name: String, value: String) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value)
}
fun putQueryParams(name: String, values: Iterable) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values)
}
fun putAllQueryParams(additionalQueryParams: Map>) = apply {
additionalQueryParams.forEach(this::putQueryParams)
}
fun removeQueryParam(name: String) = apply {
this.additionalQueryParams.put(name, mutableListOf())
}
fun additionalHeaders(additionalHeaders: Map>) = apply {
this.additionalHeaders.clear()
putAllHeaders(additionalHeaders)
}
fun putHeader(name: String, value: String) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value)
}
fun putHeaders(name: String, values: Iterable) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values)
}
fun putAllHeaders(additionalHeaders: Map>) = apply {
additionalHeaders.forEach(this::putHeaders)
}
fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
this.additionalBodyProperties.clear()
this.additionalBodyProperties.putAll(additionalBodyProperties)
}
fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
this.additionalBodyProperties.put(key, value)
}
fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
}
fun build(): DigitalCardProfileCloneParams =
DigitalCardProfileCloneParams(
checkNotNull(digitalCardProfileId) {
"`digitalCardProfileId` is required but was not set"
},
appIconFileId,
backgroundImageFileId,
cardDescription,
contactEmail,
contactPhone,
contactWebsite,
description,
issuerName,
textColor,
additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
additionalBodyProperties.toUnmodifiable(),
)
}
/** The Card's text color, specified as an RGB triple. The default is white. */
@JsonDeserialize(builder = TextColor.Builder::class)
@NoAutoDetect
class TextColor
private constructor(
private val blue: Long?,
private val green: Long?,
private val red: Long?,
private val additionalProperties: Map,
) {
private var hashCode: Int = 0
/** The value of the blue channel in the RGB color. */
@JsonProperty("blue") fun blue(): Long? = blue
/** The value of the green channel in the RGB color. */
@JsonProperty("green") fun green(): Long? = green
/** The value of the red channel in the RGB color. */
@JsonProperty("red") fun red(): Long? = red
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is TextColor &&
this.blue == other.blue &&
this.green == other.green &&
this.red == other.red &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
blue,
green,
red,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"TextColor{blue=$blue, green=$green, red=$red, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var blue: Long? = null
private var green: Long? = null
private var red: Long? = null
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(textColor: TextColor) = apply {
this.blue = textColor.blue
this.green = textColor.green
this.red = textColor.red
additionalProperties(textColor.additionalProperties)
}
/** The value of the blue channel in the RGB color. */
@JsonProperty("blue") fun blue(blue: Long) = apply { this.blue = blue }
/** The value of the green channel in the RGB color. */
@JsonProperty("green") fun green(green: Long) = apply { this.green = green }
/** The value of the red channel in the RGB color. */
@JsonProperty("red") fun red(red: Long) = apply { this.red = red }
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(): TextColor =
TextColor(
checkNotNull(blue) { "`blue` is required but was not set" },
checkNotNull(green) { "`green` is required but was not set" },
checkNotNull(red) { "`red` is required but was not set" },
additionalProperties.toUnmodifiable(),
)
}
}
}