Skip to content

Commit c2a02b4

Browse files
feat: Updating Reactor Request objects
BREAKING CHANGE: This version removes the existing Reactors Request objects for Reactors and Reactors Async, allowing the use of dynamic objects
1 parent 6936110 commit c2a02b4

16 files changed

Lines changed: 811 additions & 309 deletions

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright (c) 2025 Basis-theory.
189+
Copyright (c) 2026 Basis-theory.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

reference.md

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ client.applications().getByKey();
330330
</details>
331331

332332
## ApplicationKeys
333-
<details><summary><code>client.applicationKeys.list(id) -> List&lt;ApplicationKey&gt;</code></summary>
333+
<details><summary><code>client.applicationKeys.list(id) -> List&amp;lt;ApplicationKey&amp;gt;</code></summary>
334334
<dl>
335335
<dd>
336336

@@ -528,7 +528,7 @@ client.applicationKeys().delete("id", "keyId");
528528
</details>
529529

530530
## ApplicationTemplates
531-
<details><summary><code>client.applicationTemplates.list() -> List&lt;ApplicationTemplate&gt;</code></summary>
531+
<details><summary><code>client.applicationTemplates.list() -> List&amp;lt;ApplicationTemplate&amp;gt;</code></summary>
532532
<dl>
533533
<dd>
534534

@@ -1563,7 +1563,7 @@ client.enrichments().getcarddetails(
15631563
</details>
15641564

15651565
## Keys
1566-
<details><summary><code>client.keys.list() -> List&lt;ClientEncryptionKeyMetadataResponse&gt;</code></summary>
1566+
<details><summary><code>client.keys.list() -> List&amp;lt;ClientEncryptionKeyMetadataResponse&amp;gt;</code></summary>
15671567
<dl>
15681568
<dd>
15691569

@@ -1805,7 +1805,7 @@ client.logs().list(
18051805
</dl>
18061806
</details>
18071807

1808-
<details><summary><code>client.logs.getEntityTypes() -> List&lt;LogEntityType&gt;</code></summary>
1808+
<details><summary><code>client.logs.getEntityTypes() -> List&amp;lt;LogEntityType&amp;gt;</code></summary>
18091809
<dl>
18101810
<dd>
18111811

@@ -1889,6 +1889,14 @@ client.networkTokens().create(
18891889

18901890
**cardholderInfo:** `Optional<CardholderInfo>`
18911891

1892+
</dd>
1893+
</dl>
1894+
1895+
<dl>
1896+
<dd>
1897+
1898+
**merchantId:** `Optional<String>`
1899+
18921900
</dd>
18931901
</dl>
18941902
</dd>
@@ -2100,7 +2108,7 @@ client.networkTokens().resume("id");
21002108
</details>
21012109

21022110
## Permissions
2103-
<details><summary><code>client.permissions.list() -> List&lt;Permission&gt;</code></summary>
2111+
<details><summary><code>client.permissions.list() -> List&amp;lt;Permission&amp;gt;</code></summary>
21042112
<dl>
21052113
<dd>
21062114

@@ -3099,12 +3107,9 @@ client.reactors().patch(
30993107
<dd>
31003108

31013109
```java
3102-
client.reactors().react(
3103-
"id",
3104-
ReactRequest
3105-
.builder()
3106-
.build()
3107-
);
3110+
client.reactors().react("id", new
3111+
HashMap<String, Object>() {{put("key", "value");
3112+
}});
31083113
```
31093114
</dd>
31103115
</dl>
@@ -3127,15 +3132,7 @@ client.reactors().react(
31273132
<dl>
31283133
<dd>
31293134

3130-
**args:** `Optional<Object>`
3131-
3132-
</dd>
3133-
</dl>
3134-
3135-
<dl>
3136-
<dd>
3137-
3138-
**callbackUrl:** `Optional<String>`
3135+
**request:** `Object`
31393136

31403137
</dd>
31413138
</dl>
@@ -3160,12 +3157,9 @@ client.reactors().react(
31603157
<dd>
31613158

31623159
```java
3163-
client.reactors().reactAsync(
3164-
"id",
3165-
ReactRequestAsync
3166-
.builder()
3167-
.build()
3168-
);
3160+
client.reactors().reactAsync("id", new
3161+
HashMap<String, Object>() {{put("key", "value");
3162+
}});
31693163
```
31703164
</dd>
31713165
</dl>
@@ -3188,7 +3182,7 @@ client.reactors().reactAsync(
31883182
<dl>
31893183
<dd>
31903184

3191-
**args:** `Optional<Object>`
3185+
**request:** `Object`
31923186

31933187
</dd>
31943188
</dl>
@@ -3201,7 +3195,7 @@ client.reactors().reactAsync(
32013195
</details>
32023196

32033197
## Roles
3204-
<details><summary><code>client.roles.list() -> List&lt;Role&gt;</code></summary>
3198+
<details><summary><code>client.roles.list() -> List&amp;lt;Role&amp;gt;</code></summary>
32053199
<dl>
32063200
<dd>
32073201

@@ -5874,7 +5868,7 @@ client.threeds().sessions().get("id");
58745868
</details>
58755869

58765870
## Webhooks Events
5877-
<details><summary><code>client.webhooks.events.list() -> List&lt;String&gt;</code></summary>
5871+
<details><summary><code>client.webhooks.events.list() -> List&amp;lt;String&amp;gt;</code></summary>
58785872
<dl>
58795873
<dd>
58805874

src/main/java/com/basistheory/resources/networktokens/requests/CreateNetworkTokenRequest.java

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,22 @@ public final class CreateNetworkTokenRequest {
3030

3131
private final Optional<CardholderInfo> cardholderInfo;
3232

33+
private final Optional<String> merchantId;
34+
3335
private final Map<String, Object> additionalProperties;
3436

3537
private CreateNetworkTokenRequest(
3638
Optional<Card> data,
3739
Optional<String> tokenId,
3840
Optional<String> tokenIntentId,
3941
Optional<CardholderInfo> cardholderInfo,
42+
Optional<String> merchantId,
4043
Map<String, Object> additionalProperties) {
4144
this.data = data;
4245
this.tokenId = tokenId;
4346
this.tokenIntentId = tokenIntentId;
4447
this.cardholderInfo = cardholderInfo;
48+
this.merchantId = merchantId;
4549
this.additionalProperties = additionalProperties;
4650
}
4751

@@ -65,6 +69,11 @@ public Optional<CardholderInfo> getCardholderInfo() {
6569
return cardholderInfo;
6670
}
6771

72+
@JsonProperty("merchant_id")
73+
public Optional<String> getMerchantId() {
74+
return merchantId;
75+
}
76+
6877
@java.lang.Override
6978
public boolean equals(Object other) {
7079
if (this == other) return true;
@@ -80,12 +89,13 @@ private boolean equalTo(CreateNetworkTokenRequest other) {
8089
return data.equals(other.data)
8190
&& tokenId.equals(other.tokenId)
8291
&& tokenIntentId.equals(other.tokenIntentId)
83-
&& cardholderInfo.equals(other.cardholderInfo);
92+
&& cardholderInfo.equals(other.cardholderInfo)
93+
&& merchantId.equals(other.merchantId);
8494
}
8595

8696
@java.lang.Override
8797
public int hashCode() {
88-
return Objects.hash(this.data, this.tokenId, this.tokenIntentId, this.cardholderInfo);
98+
return Objects.hash(this.data, this.tokenId, this.tokenIntentId, this.cardholderInfo, this.merchantId);
8999
}
90100

91101
@java.lang.Override
@@ -107,6 +117,8 @@ public static final class Builder {
107117

108118
private Optional<CardholderInfo> cardholderInfo = Optional.empty();
109119

120+
private Optional<String> merchantId = Optional.empty();
121+
110122
@JsonAnySetter
111123
private Map<String, Object> additionalProperties = new HashMap<>();
112124

@@ -117,6 +129,7 @@ public Builder from(CreateNetworkTokenRequest other) {
117129
tokenId(other.getTokenId());
118130
tokenIntentId(other.getTokenIntentId());
119131
cardholderInfo(other.getCardholderInfo());
132+
merchantId(other.getMerchantId());
120133
return this;
121134
}
122135

@@ -164,8 +177,20 @@ public Builder cardholderInfo(CardholderInfo cardholderInfo) {
164177
return this;
165178
}
166179

180+
@JsonSetter(value = "merchant_id", nulls = Nulls.SKIP)
181+
public Builder merchantId(Optional<String> merchantId) {
182+
this.merchantId = merchantId;
183+
return this;
184+
}
185+
186+
public Builder merchantId(String merchantId) {
187+
this.merchantId = Optional.ofNullable(merchantId);
188+
return this;
189+
}
190+
167191
public CreateNetworkTokenRequest build() {
168-
return new CreateNetworkTokenRequest(data, tokenId, tokenIntentId, cardholderInfo, additionalProperties);
192+
return new CreateNetworkTokenRequest(
193+
data, tokenId, tokenIntentId, cardholderInfo, merchantId, additionalProperties);
169194
}
170195
}
171196
}

src/main/java/com/basistheory/resources/reactors/AsyncRawReactorsClient.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import com.basistheory.errors.UnprocessableEntityError;
2121
import com.basistheory.resources.reactors.requests.CreateReactorRequest;
2222
import com.basistheory.resources.reactors.requests.PatchReactorRequest;
23-
import com.basistheory.resources.reactors.requests.ReactRequest;
24-
import com.basistheory.resources.reactors.requests.ReactRequestAsync;
2523
import com.basistheory.resources.reactors.requests.ReactorsListRequest;
2624
import com.basistheory.resources.reactors.requests.UpdateReactorRequest;
2725
import com.basistheory.types.AsyncReactResponse;
@@ -565,16 +563,12 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
565563
return future;
566564
}
567565

568-
public CompletableFuture<BasisTheoryApiHttpResponse<ReactResponse>> react(String id) {
569-
return react(id, ReactRequest.builder().build());
570-
}
571-
572-
public CompletableFuture<BasisTheoryApiHttpResponse<ReactResponse>> react(String id, ReactRequest request) {
566+
public CompletableFuture<BasisTheoryApiHttpResponse<ReactResponse>> react(String id, Object request) {
573567
return react(id, request, null);
574568
}
575569

576570
public CompletableFuture<BasisTheoryApiHttpResponse<ReactResponse>> react(
577-
String id, ReactRequest request, RequestOptions requestOptions) {
571+
String id, Object request, RequestOptions requestOptions) {
578572
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
579573
.newBuilder()
580574
.addPathSegments("reactors")
@@ -662,17 +656,12 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
662656
return future;
663657
}
664658

665-
public CompletableFuture<BasisTheoryApiHttpResponse<AsyncReactResponse>> reactAsync(String id) {
666-
return reactAsync(id, ReactRequestAsync.builder().build());
667-
}
668-
669-
public CompletableFuture<BasisTheoryApiHttpResponse<AsyncReactResponse>> reactAsync(
670-
String id, ReactRequestAsync request) {
659+
public CompletableFuture<BasisTheoryApiHttpResponse<AsyncReactResponse>> reactAsync(String id, Object request) {
671660
return reactAsync(id, request, null);
672661
}
673662

674663
public CompletableFuture<BasisTheoryApiHttpResponse<AsyncReactResponse>> reactAsync(
675-
String id, ReactRequestAsync request, RequestOptions requestOptions) {
664+
String id, Object request, RequestOptions requestOptions) {
676665
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
677666
.newBuilder()
678667
.addPathSegments("reactors")

src/main/java/com/basistheory/resources/reactors/AsyncReactorsClient.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import com.basistheory.core.pagination.SyncPagingIterable;
1111
import com.basistheory.resources.reactors.requests.CreateReactorRequest;
1212
import com.basistheory.resources.reactors.requests.PatchReactorRequest;
13-
import com.basistheory.resources.reactors.requests.ReactRequest;
14-
import com.basistheory.resources.reactors.requests.ReactRequestAsync;
1513
import com.basistheory.resources.reactors.requests.ReactorsListRequest;
1614
import com.basistheory.resources.reactors.requests.UpdateReactorRequest;
1715
import com.basistheory.resources.reactors.results.AsyncResultsClient;
@@ -100,28 +98,19 @@ public CompletableFuture<Void> patch(
10098
return this.rawClient.patch(id, request, requestOptions).thenApply(response -> response.body());
10199
}
102100

103-
public CompletableFuture<ReactResponse> react(String id) {
104-
return this.rawClient.react(id).thenApply(response -> response.body());
105-
}
106-
107-
public CompletableFuture<ReactResponse> react(String id, ReactRequest request) {
101+
public CompletableFuture<ReactResponse> react(String id, Object request) {
108102
return this.rawClient.react(id, request).thenApply(response -> response.body());
109103
}
110104

111-
public CompletableFuture<ReactResponse> react(String id, ReactRequest request, RequestOptions requestOptions) {
105+
public CompletableFuture<ReactResponse> react(String id, Object request, RequestOptions requestOptions) {
112106
return this.rawClient.react(id, request, requestOptions).thenApply(response -> response.body());
113107
}
114108

115-
public CompletableFuture<AsyncReactResponse> reactAsync(String id) {
116-
return this.rawClient.reactAsync(id).thenApply(response -> response.body());
117-
}
118-
119-
public CompletableFuture<AsyncReactResponse> reactAsync(String id, ReactRequestAsync request) {
109+
public CompletableFuture<AsyncReactResponse> reactAsync(String id, Object request) {
120110
return this.rawClient.reactAsync(id, request).thenApply(response -> response.body());
121111
}
122112

123-
public CompletableFuture<AsyncReactResponse> reactAsync(
124-
String id, ReactRequestAsync request, RequestOptions requestOptions) {
113+
public CompletableFuture<AsyncReactResponse> reactAsync(String id, Object request, RequestOptions requestOptions) {
125114
return this.rawClient.reactAsync(id, request, requestOptions).thenApply(response -> response.body());
126115
}
127116

src/main/java/com/basistheory/resources/reactors/RawReactorsClient.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import com.basistheory.errors.UnprocessableEntityError;
2121
import com.basistheory.resources.reactors.requests.CreateReactorRequest;
2222
import com.basistheory.resources.reactors.requests.PatchReactorRequest;
23-
import com.basistheory.resources.reactors.requests.ReactRequest;
24-
import com.basistheory.resources.reactors.requests.ReactRequestAsync;
2523
import com.basistheory.resources.reactors.requests.ReactorsListRequest;
2624
import com.basistheory.resources.reactors.requests.UpdateReactorRequest;
2725
import com.basistheory.types.AsyncReactResponse;
@@ -445,16 +443,11 @@ public BasisTheoryApiHttpResponse<Void> patch(
445443
}
446444
}
447445

448-
public BasisTheoryApiHttpResponse<ReactResponse> react(String id) {
449-
return react(id, ReactRequest.builder().build());
450-
}
451-
452-
public BasisTheoryApiHttpResponse<ReactResponse> react(String id, ReactRequest request) {
446+
public BasisTheoryApiHttpResponse<ReactResponse> react(String id, Object request) {
453447
return react(id, request, null);
454448
}
455449

456-
public BasisTheoryApiHttpResponse<ReactResponse> react(
457-
String id, ReactRequest request, RequestOptions requestOptions) {
450+
public BasisTheoryApiHttpResponse<ReactResponse> react(String id, Object request, RequestOptions requestOptions) {
458451
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
459452
.newBuilder()
460453
.addPathSegments("reactors")
@@ -521,16 +514,12 @@ public BasisTheoryApiHttpResponse<ReactResponse> react(
521514
}
522515
}
523516

524-
public BasisTheoryApiHttpResponse<AsyncReactResponse> reactAsync(String id) {
525-
return reactAsync(id, ReactRequestAsync.builder().build());
526-
}
527-
528-
public BasisTheoryApiHttpResponse<AsyncReactResponse> reactAsync(String id, ReactRequestAsync request) {
517+
public BasisTheoryApiHttpResponse<AsyncReactResponse> reactAsync(String id, Object request) {
529518
return reactAsync(id, request, null);
530519
}
531520

532521
public BasisTheoryApiHttpResponse<AsyncReactResponse> reactAsync(
533-
String id, ReactRequestAsync request, RequestOptions requestOptions) {
522+
String id, Object request, RequestOptions requestOptions) {
534523
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
535524
.newBuilder()
536525
.addPathSegments("reactors")

0 commit comments

Comments
 (0)