Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.100.0"
".": "0.101.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 166
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa089e65735b8884f8cb391b39b9a0b295819e438bf976c98cc6150628ca5488.yml
openapi_spec_hash: 719876533d1496e9192c7a734a78c736
config_hash: e9a46eb8acb9dc2c236f3e1958a1c4dd
configured_endpoints: 168
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-529662462c00af160f74568fe26dbe576cf1fdc9f427e11bb1939bd8acdcb43f.yml
openapi_spec_hash: a98631dfc66716d41ada4ddb199f7028
config_hash: 2d501901f343d00775037fcec4121983
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.101.0 (2025-08-04)

Full Changelog: [v0.100.0...v0.101.0](https://github.com/lithic-com/lithic-python/compare/v0.100.0...v0.101.0)

### Features

* **api:** adds new Account Activity API ([62a2b97](https://github.com/lithic-com/lithic-python/commit/62a2b970195c5a3969187e20921d9b5c859d91e8))
* **client:** support file upload requests ([97fa938](https://github.com/lithic-com/lithic-python/commit/97fa9388daaf5147aeeaeb1911ca1847c149ff3a))

## 0.100.0 (2025-07-28)

Full Changelog: [v0.99.0...v0.100.0](https://github.com/lithic-com/lithic-python/compare/v0.99.0...v0.100.0)
Expand Down
13 changes: 13 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,16 @@ Methods:

- <code title="get /v1/network_programs/{network_program_token}">client.network_programs.<a href="./src/lithic/resources/network_programs.py">retrieve</a>(network_program_token) -> <a href="./src/lithic/types/network_program.py">NetworkProgram</a></code>
- <code title="get /v1/network_programs">client.network_programs.<a href="./src/lithic/resources/network_programs.py">list</a>(\*\*<a href="src/lithic/types/network_program_list_params.py">params</a>) -> <a href="./src/lithic/types/network_program.py">SyncSinglePage[NetworkProgram]</a></code>

# AccountActivity

Types:

```python
from lithic.types import AccountActivityListResponse, AccountActivityRetrieveTransactionResponse
```

Methods:

- <code title="get /v1/account_activity">client.account_activity.<a href="./src/lithic/resources/account_activity.py">list</a>(\*\*<a href="src/lithic/types/account_activity_list_params.py">params</a>) -> <a href="./src/lithic/types/account_activity_list_response.py">SyncCursorPage[AccountActivityListResponse]</a></code>
- <code title="get /v1/account_activity/{transaction_token}">client.account_activity.<a href="./src/lithic/resources/account_activity.py">retrieve_transaction</a>(transaction_token) -> <a href="./src/lithic/types/account_activity_retrieve_transaction_response.py">AccountActivityRetrieveTransactionResponse</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lithic"
version = "0.100.0"
version = "0.101.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
5 changes: 4 additions & 1 deletion src/lithic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ def _build_request(
is_body_allowed = options.method.lower() != "get"

if is_body_allowed:
kwargs["json"] = json_data if is_given(json_data) else None
if isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
Expand Down
38 changes: 38 additions & 0 deletions src/lithic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
funding_events,
account_holders,
credit_products,
account_activity,
digital_card_art,
network_programs,
external_payments,
Expand All @@ -80,6 +81,7 @@
from .resources.funding_events import FundingEvents, AsyncFundingEvents
from .resources.account_holders import AccountHolders, AsyncAccountHolders
from .resources.reports.reports import Reports, AsyncReports
from .resources.account_activity import AccountActivity, AsyncAccountActivity
from .resources.digital_card_art import DigitalCardArtResource, AsyncDigitalCardArtResource
from .resources.network_programs import NetworkPrograms, AsyncNetworkPrograms
from .resources.external_payments import ExternalPayments, AsyncExternalPayments
Expand Down Expand Up @@ -368,6 +370,12 @@ def network_programs(self) -> NetworkPrograms:

return NetworkPrograms(self)

@cached_property
def account_activity(self) -> AccountActivity:
from .resources.account_activity import AccountActivity

return AccountActivity(self)

@cached_property
def with_raw_response(self) -> LithicWithRawResponse:
return LithicWithRawResponse(self)
Expand Down Expand Up @@ -754,6 +762,12 @@ def network_programs(self) -> AsyncNetworkPrograms:

return AsyncNetworkPrograms(self)

@cached_property
def account_activity(self) -> AsyncAccountActivity:
from .resources.account_activity import AsyncAccountActivity

return AsyncAccountActivity(self)

@cached_property
def webhooks(self) -> webhooks.AsyncWebhooks:
from .resources.webhooks import AsyncWebhooks
Expand Down Expand Up @@ -1069,6 +1083,12 @@ def network_programs(self) -> network_programs.NetworkProgramsWithRawResponse:

return NetworkProgramsWithRawResponse(self._client.network_programs)

@cached_property
def account_activity(self) -> account_activity.AccountActivityWithRawResponse:
from .resources.account_activity import AccountActivityWithRawResponse

return AccountActivityWithRawResponse(self._client.account_activity)


class AsyncLithicWithRawResponse:
_client: AsyncLithic
Expand Down Expand Up @@ -1242,6 +1262,12 @@ def network_programs(self) -> network_programs.AsyncNetworkProgramsWithRawRespon

return AsyncNetworkProgramsWithRawResponse(self._client.network_programs)

@cached_property
def account_activity(self) -> account_activity.AsyncAccountActivityWithRawResponse:
from .resources.account_activity import AsyncAccountActivityWithRawResponse

return AsyncAccountActivityWithRawResponse(self._client.account_activity)


class LithicWithStreamedResponse:
_client: Lithic
Expand Down Expand Up @@ -1415,6 +1441,12 @@ def network_programs(self) -> network_programs.NetworkProgramsWithStreamingRespo

return NetworkProgramsWithStreamingResponse(self._client.network_programs)

@cached_property
def account_activity(self) -> account_activity.AccountActivityWithStreamingResponse:
from .resources.account_activity import AccountActivityWithStreamingResponse

return AccountActivityWithStreamingResponse(self._client.account_activity)


class AsyncLithicWithStreamedResponse:
_client: AsyncLithic
Expand Down Expand Up @@ -1588,6 +1620,12 @@ def network_programs(self) -> network_programs.AsyncNetworkProgramsWithStreaming

return AsyncNetworkProgramsWithStreamingResponse(self._client.network_programs)

@cached_property
def account_activity(self) -> account_activity.AsyncAccountActivityWithStreamingResponse:
from .resources.account_activity import AsyncAccountActivityWithStreamingResponse

return AsyncAccountActivityWithStreamingResponse(self._client.account_activity)


Client = Lithic

Expand Down
8 changes: 4 additions & 4 deletions src/lithic/_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
return file

if is_tuple_t(file):
return (file[0], _read_file_content(file[1]), *file[2:])
return (file[0], read_file_content(file[1]), *file[2:])

raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")


def _read_file_content(file: FileContent) -> HttpxFileContent:
def read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return pathlib.Path(file).read_bytes()
return file
Expand Down Expand Up @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
return file

if is_tuple_t(file):
return (file[0], await _async_read_file_content(file[1]), *file[2:])
return (file[0], await async_read_file_content(file[1]), *file[2:])

raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")


async def _async_read_file_content(file: FileContent) -> HttpxFileContent:
async def async_read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return await anyio.Path(file).read_bytes()

Expand Down
2 changes: 1 addition & 1 deletion src/lithic/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "lithic"
__version__ = "0.100.0" # x-release-please-version
__version__ = "0.101.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/lithic/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@
CreditProductsWithStreamingResponse,
AsyncCreditProductsWithStreamingResponse,
)
from .account_activity import (
AccountActivity,
AsyncAccountActivity,
AccountActivityWithRawResponse,
AsyncAccountActivityWithRawResponse,
AccountActivityWithStreamingResponse,
AsyncAccountActivityWithStreamingResponse,
)
from .digital_card_art import (
DigitalCardArtResource,
AsyncDigitalCardArtResource,
Expand Down Expand Up @@ -383,4 +391,10 @@
"AsyncNetworkProgramsWithRawResponse",
"NetworkProgramsWithStreamingResponse",
"AsyncNetworkProgramsWithStreamingResponse",
"AccountActivity",
"AsyncAccountActivity",
"AccountActivityWithRawResponse",
"AsyncAccountActivityWithRawResponse",
"AccountActivityWithStreamingResponse",
"AsyncAccountActivityWithStreamingResponse",
]
Loading