Skip to content

Commit f659cd3

Browse files
feat(api): updates Transaction retrieve response to match API
1 parent 5dc0933 commit f659cd3

File tree

9 files changed

+66
-64
lines changed

9 files changed

+66
-64
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 166
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-54e6f7955e86265bc870eaae7f4a9cd716292457a83e032567f22bbb9ce6ad0d.yml
3-
openapi_spec_hash: 6adbff5e5aeda88504047fc2c87e3fa0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa089e65735b8884f8cb391b39b9a0b295819e438bf976c98cc6150628ca5488.yml
3+
openapi_spec_hash: 719876533d1496e9192c7a734a78c736
44
config_hash: e9a46eb8acb9dc2c236f3e1958a1c4dd

api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,14 @@ Types:
159159
```python
160160
from lithic.types import (
161161
Tokenization,
162-
TokenizationRetrieveResponse,
163162
TokenizationSimulateResponse,
164163
TokenizationUpdateDigitalCardArtResponse,
165164
)
166165
```
167166

168167
Methods:
169168

170-
- <code title="get /v1/tokenizations/{tokenization_token}">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">retrieve</a>(tokenization_token) -> <a href="./src/lithic/types/tokenization_retrieve_response.py">TokenizationRetrieveResponse</a></code>
169+
- <code title="get /v1/tokenizations/{tokenization_token}">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">retrieve</a>(tokenization_token) -> <a href="./src/lithic/types/tokenization.py">Tokenization</a></code>
171170
- <code title="get /v1/tokenizations">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">list</a>(\*\*<a href="src/lithic/types/tokenization_list_params.py">params</a>) -> <a href="./src/lithic/types/tokenization.py">SyncCursorPage[Tokenization]</a></code>
172171
- <code title="post /v1/tokenizations/{tokenization_token}/activate">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">activate</a>(tokenization_token) -> None</code>
173172
- <code title="post /v1/tokenizations/{tokenization_token}/deactivate">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">deactivate</a>(tokenization_token) -> None</code>

src/lithic/resources/tokenizations.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from ..pagination import SyncCursorPage, AsyncCursorPage
2424
from .._base_client import AsyncPaginator, make_request_options
2525
from ..types.tokenization import Tokenization
26-
from ..types.tokenization_retrieve_response import TokenizationRetrieveResponse
2726
from ..types.tokenization_simulate_response import TokenizationSimulateResponse
2827
from ..types.tokenization_update_digital_card_art_response import TokenizationUpdateDigitalCardArtResponse
2928

@@ -60,7 +59,7 @@ def retrieve(
6059
extra_query: Query | None = None,
6160
extra_body: Body | None = None,
6261
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63-
) -> TokenizationRetrieveResponse:
62+
) -> Tokenization:
6463
"""
6564
Get tokenization
6665
@@ -80,7 +79,7 @@ def retrieve(
8079
options=make_request_options(
8180
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
8281
),
83-
cast_to=TokenizationRetrieveResponse,
82+
cast_to=Tokenization,
8483
)
8584

8685
def list(
@@ -526,7 +525,7 @@ async def retrieve(
526525
extra_query: Query | None = None,
527526
extra_body: Body | None = None,
528527
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
529-
) -> TokenizationRetrieveResponse:
528+
) -> Tokenization:
530529
"""
531530
Get tokenization
532531
@@ -546,7 +545,7 @@ async def retrieve(
546545
options=make_request_options(
547546
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
548547
),
549-
cast_to=TokenizationRetrieveResponse,
548+
cast_to=Tokenization,
550549
)
551550

552551
def list(

src/lithic/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
from .external_payment_settle_params import ExternalPaymentSettleParams as ExternalPaymentSettleParams
107107
from .payment_simulate_action_params import PaymentSimulateActionParams as PaymentSimulateActionParams
108108
from .payment_simulate_return_params import PaymentSimulateReturnParams as PaymentSimulateReturnParams
109-
from .tokenization_retrieve_response import TokenizationRetrieveResponse as TokenizationRetrieveResponse
110109
from .tokenization_simulate_response import TokenizationSimulateResponse as TokenizationSimulateResponse
111110
from .external_payment_release_params import ExternalPaymentReleaseParams as ExternalPaymentReleaseParams
112111
from .external_payment_reverse_params import ExternalPaymentReverseParams as ExternalPaymentReverseParams

src/lithic/types/external_payment.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,33 @@ class Event(BaseModel):
5050

5151
class ExternalPayment(BaseModel):
5252
token: str
53-
54-
category: Literal["EXTERNAL_WIRE", "EXTERNAL_ACH", "EXTERNAL_CHECK", "EXTERNAL_TRANSFER"]
53+
"""Unique identifier for the transaction"""
5554

5655
created: datetime
56+
"""ISO 8601 timestamp of when the transaction was created"""
5757

58-
currency: str
58+
family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"]
5959

60-
events: List[Event]
60+
status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
61+
"""The status of the transaction"""
6162

62-
financial_account_token: str
63+
updated: datetime
64+
"""ISO 8601 timestamp of when the transaction was last updated"""
6365

64-
payment_type: Literal["DEPOSIT", "WITHDRAWAL"]
66+
category: Optional[Literal["EXTERNAL_WIRE", "EXTERNAL_ACH", "EXTERNAL_CHECK", "EXTERNAL_TRANSFER"]] = None
6567

66-
pending_amount: int
68+
currency: Optional[str] = None
6769

68-
result: Literal["APPROVED", "DECLINED"]
70+
events: Optional[List[Event]] = None
6971

70-
settled_amount: int
72+
financial_account_token: Optional[str] = None
7173

72-
status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
74+
payment_type: Optional[Literal["DEPOSIT", "WITHDRAWAL"]] = None
7375

74-
updated: datetime
76+
pending_amount: Optional[int] = None
77+
78+
result: Optional[Literal["APPROVED", "DECLINED"]] = None
79+
80+
settled_amount: Optional[int] = None
7581

7682
user_defined_id: Optional[str] = None

src/lithic/types/management_operation_transaction.py

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,46 @@ class TransactionSeries(BaseModel):
6060

6161
class ManagementOperationTransaction(BaseModel):
6262
token: str
63-
64-
category: Literal[
65-
"MANAGEMENT_FEE", "MANAGEMENT_DISPUTE", "MANAGEMENT_REWARD", "MANAGEMENT_ADJUSTMENT", "MANAGEMENT_DISBURSEMENT"
66-
]
63+
"""Unique identifier for the transaction"""
6764

6865
created: datetime
66+
"""ISO 8601 timestamp of when the transaction was created"""
6967

70-
currency: str
68+
family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"]
7169

72-
direction: Literal["CREDIT", "DEBIT"]
70+
status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
71+
"""The status of the transaction"""
7372

74-
events: List[Event]
73+
updated: datetime
74+
"""ISO 8601 timestamp of when the transaction was last updated"""
7575

76-
financial_account_token: str
76+
category: Optional[
77+
Literal[
78+
"MANAGEMENT_FEE",
79+
"MANAGEMENT_DISPUTE",
80+
"MANAGEMENT_REWARD",
81+
"MANAGEMENT_ADJUSTMENT",
82+
"MANAGEMENT_DISBURSEMENT",
83+
]
84+
] = None
7785

78-
pending_amount: int
86+
currency: Optional[str] = None
7987

80-
result: Literal["APPROVED", "DECLINED"]
88+
direction: Optional[Literal["CREDIT", "DEBIT"]] = None
8189

82-
settled_amount: int
90+
events: Optional[List[Event]] = None
8391

84-
status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
92+
external_resource: Optional[ExternalResource] = None
93+
"""External resource associated with the management operation"""
8594

86-
transaction_series: Optional[TransactionSeries] = None
95+
financial_account_token: Optional[str] = None
8796

88-
updated: datetime
97+
pending_amount: Optional[int] = None
8998

90-
external_resource: Optional[ExternalResource] = None
91-
"""External resource associated with the management operation"""
99+
result: Optional[Literal["APPROVED", "DECLINED"]] = None
100+
101+
settled_amount: Optional[int] = None
102+
103+
transaction_series: Optional[TransactionSeries] = None
92104

93105
user_defined_id: Optional[str] = None

src/lithic/types/tokenization_retrieve_response.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/api_resources/test_management_operations.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TestManagementOperations:
2424
@parametrize
2525
def test_method_create(self, client: Lithic) -> None:
2626
management_operation = client.management_operations.create(
27-
amount=0,
27+
amount=1,
2828
category="MANAGEMENT_FEE",
2929
direction="CREDIT",
3030
effective_date=parse_date("2019-12-27"),
@@ -36,7 +36,7 @@ def test_method_create(self, client: Lithic) -> None:
3636
@parametrize
3737
def test_method_create_with_all_params(self, client: Lithic) -> None:
3838
management_operation = client.management_operations.create(
39-
amount=0,
39+
amount=1,
4040
category="MANAGEMENT_FEE",
4141
direction="CREDIT",
4242
effective_date=parse_date("2019-12-27"),
@@ -53,7 +53,7 @@ def test_method_create_with_all_params(self, client: Lithic) -> None:
5353
@parametrize
5454
def test_raw_response_create(self, client: Lithic) -> None:
5555
response = client.management_operations.with_raw_response.create(
56-
amount=0,
56+
amount=1,
5757
category="MANAGEMENT_FEE",
5858
direction="CREDIT",
5959
effective_date=parse_date("2019-12-27"),
@@ -69,7 +69,7 @@ def test_raw_response_create(self, client: Lithic) -> None:
6969
@parametrize
7070
def test_streaming_response_create(self, client: Lithic) -> None:
7171
with client.management_operations.with_streaming_response.create(
72-
amount=0,
72+
amount=1,
7373
category="MANAGEMENT_FEE",
7474
direction="CREDIT",
7575
effective_date=parse_date("2019-12-27"),
@@ -226,7 +226,7 @@ class TestAsyncManagementOperations:
226226
@parametrize
227227
async def test_method_create(self, async_client: AsyncLithic) -> None:
228228
management_operation = await async_client.management_operations.create(
229-
amount=0,
229+
amount=1,
230230
category="MANAGEMENT_FEE",
231231
direction="CREDIT",
232232
effective_date=parse_date("2019-12-27"),
@@ -238,7 +238,7 @@ async def test_method_create(self, async_client: AsyncLithic) -> None:
238238
@parametrize
239239
async def test_method_create_with_all_params(self, async_client: AsyncLithic) -> None:
240240
management_operation = await async_client.management_operations.create(
241-
amount=0,
241+
amount=1,
242242
category="MANAGEMENT_FEE",
243243
direction="CREDIT",
244244
effective_date=parse_date("2019-12-27"),
@@ -255,7 +255,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) ->
255255
@parametrize
256256
async def test_raw_response_create(self, async_client: AsyncLithic) -> None:
257257
response = await async_client.management_operations.with_raw_response.create(
258-
amount=0,
258+
amount=1,
259259
category="MANAGEMENT_FEE",
260260
direction="CREDIT",
261261
effective_date=parse_date("2019-12-27"),
@@ -271,7 +271,7 @@ async def test_raw_response_create(self, async_client: AsyncLithic) -> None:
271271
@parametrize
272272
async def test_streaming_response_create(self, async_client: AsyncLithic) -> None:
273273
async with async_client.management_operations.with_streaming_response.create(
274-
amount=0,
274+
amount=1,
275275
category="MANAGEMENT_FEE",
276276
direction="CREDIT",
277277
effective_date=parse_date("2019-12-27"),

tests/api_resources/test_tokenizations.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from tests.utils import assert_matches_type
1212
from lithic.types import (
1313
Tokenization,
14-
TokenizationRetrieveResponse,
1514
TokenizationSimulateResponse,
1615
TokenizationUpdateDigitalCardArtResponse,
1716
)
@@ -29,7 +28,7 @@ def test_method_retrieve(self, client: Lithic) -> None:
2928
tokenization = client.tokenizations.retrieve(
3029
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
3130
)
32-
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
31+
assert_matches_type(Tokenization, tokenization, path=["response"])
3332

3433
@parametrize
3534
def test_raw_response_retrieve(self, client: Lithic) -> None:
@@ -40,7 +39,7 @@ def test_raw_response_retrieve(self, client: Lithic) -> None:
4039
assert response.is_closed is True
4140
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4241
tokenization = response.parse()
43-
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
42+
assert_matches_type(Tokenization, tokenization, path=["response"])
4443

4544
@parametrize
4645
def test_streaming_response_retrieve(self, client: Lithic) -> None:
@@ -51,7 +50,7 @@ def test_streaming_response_retrieve(self, client: Lithic) -> None:
5150
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5251

5352
tokenization = response.parse()
54-
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
53+
assert_matches_type(Tokenization, tokenization, path=["response"])
5554

5655
assert cast(Any, response.is_closed) is True
5756

@@ -410,7 +409,7 @@ async def test_method_retrieve(self, async_client: AsyncLithic) -> None:
410409
tokenization = await async_client.tokenizations.retrieve(
411410
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
412411
)
413-
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
412+
assert_matches_type(Tokenization, tokenization, path=["response"])
414413

415414
@parametrize
416415
async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
@@ -421,7 +420,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
421420
assert response.is_closed is True
422421
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
423422
tokenization = response.parse()
424-
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
423+
assert_matches_type(Tokenization, tokenization, path=["response"])
425424

426425
@parametrize
427426
async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> None:
@@ -432,7 +431,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> N
432431
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
433432

434433
tokenization = await response.parse()
435-
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
434+
assert_matches_type(Tokenization, tokenization, path=["response"])
436435

437436
assert cast(Any, response.is_closed) is True
438437

0 commit comments

Comments
 (0)