From 1b7b6a3236226bdd7bf7bd00d041a0c0a99f24bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:03:05 +0000 Subject: [PATCH] feat(api): add support for query param include_all_blocks (#301) --- .stats.yml | 2 +- src/orb/resources/customers/credits/credits.py | 16 ++++++++++++++++ .../credit_list_by_external_id_params.py | 3 +++ .../credit_list_by_external_id_response.py | 2 ++ src/orb/types/customers/credit_list_params.py | 3 +++ src/orb/types/customers/credit_list_response.py | 2 ++ tests/api_resources/customers/test_credits.py | 4 ++++ 7 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 020ff6db..bc9671e3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 90 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-2f2e1b9fbe79b0ed97d846a5a26937f421c162e559a2f85a82d7c6e432463f32.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-2ec02cbf3446827f8bbc949216aec29ff745d79c39f1aa1b7ce2289eab0f338f.yml diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py index f2f43bde..4add0e15 100644 --- a/src/orb/resources/customers/credits/credits.py +++ b/src/orb/resources/customers/credits/credits.py @@ -63,6 +63,7 @@ def list( *, currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, + include_all_blocks: bool | NotGiven = NOT_GIVEN, limit: int | 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. @@ -83,6 +84,8 @@ def list( cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. + include_all_blocks: Include all blocks, not just active ones. + limit: The number of items to fetch. Defaults to 20. extra_headers: Send extra headers @@ -107,6 +110,7 @@ def list( { "currency": currency, "cursor": cursor, + "include_all_blocks": include_all_blocks, "limit": limit, }, credit_list_params.CreditListParams, @@ -121,6 +125,7 @@ def list_by_external_id( *, currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, + include_all_blocks: bool | NotGiven = NOT_GIVEN, limit: int | 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. @@ -141,6 +146,8 @@ def list_by_external_id( cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. + include_all_blocks: Include all blocks, not just active ones. + limit: The number of items to fetch. Defaults to 20. extra_headers: Send extra headers @@ -167,6 +174,7 @@ def list_by_external_id( { "currency": currency, "cursor": cursor, + "include_all_blocks": include_all_blocks, "limit": limit, }, credit_list_by_external_id_params.CreditListByExternalIDParams, @@ -199,6 +207,7 @@ def list( *, currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, + include_all_blocks: bool | NotGiven = NOT_GIVEN, limit: int | 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. @@ -219,6 +228,8 @@ def list( cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. + include_all_blocks: Include all blocks, not just active ones. + limit: The number of items to fetch. Defaults to 20. extra_headers: Send extra headers @@ -243,6 +254,7 @@ def list( { "currency": currency, "cursor": cursor, + "include_all_blocks": include_all_blocks, "limit": limit, }, credit_list_params.CreditListParams, @@ -257,6 +269,7 @@ def list_by_external_id( *, currency: Optional[str] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, + include_all_blocks: bool | NotGiven = NOT_GIVEN, limit: int | 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. @@ -277,6 +290,8 @@ def list_by_external_id( cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned from the initial request. + include_all_blocks: Include all blocks, not just active ones. + limit: The number of items to fetch. Defaults to 20. extra_headers: Send extra headers @@ -303,6 +318,7 @@ def list_by_external_id( { "currency": currency, "cursor": cursor, + "include_all_blocks": include_all_blocks, "limit": limit, }, credit_list_by_external_id_params.CreditListByExternalIDParams, diff --git a/src/orb/types/customers/credit_list_by_external_id_params.py b/src/orb/types/customers/credit_list_by_external_id_params.py index b4b3cc5a..b192dc5c 100644 --- a/src/orb/types/customers/credit_list_by_external_id_params.py +++ b/src/orb/types/customers/credit_list_by_external_id_params.py @@ -19,5 +19,8 @@ class CreditListByExternalIDParams(TypedDict, total=False): request. """ + include_all_blocks: bool + """Include all blocks, not just active ones.""" + limit: int """The number of items to fetch. Defaults to 20.""" diff --git a/src/orb/types/customers/credit_list_by_external_id_response.py b/src/orb/types/customers/credit_list_by_external_id_response.py index 7ee5a3d6..d88e900b 100644 --- a/src/orb/types/customers/credit_list_by_external_id_response.py +++ b/src/orb/types/customers/credit_list_by_external_id_response.py @@ -18,6 +18,8 @@ class CreditListByExternalIDResponse(BaseModel): expiry_date: Optional[datetime] = None + maximum_initial_balance: Optional[float] = None + per_unit_cost_basis: Optional[str] = None status: Literal["active", "pending_payment"] diff --git a/src/orb/types/customers/credit_list_params.py b/src/orb/types/customers/credit_list_params.py index 64527331..9e8d7ba7 100644 --- a/src/orb/types/customers/credit_list_params.py +++ b/src/orb/types/customers/credit_list_params.py @@ -19,5 +19,8 @@ class CreditListParams(TypedDict, total=False): request. """ + include_all_blocks: bool + """Include all blocks, not just active ones.""" + limit: int """The number of items to fetch. Defaults to 20.""" diff --git a/src/orb/types/customers/credit_list_response.py b/src/orb/types/customers/credit_list_response.py index 58560b5b..7ccbfcf1 100644 --- a/src/orb/types/customers/credit_list_response.py +++ b/src/orb/types/customers/credit_list_response.py @@ -18,6 +18,8 @@ class CreditListResponse(BaseModel): expiry_date: Optional[datetime] = None + maximum_initial_balance: Optional[float] = None + per_unit_cost_basis: Optional[str] = None status: Literal["active", "pending_payment"] diff --git a/tests/api_resources/customers/test_credits.py b/tests/api_resources/customers/test_credits.py index 85d9b630..04103085 100644 --- a/tests/api_resources/customers/test_credits.py +++ b/tests/api_resources/customers/test_credits.py @@ -34,6 +34,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: "string", currency="string", cursor="string", + include_all_blocks=True, limit=1, ) assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) @@ -82,6 +83,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: "string", currency="string", cursor="string", + include_all_blocks=True, limit=1, ) assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) @@ -134,6 +136,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None "string", currency="string", cursor="string", + include_all_blocks=True, limit=1, ) assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) @@ -182,6 +185,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As "string", currency="string", cursor="string", + include_all_blocks=True, limit=1, ) assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"])