Skip to content

Commit 74dcc48

Browse files
fix(api): Update /v2/auth_rules/results endpoint parameter naming and action types
1 parent 6064b3a commit 74dcc48

8 files changed

Lines changed: 107 additions & 79 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 177
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-32c9a538495a2c820a7ca28c4f09cc1226642b8f7c9422ce1889aebd15e225ca.yml
3-
openapi_spec_hash: b6403689900263b73d4054a548f00285
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fe39002b6b38eb33ba43532f28e317bdd4dbb5b0efd46fa098178cb6a544d585.yml
3+
openapi_spec_hash: 8ee7b837e77df089ca3359b5502c7525
44
config_hash: 693dddc4721eef512d75ab6c60897794

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import kotlin.jvm.optionals.getOrNull
1414
*
1515
* **Limitations:**
1616
* - Results are available for the past 3 months only
17-
* - At least one filter (`event_uuid` or `auth_rule_token`) must be provided
18-
* - When filtering by `event_uuid`, pagination is not supported
17+
* - At least one filter (`event_token` or `auth_rule_token`) must be provided
18+
* - When filtering by `event_token`, pagination is not supported
1919
*/
2020
class AuthRuleV2ListResultsParams
2121
private constructor(
2222
private val authRuleToken: String?,
2323
private val endingBefore: String?,
24-
private val eventUuid: String?,
24+
private val eventToken: String?,
2525
private val hasActions: Boolean?,
2626
private val pageSize: Long?,
2727
private val startingAfter: String?,
@@ -38,8 +38,8 @@ private constructor(
3838
*/
3939
fun endingBefore(): Optional<String> = Optional.ofNullable(endingBefore)
4040

41-
/** Filter by event UUID */
42-
fun eventUuid(): Optional<String> = Optional.ofNullable(eventUuid)
41+
/** Filter by event token */
42+
fun eventToken(): Optional<String> = Optional.ofNullable(eventToken)
4343

4444
/**
4545
* Filter by whether the rule evaluation produced any actions. When not provided, all results
@@ -79,7 +79,7 @@ private constructor(
7979

8080
private var authRuleToken: String? = null
8181
private var endingBefore: String? = null
82-
private var eventUuid: String? = null
82+
private var eventToken: String? = null
8383
private var hasActions: Boolean? = null
8484
private var pageSize: Long? = null
8585
private var startingAfter: String? = null
@@ -90,7 +90,7 @@ private constructor(
9090
internal fun from(authRuleV2ListResultsParams: AuthRuleV2ListResultsParams) = apply {
9191
authRuleToken = authRuleV2ListResultsParams.authRuleToken
9292
endingBefore = authRuleV2ListResultsParams.endingBefore
93-
eventUuid = authRuleV2ListResultsParams.eventUuid
93+
eventToken = authRuleV2ListResultsParams.eventToken
9494
hasActions = authRuleV2ListResultsParams.hasActions
9595
pageSize = authRuleV2ListResultsParams.pageSize
9696
startingAfter = authRuleV2ListResultsParams.startingAfter
@@ -114,11 +114,11 @@ private constructor(
114114
/** Alias for calling [Builder.endingBefore] with `endingBefore.orElse(null)`. */
115115
fun endingBefore(endingBefore: Optional<String>) = endingBefore(endingBefore.getOrNull())
116116

117-
/** Filter by event UUID */
118-
fun eventUuid(eventUuid: String?) = apply { this.eventUuid = eventUuid }
117+
/** Filter by event token */
118+
fun eventToken(eventToken: String?) = apply { this.eventToken = eventToken }
119119

120-
/** Alias for calling [Builder.eventUuid] with `eventUuid.orElse(null)`. */
121-
fun eventUuid(eventUuid: Optional<String>) = eventUuid(eventUuid.getOrNull())
120+
/** Alias for calling [Builder.eventToken] with `eventToken.orElse(null)`. */
121+
fun eventToken(eventToken: Optional<String>) = eventToken(eventToken.getOrNull())
122122

123123
/**
124124
* Filter by whether the rule evaluation produced any actions. When not provided, all
@@ -266,7 +266,7 @@ private constructor(
266266
AuthRuleV2ListResultsParams(
267267
authRuleToken,
268268
endingBefore,
269-
eventUuid,
269+
eventToken,
270270
hasActions,
271271
pageSize,
272272
startingAfter,
@@ -282,7 +282,7 @@ private constructor(
282282
.apply {
283283
authRuleToken?.let { put("auth_rule_token", it) }
284284
endingBefore?.let { put("ending_before", it) }
285-
eventUuid?.let { put("event_uuid", it) }
285+
eventToken?.let { put("event_token", it) }
286286
hasActions?.let { put("has_actions", it.toString()) }
287287
pageSize?.let { put("page_size", it.toString()) }
288288
startingAfter?.let { put("starting_after", it) }
@@ -298,7 +298,7 @@ private constructor(
298298
return other is AuthRuleV2ListResultsParams &&
299299
authRuleToken == other.authRuleToken &&
300300
endingBefore == other.endingBefore &&
301-
eventUuid == other.eventUuid &&
301+
eventToken == other.eventToken &&
302302
hasActions == other.hasActions &&
303303
pageSize == other.pageSize &&
304304
startingAfter == other.startingAfter &&
@@ -310,7 +310,7 @@ private constructor(
310310
Objects.hash(
311311
authRuleToken,
312312
endingBefore,
313-
eventUuid,
313+
eventToken,
314314
hasActions,
315315
pageSize,
316316
startingAfter,
@@ -319,5 +319,5 @@ private constructor(
319319
)
320320

321321
override fun toString() =
322-
"AuthRuleV2ListResultsParams{authRuleToken=$authRuleToken, endingBefore=$endingBefore, eventUuid=$eventUuid, hasActions=$hasActions, pageSize=$pageSize, startingAfter=$startingAfter, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
322+
"AuthRuleV2ListResultsParams{authRuleToken=$authRuleToken, endingBefore=$endingBefore, eventToken=$eventToken, hasActions=$hasActions, pageSize=$pageSize, startingAfter=$startingAfter, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
323323
}

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

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ import kotlin.jvm.optionals.getOrNull
2323
class Conditional3dsActionParameters
2424
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2525
private constructor(
26-
private val action: JsonField<ThreeDSAction>,
26+
private val action: JsonField<Authentication3dsAction>,
2727
private val conditions: JsonField<List<Condition>>,
2828
private val additionalProperties: MutableMap<String, JsonValue>,
2929
) {
3030

3131
@JsonCreator
3232
private constructor(
33-
@JsonProperty("action") @ExcludeMissing action: JsonField<ThreeDSAction> = JsonMissing.of(),
33+
@JsonProperty("action")
34+
@ExcludeMissing
35+
action: JsonField<Authentication3dsAction> = JsonMissing.of(),
3436
@JsonProperty("conditions")
3537
@ExcludeMissing
3638
conditions: JsonField<List<Condition>> = JsonMissing.of(),
@@ -42,7 +44,7 @@ private constructor(
4244
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
4345
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
4446
*/
45-
fun action(): ThreeDSAction = action.getRequired("action")
47+
fun action(): Authentication3dsAction = action.getRequired("action")
4648

4749
/**
4850
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
@@ -55,7 +57,9 @@ private constructor(
5557
*
5658
* Unlike [action], this method doesn't throw if the JSON field has an unexpected type.
5759
*/
58-
@JsonProperty("action") @ExcludeMissing fun _action(): JsonField<ThreeDSAction> = action
60+
@JsonProperty("action")
61+
@ExcludeMissing
62+
fun _action(): JsonField<Authentication3dsAction> = action
5963

6064
/**
6165
* Returns the raw JSON value of [conditions].
@@ -96,7 +100,7 @@ private constructor(
96100
/** A builder for [Conditional3dsActionParameters]. */
97101
class Builder internal constructor() {
98102

99-
private var action: JsonField<ThreeDSAction>? = null
103+
private var action: JsonField<Authentication3dsAction>? = null
100104
private var conditions: JsonField<MutableList<Condition>>? = null
101105
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
102106

@@ -109,16 +113,16 @@ private constructor(
109113
}
110114

111115
/** The action to take if the conditions are met. */
112-
fun action(action: ThreeDSAction) = action(JsonField.of(action))
116+
fun action(action: Authentication3dsAction) = action(JsonField.of(action))
113117

114118
/**
115119
* Sets [Builder.action] to an arbitrary JSON value.
116120
*
117-
* You should usually call [Builder.action] with a well-typed [ThreeDSAction] value instead.
118-
* This method is primarily for setting the field to an undocumented or not yet supported
119-
* value.
121+
* You should usually call [Builder.action] with a well-typed [Authentication3dsAction]
122+
* value instead. This method is primarily for setting the field to an undocumented or not
123+
* yet supported value.
120124
*/
121-
fun action(action: JsonField<ThreeDSAction>) = apply { this.action = action }
125+
fun action(action: JsonField<Authentication3dsAction>) = apply { this.action = action }
122126

123127
fun conditions(conditions: List<Condition>) = conditions(JsonField.of(conditions))
124128

@@ -216,8 +220,9 @@ private constructor(
216220
(conditions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
217221

218222
/** The action to take if the conditions are met. */
219-
class ThreeDSAction @JsonCreator private constructor(private val value: JsonField<String>) :
220-
Enum {
223+
class Authentication3dsAction
224+
@JsonCreator
225+
private constructor(private val value: JsonField<String>) : Enum {
221226

222227
/**
223228
* Returns this class instance's raw value.
@@ -235,19 +240,21 @@ private constructor(
235240

236241
@JvmField val CHALLENGE = of("CHALLENGE")
237242

238-
@JvmStatic fun of(value: String) = ThreeDSAction(JsonField.of(value))
243+
@JvmStatic fun of(value: String) = Authentication3dsAction(JsonField.of(value))
239244
}
240245

241-
/** An enum containing [ThreeDSAction]'s known values. */
246+
/** An enum containing [Authentication3dsAction]'s known values. */
242247
enum class Known {
243248
DECLINE,
244249
CHALLENGE,
245250
}
246251

247252
/**
248-
* An enum containing [ThreeDSAction]'s known values, as well as an [_UNKNOWN] member.
253+
* An enum containing [Authentication3dsAction]'s known values, as well as an [_UNKNOWN]
254+
* member.
249255
*
250-
* An instance of [ThreeDSAction] can contain an unknown value in a couple of cases:
256+
* An instance of [Authentication3dsAction] can contain an unknown value in a couple of
257+
* cases:
251258
* - It was deserialized from data that doesn't match any known member. For example, if the
252259
* SDK is on an older version than the API, then the API may respond with new members that
253260
* the SDK is unaware of.
@@ -257,8 +264,8 @@ private constructor(
257264
DECLINE,
258265
CHALLENGE,
259266
/**
260-
* An enum member indicating that [ThreeDSAction] was instantiated with an unknown
261-
* value.
267+
* An enum member indicating that [Authentication3dsAction] was instantiated with an
268+
* unknown value.
262269
*/
263270
_UNKNOWN,
264271
}
@@ -290,7 +297,7 @@ private constructor(
290297
when (this) {
291298
DECLINE -> Known.DECLINE
292299
CHALLENGE -> Known.CHALLENGE
293-
else -> throw LithicInvalidDataException("Unknown ThreeDSAction: $value")
300+
else -> throw LithicInvalidDataException("Unknown Authentication3dsAction: $value")
294301
}
295302

296303
/**
@@ -307,7 +314,7 @@ private constructor(
307314

308315
private var validated: Boolean = false
309316

310-
fun validate(): ThreeDSAction = apply {
317+
fun validate(): Authentication3dsAction = apply {
311318
if (validated) {
312319
return@apply
313320
}
@@ -337,7 +344,7 @@ private constructor(
337344
return true
338345
}
339346

340-
return other is ThreeDSAction && value == other.value
347+
return other is Authentication3dsAction && value == other.value
341348
}
342349

343350
override fun hashCode() = value.hashCode()

0 commit comments

Comments
 (0)