From d4f0944e85fffad08f537e12d5539f5699f6c835 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:21:21 +0000 Subject: [PATCH] chore(docs): temporarily remove custom readme code (#175) --- README.md | 60 ------------------------------------------------------- 1 file changed, 60 deletions(-) diff --git a/README.md b/README.md index 2d08ca15..7f266312 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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: