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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.repository == 'lithic-com/lithic-python'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Rye
run: |
Expand Down
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.37.0"
".": "0.38.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 110
configured_endpoints: 112
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.38.0 (2024-02-23)

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

### Features

* **api:** tokenizations ([#369](https://github.com/lithic-com/lithic-python/issues/369)) ([87b5088](https://github.com/lithic-com/lithic-python/commit/87b5088f84a6b200636f80b56d9a188a0e9d66a5))


### Chores

* **internal:** update deps ([#367](https://github.com/lithic-com/lithic-python/issues/367)) ([2e8ddb7](https://github.com/lithic-com/lithic-python/commit/2e8ddb70724b9000d652ec2863e997d087ffb73d))

## 0.37.0 (2024-02-21)

Full Changelog: [v0.36.0...v0.37.0](https://github.com/lithic-com/lithic-python/compare/v0.36.0...v0.37.0)
Expand Down
4 changes: 3 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ Methods:
Types:

```python
from lithic.types import Tokenization, TokenizationSimulateResponse
from lithic.types import Tokenization, TokenizationRetrieveResponse, TokenizationSimulateResponse
```

Methods:

- <code title="get /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>
- <code title="get /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>
- <code title="post /simulate/tokenizations">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">simulate</a>(\*\*<a href="src/lithic/types/tokenization_simulate_params.py">params</a>) -> <a href="./src/lithic/types/tokenization_simulate_response.py">TokenizationSimulateResponse</a></code>

# Cards
Expand Down
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.37.0"
version = "0.38.0"
description = "The official Python library for the lithic API"
readme = "README.md"
license = "Apache-2.0"
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.

__title__ = "lithic"
__version__ = "0.37.0" # x-release-please-version
__version__ = "0.38.0" # x-release-please-version
240 changes: 239 additions & 1 deletion src/lithic/resources/tokenizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@

from __future__ import annotations

from typing import Union
from datetime import date
from typing_extensions import Literal

import httpx

from .. import _legacy_response
from ..types import TokenizationSimulateResponse, tokenization_simulate_params
from ..types import (
Tokenization,
TokenizationRetrieveResponse,
TokenizationSimulateResponse,
tokenization_list_params,
tokenization_simulate_params,
)
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import (
AsyncPaginator,
make_request_options,
)

Expand All @@ -29,6 +39,108 @@ def with_raw_response(self) -> TokenizationsWithRawResponse:
def with_streaming_response(self) -> TokenizationsWithStreamingResponse:
return TokenizationsWithStreamingResponse(self)

def retrieve(
self,
tokenization_token: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TokenizationRetrieveResponse:
"""
Get tokenization

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not tokenization_token:
raise ValueError(f"Expected a non-empty value for `tokenization_token` but received {tokenization_token!r}")
return self._get(
f"/tokenizations/{tokenization_token}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TokenizationRetrieveResponse,
)

def list(
self,
*,
account_token: str | NotGiven = NOT_GIVEN,
begin: Union[str, date] | NotGiven = NOT_GIVEN,
card_token: str | NotGiven = NOT_GIVEN,
end: Union[str, date] | NotGiven = NOT_GIVEN,
ending_before: str | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncCursorPage[Tokenization]:
"""
List card tokenizations

Args:
account_token: Filters for tokenizations associated with a specific account.

begin: Filter for tokenizations created after this date.

card_token: Filters for tokenizations associated with a specific card.

end: Filter for tokenizations created before this date.

ending_before: A cursor representing an item's token before which a page of results should end.
Used to retrieve the previous page of results before this item.

page_size: Page size (for pagination).

starting_after: A cursor representing an item's token after which a page of results should
begin. Used to retrieve the next page of results after this item.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get_api_list(
"/tokenizations",
page=SyncCursorPage[Tokenization],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"account_token": account_token,
"begin": begin,
"card_token": card_token,
"end": end,
"ending_before": ending_before,
"page_size": page_size,
"starting_after": starting_after,
},
tokenization_list_params.TokenizationListParams,
),
),
model=Tokenization,
)

def simulate(
self,
*,
Expand Down Expand Up @@ -106,6 +218,108 @@ def with_raw_response(self) -> AsyncTokenizationsWithRawResponse:
def with_streaming_response(self) -> AsyncTokenizationsWithStreamingResponse:
return AsyncTokenizationsWithStreamingResponse(self)

async def retrieve(
self,
tokenization_token: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TokenizationRetrieveResponse:
"""
Get tokenization

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not tokenization_token:
raise ValueError(f"Expected a non-empty value for `tokenization_token` but received {tokenization_token!r}")
return await self._get(
f"/tokenizations/{tokenization_token}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TokenizationRetrieveResponse,
)

def list(
self,
*,
account_token: str | NotGiven = NOT_GIVEN,
begin: Union[str, date] | NotGiven = NOT_GIVEN,
card_token: str | NotGiven = NOT_GIVEN,
end: Union[str, date] | NotGiven = NOT_GIVEN,
ending_before: str | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[Tokenization, AsyncCursorPage[Tokenization]]:
"""
List card tokenizations

Args:
account_token: Filters for tokenizations associated with a specific account.

begin: Filter for tokenizations created after this date.

card_token: Filters for tokenizations associated with a specific card.

end: Filter for tokenizations created before this date.

ending_before: A cursor representing an item's token before which a page of results should end.
Used to retrieve the previous page of results before this item.

page_size: Page size (for pagination).

starting_after: A cursor representing an item's token after which a page of results should
begin. Used to retrieve the next page of results after this item.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get_api_list(
"/tokenizations",
page=AsyncCursorPage[Tokenization],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"account_token": account_token,
"begin": begin,
"card_token": card_token,
"end": end,
"ending_before": ending_before,
"page_size": page_size,
"starting_after": starting_after,
},
tokenization_list_params.TokenizationListParams,
),
),
model=Tokenization,
)

async def simulate(
self,
*,
Expand Down Expand Up @@ -178,6 +392,12 @@ class TokenizationsWithRawResponse:
def __init__(self, tokenizations: Tokenizations) -> None:
self._tokenizations = tokenizations

self.retrieve = _legacy_response.to_raw_response_wrapper(
tokenizations.retrieve,
)
self.list = _legacy_response.to_raw_response_wrapper(
tokenizations.list,
)
self.simulate = _legacy_response.to_raw_response_wrapper(
tokenizations.simulate,
)
Expand All @@ -187,6 +407,12 @@ class AsyncTokenizationsWithRawResponse:
def __init__(self, tokenizations: AsyncTokenizations) -> None:
self._tokenizations = tokenizations

self.retrieve = _legacy_response.async_to_raw_response_wrapper(
tokenizations.retrieve,
)
self.list = _legacy_response.async_to_raw_response_wrapper(
tokenizations.list,
)
self.simulate = _legacy_response.async_to_raw_response_wrapper(
tokenizations.simulate,
)
Expand All @@ -196,6 +422,12 @@ class TokenizationsWithStreamingResponse:
def __init__(self, tokenizations: Tokenizations) -> None:
self._tokenizations = tokenizations

self.retrieve = to_streamed_response_wrapper(
tokenizations.retrieve,
)
self.list = to_streamed_response_wrapper(
tokenizations.list,
)
self.simulate = to_streamed_response_wrapper(
tokenizations.simulate,
)
Expand All @@ -205,6 +437,12 @@ class AsyncTokenizationsWithStreamingResponse:
def __init__(self, tokenizations: AsyncTokenizations) -> None:
self._tokenizations = tokenizations

self.retrieve = async_to_streamed_response_wrapper(
tokenizations.retrieve,
)
self.list = async_to_streamed_response_wrapper(
tokenizations.list,
)
self.simulate = async_to_streamed_response_wrapper(
tokenizations.simulate,
)
2 changes: 2 additions & 0 deletions src/lithic/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
from .payment_create_response import PaymentCreateResponse as PaymentCreateResponse
from .transaction_list_params import TransactionListParams as TransactionListParams
from .card_program_list_params import CardProgramListParams as CardProgramListParams
from .tokenization_list_params import TokenizationListParams as TokenizationListParams
from .auth_rule_remove_response import AuthRuleRemoveResponse as AuthRuleRemoveResponse
from .card_get_embed_url_params import CardGetEmbedURLParams as CardGetEmbedURLParams
from .card_search_by_pan_params import CardSearchByPanParams as CardSearchByPanParams
Expand All @@ -82,6 +83,7 @@
from .account_holder_resubmit_params import AccountHolderResubmitParams as AccountHolderResubmitParams
from .account_holder_update_response import AccountHolderUpdateResponse as AccountHolderUpdateResponse
from .payment_simulate_return_params import PaymentSimulateReturnParams as PaymentSimulateReturnParams
from .tokenization_retrieve_response import TokenizationRetrieveResponse as TokenizationRetrieveResponse
from .tokenization_simulate_response import TokenizationSimulateResponse as TokenizationSimulateResponse
from .financial_account_create_params import FinancialAccountCreateParams as FinancialAccountCreateParams
from .financial_account_update_params import FinancialAccountUpdateParams as FinancialAccountUpdateParams
Expand Down
Loading