@@ -184,7 +184,15 @@ private constructor(
184184 fun spendLimit (): Long = spendLimit.getRequired(" spend_limit" )
185185
186186 /* *
187- * Spend limit duration
187+ * Spend limit duration values:
188+ * - `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year.
189+ * - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the card.
190+ * - `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month. To
191+ * support recurring monthly payments, which can occur on different day every month, the time
192+ * window we consider for monthly velocity starts 6 days after the current calendar date one
193+ * month prior.
194+ * - `TRANSACTION` - Card will authorize multiple transactions if each individual transaction is
195+ * under the spend limit.
188196 *
189197 * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
190198 * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -677,7 +685,18 @@ private constructor(
677685 */
678686 fun spendLimit (spendLimit : JsonField <Long >) = apply { this .spendLimit = spendLimit }
679687
680- /* * Spend limit duration */
688+ /* *
689+ * Spend limit duration values:
690+ * - `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year.
691+ * - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the
692+ * card.
693+ * - `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month.
694+ * To support recurring monthly payments, which can occur on different day every month,
695+ * the time window we consider for monthly velocity starts 6 days after the current
696+ * calendar date one month prior.
697+ * - `TRANSACTION` - Card will authorize multiple transactions if each individual
698+ * transaction is under the spend limit.
699+ */
681700 fun spendLimitDuration (spendLimitDuration : SpendLimitDuration ) =
682701 spendLimitDuration(JsonField .of(spendLimitDuration))
683702
@@ -1867,155 +1886,6 @@ private constructor(
18671886 override fun toString () = value.toString()
18681887 }
18691888
1870- /* * Spend limit duration */
1871- class SpendLimitDuration
1872- @JsonCreator
1873- private constructor (private val value: JsonField <String >) : Enum {
1874-
1875- /* *
1876- * Returns this class instance's raw value.
1877- *
1878- * This is usually only useful if this instance was deserialized from data that doesn't
1879- * match any known member, and you want to know that value. For example, if the SDK is on an
1880- * older version than the API, then the API may respond with new members that the SDK is
1881- * unaware of.
1882- */
1883- @com.fasterxml.jackson.annotation.JsonValue fun _value (): JsonField <String > = value
1884-
1885- companion object {
1886-
1887- @JvmField val ANNUALLY = of(" ANNUALLY" )
1888-
1889- @JvmField val FOREVER = of(" FOREVER" )
1890-
1891- @JvmField val MONTHLY = of(" MONTHLY" )
1892-
1893- @JvmField val TRANSACTION = of(" TRANSACTION" )
1894-
1895- @JvmField val DAILY = of(" DAILY" )
1896-
1897- @JvmStatic fun of (value : String ) = SpendLimitDuration (JsonField .of(value))
1898- }
1899-
1900- /* * An enum containing [SpendLimitDuration]'s known values. */
1901- enum class Known {
1902- ANNUALLY ,
1903- FOREVER ,
1904- MONTHLY ,
1905- TRANSACTION ,
1906- DAILY ,
1907- }
1908-
1909- /* *
1910- * An enum containing [SpendLimitDuration]'s known values, as well as an [_UNKNOWN] member.
1911- *
1912- * An instance of [SpendLimitDuration] can contain an unknown value in a couple of cases:
1913- * - It was deserialized from data that doesn't match any known member. For example, if the
1914- * SDK is on an older version than the API, then the API may respond with new members that
1915- * the SDK is unaware of.
1916- * - It was constructed with an arbitrary value using the [of] method.
1917- */
1918- enum class Value {
1919- ANNUALLY ,
1920- FOREVER ,
1921- MONTHLY ,
1922- TRANSACTION ,
1923- DAILY ,
1924- /* *
1925- * An enum member indicating that [SpendLimitDuration] was instantiated with an unknown
1926- * value.
1927- */
1928- _UNKNOWN ,
1929- }
1930-
1931- /* *
1932- * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
1933- * if the class was instantiated with an unknown value.
1934- *
1935- * Use the [known] method instead if you're certain the value is always known or if you want
1936- * to throw for the unknown case.
1937- */
1938- fun value (): Value =
1939- when (this ) {
1940- ANNUALLY -> Value .ANNUALLY
1941- FOREVER -> Value .FOREVER
1942- MONTHLY -> Value .MONTHLY
1943- TRANSACTION -> Value .TRANSACTION
1944- DAILY -> Value .DAILY
1945- else -> Value ._UNKNOWN
1946- }
1947-
1948- /* *
1949- * Returns an enum member corresponding to this class instance's value.
1950- *
1951- * Use the [value] method instead if you're uncertain the value is always known and don't
1952- * want to throw for the unknown case.
1953- *
1954- * @throws LithicInvalidDataException if this class instance's value is a not a known
1955- * member.
1956- */
1957- fun known (): Known =
1958- when (this ) {
1959- ANNUALLY -> Known .ANNUALLY
1960- FOREVER -> Known .FOREVER
1961- MONTHLY -> Known .MONTHLY
1962- TRANSACTION -> Known .TRANSACTION
1963- DAILY -> Known .DAILY
1964- else -> throw LithicInvalidDataException (" Unknown SpendLimitDuration: $value " )
1965- }
1966-
1967- /* *
1968- * Returns this class instance's primitive wire representation.
1969- *
1970- * This differs from the [toString] method because that method is primarily for debugging
1971- * and generally doesn't throw.
1972- *
1973- * @throws LithicInvalidDataException if this class instance's value does not have the
1974- * expected primitive type.
1975- */
1976- fun asString (): String =
1977- _value ().asString().orElseThrow { LithicInvalidDataException (" Value is not a String" ) }
1978-
1979- private var validated: Boolean = false
1980-
1981- fun validate (): SpendLimitDuration = apply {
1982- if (validated) {
1983- return @apply
1984- }
1985-
1986- known()
1987- validated = true
1988- }
1989-
1990- fun isValid (): Boolean =
1991- try {
1992- validate()
1993- true
1994- } catch (e: LithicInvalidDataException ) {
1995- false
1996- }
1997-
1998- /* *
1999- * Returns a score indicating how many valid values are contained in this object
2000- * recursively.
2001- *
2002- * Used for best match union deserialization.
2003- */
2004- @JvmSynthetic internal fun validity (): Int = if (value() == Value ._UNKNOWN ) 0 else 1
2005-
2006- override fun equals (other : Any? ): Boolean {
2007- if (this == = other) {
2008- return true
2009- }
2010-
2011- return /* spotless:off */ other is SpendLimitDuration && value == other.value /* spotless:on */
2012- }
2013-
2014- override fun hashCode () = value.hashCode()
2015-
2016- override fun toString () = value.toString()
2017- }
2018-
20191889 /* *
20201890 * Card state values: _ `CLOSED` - Card will no longer approve authorizations. Closing a card
20211891 * cannot be undone. _ `OPEN` - Card will approve authorizations (if they match card and account
0 commit comments