Skip to content

Commit f87cde9

Browse files
RobertCraigiestainless-app[bot]
authored andcommitted
chore(examples): fix type checking
1 parent a434a4d commit f87cde9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/upload_evidence.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env -S rye run python
22

3+
from __future__ import annotations
4+
35
# To run this example locally
46
# 1. Install Rye and setup a Python virtual environment: ./scripts/bootstrap
57
# 2. Run the example: LITHIC_API_KEY=<your_api_key> rye run python examples/upload_evidence.py
6-
7-
88
from lithic import Lithic, file_from_path
9+
from lithic.types import DisputeListResponse, DisputeCreateResponse
910

1011
client = Lithic(environment="sandbox")
1112

@@ -16,7 +17,7 @@
1617
assert transaction.token, "Transaction must have a token"
1718

1819
disputes_page = client.disputes.list()
19-
dispute = disputes_page.data[0]
20+
dispute: DisputeCreateResponse | DisputeListResponse | None = disputes_page.data[0] if disputes_page.data else None
2021
if not dispute:
2122
dispute = client.disputes.create(
2223
amount=42,

0 commit comments

Comments
 (0)