From cdefb20dd3bddb4c574e0f1eee2933e44312f17f Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Thu, 6 Jul 2023 15:17:30 +0000 Subject: [PATCH] feat(api): add `state` query param for cards --- src/lithic/resources/cards.py | 8 ++++++++ src/lithic/types/card_list_params.py | 5 ++++- tests/api_resources/test_cards.py | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lithic/resources/cards.py b/src/lithic/resources/cards.py index f4852ca2..dcce22ae 100644 --- a/src/lithic/resources/cards.py +++ b/src/lithic/resources/cards.py @@ -335,6 +335,7 @@ def list( end: Union[str, datetime] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + state: Literal["OPEN", "PAUSED", "CLOSED", "PENDING_FULFILLMENT", "PENDING_ACTIVATION"] | 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, @@ -358,6 +359,8 @@ def list( page_size: Page size (for pagination). + state: Returns cards with the specified state. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -381,6 +384,7 @@ def list( "end": end, "page": page, "page_size": page_size, + "state": state, }, card_list_params.CardListParams, ), @@ -1011,6 +1015,7 @@ def list( end: Union[str, datetime] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, + state: Literal["OPEN", "PAUSED", "CLOSED", "PENDING_FULFILLMENT", "PENDING_ACTIVATION"] | 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, @@ -1034,6 +1039,8 @@ def list( page_size: Page size (for pagination). + state: Returns cards with the specified state. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1057,6 +1064,7 @@ def list( "end": end, "page": page, "page_size": page_size, + "state": state, }, card_list_params.CardListParams, ), diff --git a/src/lithic/types/card_list_params.py b/src/lithic/types/card_list_params.py index 001d0796..e3dd2d69 100644 --- a/src/lithic/types/card_list_params.py +++ b/src/lithic/types/card_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -32,3 +32,6 @@ class CardListParams(TypedDict, total=False): page_size: int """Page size (for pagination).""" + + state: Literal["OPEN", "PAUSED", "CLOSED", "PENDING_FULFILLMENT", "PENDING_ACTIVATION"] + """Returns cards with the specified state.""" diff --git a/tests/api_resources/test_cards.py b/tests/api_resources/test_cards.py index 83c9e293..833350ef 100644 --- a/tests/api_resources/test_cards.py +++ b/tests/api_resources/test_cards.py @@ -101,6 +101,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None: end=parse_datetime("2019-12-27T18:11:19.117Z"), page=0, page_size=1, + state="OPEN", ) assert_matches_type(SyncPage[Card], card, path=["response"]) @@ -257,6 +258,7 @@ async def test_method_list_with_all_params(self, client: AsyncLithic) -> None: end=parse_datetime("2019-12-27T18:11:19.117Z"), page=0, page_size=1, + state="OPEN", ) assert_matches_type(AsyncPage[Card], card, path=["response"])