Skip to content

Commit 7545f9b

Browse files
feat(api): add WALLET_RECOMMENDATION_REASONS attribute for tokenization rules
feat(api): provide a unified model for AuthRule fix(api): make certain payoff fields nullable fix(api): fix examples in spec that were not fully valid
1 parent 0e7ada3 commit 7545f9b

65 files changed

Lines changed: 3286 additions & 17921 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 172
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-9791980619fc7ce8afb01f77dfe3c660a540975327378287cb666136ae4b0a99.yml
3-
openapi_spec_hash: 0752074b2a7b0534329a1e3176c94a62
4-
config_hash: aab05d0cf41f1f6b9f4d5677273c1600
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a9de2732e7a28b7fc5b8b7b171781d617337b6223d82ef7d6a554d0bd2b33bab.yml
3+
openapi_spec_hash: fc6111d286c7002cd854af23841d137e
4+
config_hash: f6f5c7f37033e89a3cf91a48371a718a

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,22 @@ CardCreateParams params = CardCreateParams.builder()
546546

547547
These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.
548548

549+
To set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:
550+
551+
```java
552+
import com.lithic.api.core.JsonValue;
553+
import com.lithic.api.models.CardCreateParams;
554+
import com.lithic.api.models.ShippingAddress;
555+
556+
CardCreateParams params = CardCreateParams.builder()
557+
.shippingAddress(ShippingAddress.builder()
558+
.putAdditionalProperty("secretProperty", JsonValue.from("42"))
559+
.build())
560+
.build();
561+
```
562+
563+
These properties can be accessed on the nested built object later using the `_additionalProperties()` method.
564+
549565
To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](lithic-java-core/src/main/kotlin/com/lithic/api/core/Values.kt) object to its setter:
550566

551567
```java

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

Lines changed: 2098 additions & 297 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ private constructor(
1616
private val service: V2Service,
1717
private val params: AuthRuleV2ListParams,
1818
private val response: AuthRuleV2ListPageResponse,
19-
) : Page<V2ListResponse> {
19+
) : Page<AuthRule> {
2020

2121
/**
2222
* Delegates to [AuthRuleV2ListPageResponse], but gracefully handles missing data.
2323
*
2424
* @see AuthRuleV2ListPageResponse.data
2525
*/
26-
fun data(): List<V2ListResponse> =
27-
response._data().getOptional("data").getOrNull() ?: emptyList()
26+
fun data(): List<AuthRule> = response._data().getOptional("data").getOrNull() ?: emptyList()
2827

2928
/**
3029
* Delegates to [AuthRuleV2ListPageResponse], but gracefully handles missing data.
@@ -33,7 +32,7 @@ private constructor(
3332
*/
3433
fun hasMore(): Optional<Boolean> = response._hasMore().getOptional("has_more")
3534

36-
override fun items(): List<V2ListResponse> = data()
35+
override fun items(): List<AuthRule> = data()
3736

3837
override fun hasNextPage(): Boolean = items().isNotEmpty()
3938

@@ -46,7 +45,7 @@ private constructor(
4645

4746
override fun nextPage(): AuthRuleV2ListPage = service.list(nextPageParams())
4847

49-
fun autoPager(): AutoPager<V2ListResponse> = AutoPager.from(this)
48+
fun autoPager(): AutoPager<AuthRule> = AutoPager.from(this)
5049

5150
/** The parameters that were used to request this page. */
5251
fun params(): AuthRuleV2ListParams = params

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ private constructor(
1919
private val streamHandlerExecutor: Executor,
2020
private val params: AuthRuleV2ListParams,
2121
private val response: AuthRuleV2ListPageResponse,
22-
) : PageAsync<V2ListResponse> {
22+
) : PageAsync<AuthRule> {
2323

2424
/**
2525
* Delegates to [AuthRuleV2ListPageResponse], but gracefully handles missing data.
2626
*
2727
* @see AuthRuleV2ListPageResponse.data
2828
*/
29-
fun data(): List<V2ListResponse> =
30-
response._data().getOptional("data").getOrNull() ?: emptyList()
29+
fun data(): List<AuthRule> = response._data().getOptional("data").getOrNull() ?: emptyList()
3130

3231
/**
3332
* Delegates to [AuthRuleV2ListPageResponse], but gracefully handles missing data.
@@ -36,7 +35,7 @@ private constructor(
3635
*/
3736
fun hasMore(): Optional<Boolean> = response._hasMore().getOptional("has_more")
3837

39-
override fun items(): List<V2ListResponse> = data()
38+
override fun items(): List<AuthRule> = data()
4039

4140
override fun hasNextPage(): Boolean = items().isNotEmpty()
4241

@@ -50,8 +49,7 @@ private constructor(
5049
override fun nextPage(): CompletableFuture<AuthRuleV2ListPageAsync> =
5150
service.list(nextPageParams())
5251

53-
fun autoPager(): AutoPagerAsync<V2ListResponse> =
54-
AutoPagerAsync.from(this, streamHandlerExecutor)
52+
fun autoPager(): AutoPagerAsync<AuthRule> = AutoPagerAsync.from(this, streamHandlerExecutor)
5553

5654
/** The parameters that were used to request this page. */
5755
fun params(): AuthRuleV2ListParams = params

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,22 @@ import kotlin.jvm.optionals.getOrNull
2121
class AuthRuleV2ListPageResponse
2222
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2323
private constructor(
24-
private val data: JsonField<List<V2ListResponse>>,
24+
private val data: JsonField<List<AuthRule>>,
2525
private val hasMore: JsonField<Boolean>,
2626
private val additionalProperties: MutableMap<String, JsonValue>,
2727
) {
2828

2929
@JsonCreator
3030
private constructor(
31-
@JsonProperty("data")
32-
@ExcludeMissing
33-
data: JsonField<List<V2ListResponse>> = JsonMissing.of(),
31+
@JsonProperty("data") @ExcludeMissing data: JsonField<List<AuthRule>> = JsonMissing.of(),
3432
@JsonProperty("has_more") @ExcludeMissing hasMore: JsonField<Boolean> = JsonMissing.of(),
3533
) : this(data, hasMore, mutableMapOf())
3634

3735
/**
3836
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
3937
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
4038
*/
41-
fun data(): List<V2ListResponse> = data.getRequired("data")
39+
fun data(): List<AuthRule> = data.getRequired("data")
4240

4341
/**
4442
* Indicates whether there are more Auth Rules to be retrieved by paging through the results.
@@ -53,7 +51,7 @@ private constructor(
5351
*
5452
* Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
5553
*/
56-
@JsonProperty("data") @ExcludeMissing fun _data(): JsonField<List<V2ListResponse>> = data
54+
@JsonProperty("data") @ExcludeMissing fun _data(): JsonField<List<AuthRule>> = data
5755

5856
/**
5957
* Returns the raw JSON value of [hasMore].
@@ -91,7 +89,7 @@ private constructor(
9189
/** A builder for [AuthRuleV2ListPageResponse]. */
9290
class Builder internal constructor() {
9391

94-
private var data: JsonField<MutableList<V2ListResponse>>? = null
92+
private var data: JsonField<MutableList<AuthRule>>? = null
9593
private var hasMore: JsonField<Boolean>? = null
9694
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
9795

@@ -102,25 +100,25 @@ private constructor(
102100
additionalProperties = authRuleV2ListPageResponse.additionalProperties.toMutableMap()
103101
}
104102

105-
fun data(data: List<V2ListResponse>) = data(JsonField.of(data))
103+
fun data(data: List<AuthRule>) = data(JsonField.of(data))
106104

107105
/**
108106
* Sets [Builder.data] to an arbitrary JSON value.
109107
*
110-
* You should usually call [Builder.data] with a well-typed `List<V2ListResponse>` value
111-
* instead. This method is primarily for setting the field to an undocumented or not yet
112-
* supported value.
108+
* You should usually call [Builder.data] with a well-typed `List<AuthRule>` value instead.
109+
* This method is primarily for setting the field to an undocumented or not yet supported
110+
* value.
113111
*/
114-
fun data(data: JsonField<List<V2ListResponse>>) = apply {
112+
fun data(data: JsonField<List<AuthRule>>) = apply {
115113
this.data = data.map { it.toMutableList() }
116114
}
117115

118116
/**
119-
* Adds a single [V2ListResponse] to [Builder.data].
117+
* Adds a single [AuthRule] to [Builder.data].
120118
*
121119
* @throws IllegalStateException if the field was previously set to a non-list.
122120
*/
123-
fun addData(data: V2ListResponse) = apply {
121+
fun addData(data: AuthRule) = apply {
124122
this.data =
125123
(this.data ?: JsonField.of(mutableListOf())).also {
126124
checkKnown("data", it).add(data)

0 commit comments

Comments
 (0)