Skip to content

Commit

Permalink
chore(docs): temporarily remove custom readme code (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 21, 2024
1 parent 7d934bd commit 96b7cc4
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,43 +102,6 @@ See [Pagination](#pagination) below for more information on transparently workin

---

## Enums

The Lithic SDK generates wrapper classes for all enum properties in the API. You can read and write these
values directly using the static instances of the class:

```kotlin
// Read an enum property
if (card.state == Card.State.CLOSED) {
// ...
}

// Write an enum property
card.builder().state(Card.State.CLOSED).build()
```

Over time, the Lithic API may add new values to the property that are not yet represented by the enum type in
this SDK. If an unrecognized value is found, the enum is set to a special sentinel value `_UNKNOWN` and you can use `asString` to read the string that was received:

```kotlin
when (card.state.value()) {
Card.State.Value.CLOSED -> {
// ... handle recognized enum value
}
...
case Card.State.Value._UNKNOWN -> {
String cardState = card.state.asString()
// ... handle unrecognized enum value as string
}
}
```

To write an unrecognized enum value, pass a string to the wrapper class's `of` constructor method:

```kotlin
Card.builder().state(State.of("NEW_STATE")).build()
```

## Requests

### Parameters and bodies
Expand Down Expand Up @@ -168,15 +131,6 @@ When receiving a response, the Lithic Kotlin SDK will deserialize it into instan
val card = client.cards().create().validate()
```

### Nullable Properties

Model properties that are optional or allow a null value are represented as `Optional`. The empty case can represent either that the field was provided as null, or that it was simply not present.

```kotlin
// Card.cvv returns String?
card.cvv != null // false
```

### Response properties as JSON

In rare cases, you may want to access the underlying JSON value for a response property rather than using the typed version provided by
Expand Down Expand Up @@ -257,20 +211,6 @@ while (page != null) {

---

---

## Webhook Verification

We provide helper methods for verifying that a webhook request came from Lithic, and not a malicious third party.

You can use `lithic.webhooks().verifySignature(body, headers, secret?)` or `lithic.webhooks().unwrap(body, headers, secret?)`,
both of which will raise an error if the signature is invalid.

Note that the "body" parameter must be the raw JSON string sent from the server (do not parse it first).
The `.unwrap()` method can parse this JSON for you.

---

## Error handling

This library throws exceptions in a single hierarchy for easy handling:
Expand Down

0 comments on commit 96b7cc4

Please sign in to comment.