Skip to content

feat(api): add support for query param include_all_blocks #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2024
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 .stats.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions src/orb/resources/customers/credits/credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -107,6 +110,7 @@ def list(
{
"currency": currency,
"cursor": cursor,
"include_all_blocks": include_all_blocks,
"limit": limit,
},
credit_list_params.CreditListParams,
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -243,6 +254,7 @@ def list(
{
"currency": currency,
"cursor": cursor,
"include_all_blocks": include_all_blocks,
"limit": limit,
},
credit_list_params.CreditListParams,
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/orb/types/customers/credit_list_by_external_id_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 3 additions & 0 deletions src/orb/types/customers/credit_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
2 changes: 2 additions & 0 deletions src/orb/types/customers/credit_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 4 additions & 0 deletions tests/api_resources/customers/test_credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down Expand Up @@ -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"])
Expand Down Expand Up @@ -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"])
Expand Down Expand Up @@ -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"])
Expand Down