Skip to content

Commit c6cb655

Browse files
feat(api): support event_streams in auth_rules list endpoint
1 parent a8c6766 commit c6cb655

File tree

11 files changed

+167
-925
lines changed

11 files changed

+167
-925
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 176
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml
33
openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f
4-
config_hash: ba3fbfc99a1b8635d9e79e9e49d12952
4+
config_hash: 739714a3fead0b26ee3a3b7bc51081f6

lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt

Lines changed: 0 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,153 +2071,6 @@ private constructor(
20712071
"DraftVersion{parameters=$parameters, version=$version, additionalProperties=$additionalProperties}"
20722072
}
20732073

2074-
/** The event stream during which the rule will be evaluated. */
2075-
class EventStream @JsonCreator private constructor(private val value: JsonField<String>) :
2076-
Enum {
2077-
2078-
/**
2079-
* Returns this class instance's raw value.
2080-
*
2081-
* This is usually only useful if this instance was deserialized from data that doesn't
2082-
* match any known member, and you want to know that value. For example, if the SDK is on an
2083-
* older version than the API, then the API may respond with new members that the SDK is
2084-
* unaware of.
2085-
*/
2086-
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
2087-
2088-
companion object {
2089-
2090-
@JvmField val AUTHORIZATION = of("AUTHORIZATION")
2091-
2092-
@JvmField val THREE_DS_AUTHENTICATION = of("THREE_DS_AUTHENTICATION")
2093-
2094-
@JvmField val TOKENIZATION = of("TOKENIZATION")
2095-
2096-
@JvmField val ACH_CREDIT_RECEIPT = of("ACH_CREDIT_RECEIPT")
2097-
2098-
@JvmField val ACH_DEBIT_RECEIPT = of("ACH_DEBIT_RECEIPT")
2099-
2100-
@JvmStatic fun of(value: String) = EventStream(JsonField.of(value))
2101-
}
2102-
2103-
/** An enum containing [EventStream]'s known values. */
2104-
enum class Known {
2105-
AUTHORIZATION,
2106-
THREE_DS_AUTHENTICATION,
2107-
TOKENIZATION,
2108-
ACH_CREDIT_RECEIPT,
2109-
ACH_DEBIT_RECEIPT,
2110-
}
2111-
2112-
/**
2113-
* An enum containing [EventStream]'s known values, as well as an [_UNKNOWN] member.
2114-
*
2115-
* An instance of [EventStream] can contain an unknown value in a couple of cases:
2116-
* - It was deserialized from data that doesn't match any known member. For example, if the
2117-
* SDK is on an older version than the API, then the API may respond with new members that
2118-
* the SDK is unaware of.
2119-
* - It was constructed with an arbitrary value using the [of] method.
2120-
*/
2121-
enum class Value {
2122-
AUTHORIZATION,
2123-
THREE_DS_AUTHENTICATION,
2124-
TOKENIZATION,
2125-
ACH_CREDIT_RECEIPT,
2126-
ACH_DEBIT_RECEIPT,
2127-
/**
2128-
* An enum member indicating that [EventStream] was instantiated with an unknown value.
2129-
*/
2130-
_UNKNOWN,
2131-
}
2132-
2133-
/**
2134-
* Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
2135-
* if the class was instantiated with an unknown value.
2136-
*
2137-
* Use the [known] method instead if you're certain the value is always known or if you want
2138-
* to throw for the unknown case.
2139-
*/
2140-
fun value(): Value =
2141-
when (this) {
2142-
AUTHORIZATION -> Value.AUTHORIZATION
2143-
THREE_DS_AUTHENTICATION -> Value.THREE_DS_AUTHENTICATION
2144-
TOKENIZATION -> Value.TOKENIZATION
2145-
ACH_CREDIT_RECEIPT -> Value.ACH_CREDIT_RECEIPT
2146-
ACH_DEBIT_RECEIPT -> Value.ACH_DEBIT_RECEIPT
2147-
else -> Value._UNKNOWN
2148-
}
2149-
2150-
/**
2151-
* Returns an enum member corresponding to this class instance's value.
2152-
*
2153-
* Use the [value] method instead if you're uncertain the value is always known and don't
2154-
* want to throw for the unknown case.
2155-
*
2156-
* @throws LithicInvalidDataException if this class instance's value is a not a known
2157-
* member.
2158-
*/
2159-
fun known(): Known =
2160-
when (this) {
2161-
AUTHORIZATION -> Known.AUTHORIZATION
2162-
THREE_DS_AUTHENTICATION -> Known.THREE_DS_AUTHENTICATION
2163-
TOKENIZATION -> Known.TOKENIZATION
2164-
ACH_CREDIT_RECEIPT -> Known.ACH_CREDIT_RECEIPT
2165-
ACH_DEBIT_RECEIPT -> Known.ACH_DEBIT_RECEIPT
2166-
else -> throw LithicInvalidDataException("Unknown EventStream: $value")
2167-
}
2168-
2169-
/**
2170-
* Returns this class instance's primitive wire representation.
2171-
*
2172-
* This differs from the [toString] method because that method is primarily for debugging
2173-
* and generally doesn't throw.
2174-
*
2175-
* @throws LithicInvalidDataException if this class instance's value does not have the
2176-
* expected primitive type.
2177-
*/
2178-
fun asString(): String =
2179-
_value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
2180-
2181-
private var validated: Boolean = false
2182-
2183-
fun validate(): EventStream = apply {
2184-
if (validated) {
2185-
return@apply
2186-
}
2187-
2188-
known()
2189-
validated = true
2190-
}
2191-
2192-
fun isValid(): Boolean =
2193-
try {
2194-
validate()
2195-
true
2196-
} catch (e: LithicInvalidDataException) {
2197-
false
2198-
}
2199-
2200-
/**
2201-
* Returns a score indicating how many valid values are contained in this object
2202-
* recursively.
2203-
*
2204-
* Used for best match union deserialization.
2205-
*/
2206-
@JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
2207-
2208-
override fun equals(other: Any?): Boolean {
2209-
if (this === other) {
2210-
return true
2211-
}
2212-
2213-
return other is EventStream && value == other.value
2214-
}
2215-
2216-
override fun hashCode() = value.hashCode()
2217-
2218-
override fun toString() = value.toString()
2219-
}
2220-
22212074
/** The state of the Auth Rule */
22222075
class AuthRuleState @JsonCreator private constructor(private val value: JsonField<String>) :
22232076
Enum {

0 commit comments

Comments
 (0)