Skip to content

Commit 2868776

Browse files
stainless-botRobertCraigie
authored andcommitted
refactor: change event_types[] param
1 parent d61e6ae commit 2868776

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ LithicClient client = LithicOkHttpClient.builder()
5959
.build();
6060
```
6161

62-
| Property | Environment variable | Required | Default value |
63-
| -------- | ------------------------- | -------- | ------------- |
64-
| apiKey | `LITHIC_API_KEY` | true ||
65-
| webhookSecret | `LITHIC_WEBHOOK_SECRET` | false ||
62+
| Property | Environment variable | Required | Default value |
63+
| ------------- | ----------------------- | -------- | ------------- |
64+
| apiKey | `LITHIC_API_KEY` | true | |
65+
| webhookSecret | `LITHIC_WEBHOOK_SECRET` | false | |
6666

6767
Read the documentation for more configuration options.
6868

@@ -139,12 +139,6 @@ To write an unrecognized enum value, pass a string to the wrapper class's `of` c
139139
Card.builder().state(State.of("NEW_STATE")).build()
140140
```
141141

142-
143-
144-
145-
146-
147-
148142
## Requests
149143

150144
### Parameters and bodies
@@ -201,7 +195,6 @@ if (state.isMissing()) {
201195
}
202196
```
203197

204-
205198
### Additional model properties
206199

207200
Sometimes, the server response may include additional properties that are not yet available in this library's types. You can access them using the model's `_additionalProperties` method:
@@ -210,7 +203,6 @@ Sometimes, the server response may include additional properties that are not ye
210203
JsonValue secret = card._additionalProperties().get("secret_field");
211204
```
212205

213-
214206
---
215207

216208
## Pagination
@@ -276,7 +268,6 @@ You can use `lithic.webhooks().verifySignature(body, headers, secret?)` or `lith
276268

277269
---
278270

279-
280271
## Error handling
281272

282273
This library throws exceptions in a single hierarchy for easy handling:
@@ -303,24 +294,32 @@ This library throws exceptions in a single hierarchy for easy handling:
303294
## Network options
304295

305296
### Retries
297+
306298
Requests that experience certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 409 Conflict, 429 Rate Limit, and >=500 Internal errors will all be retried by default.
307299
You can provide a `maxRetries` on the client builder to configure this:
300+
308301
```java
309302
LithicClient client = LithicOkHttpClient.builder()
310303
.fromEnv()
311304
.maxRetries(4)
312305
.build();
313306
```
307+
314308
### Timeouts
309+
315310
Requests time out after 60 seconds by default. You can configure this on the client builder:
311+
316312
```java
317313
LithicClient client = LithicOkHttpClient.builder()
318314
.fromEnv()
319315
.timeout(Duration.ofSeconds(30))
320316
.build();
321317
```
318+
322319
### Proxies
320+
323321
Requests can be routed through a proxy. You can configure this on the client builder:
322+
324323
```java
325324
LithicClient client = LithicOkHttpClient.builder()
326325
.fromEnv()
@@ -330,11 +329,14 @@ LithicClient client = LithicOkHttpClient.builder()
330329
))
331330
.build();
332331
```
332+
333333
### Environments
334+
334335
Requests are made to the production environment by default. You can connect to other environments, like `sandbox`, via the client builder:
336+
335337
```java
336338
LithicClient client = LithicOkHttpClient.builder()
337339
.fromEnv()
338340
.sandbox()
339341
.build();
340-
```
342+
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ constructor(
4343
this.pageSize?.let { params.put("page_size", listOf(it.toString())) }
4444
this.startingAfter?.let { params.put("starting_after", listOf(it.toString())) }
4545
this.endingBefore?.let { params.put("ending_before", listOf(it.toString())) }
46-
this.eventTypes?.let { params.put("event_types[]", it.map(Any::toString)) }
46+
this.eventTypes?.let { params.put("event_types", listOf(it.joinToString(separator = ","))) }
4747
params.putAll(additionalQueryParams)
4848
return params.toUnmodifiable()
4949
}

lithic-java-core/src/test/kotlin/com/lithic/api/models/EventListParamsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class EventListParamsTest {
3636
expected.put("page_size", listOf("123"))
3737
expected.put("starting_after", listOf("string"))
3838
expected.put("ending_before", listOf("string"))
39-
expected.put("event_types[]", listOf(EventListParams.EventType.DISPUTE_UPDATED.toString()))
39+
expected.put("event_types", listOf(EventListParams.EventType.DISPUTE_UPDATED.toString()))
4040
assertThat(params.getQueryParams()).isEqualTo(expected)
4141
}
4242

0 commit comments

Comments
 (0)