diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4d3070d..c757454 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,12 +1,14 @@
name: CI
on:
push:
- branches-ignore:
- - 'generated'
- - 'codegen/**'
- - 'integrated/**'
- - 'stl-preview-head/**'
- - 'stl-preview-base/**'
+ branches:
+ - '**'
+ - '!integrated/**'
+ - '!stl-preview-head/**'
+ - '!stl-preview-base/**'
+ - '!generated'
+ - '!codegen/**'
+ - 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
@@ -17,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/slash-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
- if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
+ if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
@@ -36,7 +38,7 @@ jobs:
run: ./scripts/lint
build:
- if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
+ if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
@@ -61,14 +63,18 @@ jobs:
run: rye build
- name: Get GitHub OIDC Token
- if: github.repository == 'stainless-sdks/slash-sdk-python'
+ if: |-
+ github.repository == 'stainless-sdks/slash-sdk-python' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());
- name: Upload tarball
- if: github.repository == 'stainless-sdks/slash-sdk-python'
+ if: |-
+ github.repository == 'stainless-sdks/slash-sdk-python' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
diff --git a/.gitignore b/.gitignore
index 95ceb18..3824f4c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
.prism.log
+.stdy.log
_dev
__pycache__
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index aaf968a..b56c3d0 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.3"
+ ".": "0.1.0-alpha.4"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index f2f2901..8292f71 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 55
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/slash-financial--inc-dash%2Fslash-sdk-773c90f079c54155b39d84d7cf37ff7a2b89c74865c56a6cf86db730c36751a2.yml
-openapi_spec_hash: 95129e670c6a3e832a1ea3fc64c07b11
+configured_endpoints: 52
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/slash-financial--inc-dash%2Fslash-sdk-7f31a3be697a2cfed2f8a155edafa048098dcdcd00c9a562ac1e0067d2518be3.yml
+openapi_spec_hash: 639ee7b20e3b634d76def08e5c65656e
config_hash: 9a5c338a583a0bc1a2e798ec5b94d860
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d8563dd..aace143 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,32 @@
# Changelog
+## 0.1.0-alpha.4 (2026-04-02)
+
+Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/slashfi/slash-sdk-python/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
+
+### Features
+
+* **api:** api update ([f1eff44](https://github.com/slashfi/slash-sdk-python/commit/f1eff440f3ef4ed6a0495ccba3ecd7826d862c9c))
+* **api:** api update ([47ea2de](https://github.com/slashfi/slash-sdk-python/commit/47ea2de42a4430641a44e10101e79693cfa94ba4))
+* **api:** api update ([403ce72](https://github.com/slashfi/slash-sdk-python/commit/403ce72fe8450996c6eec0b12d18605d6fd1ba10))
+* **api:** api update ([68fa0ae](https://github.com/slashfi/slash-sdk-python/commit/68fa0aeac982ca051911fb116fc585f60ec8d3b5))
+* **internal:** implement indices array format for query and form serialization ([2a9632f](https://github.com/slashfi/slash-sdk-python/commit/2a9632fd3fd8c3e7689f72bdf27db90b106adf20))
+
+
+### Bug Fixes
+
+* **deps:** bump minimum typing-extensions version ([acdef8e](https://github.com/slashfi/slash-sdk-python/commit/acdef8e72361b2a7b24485d67f68e357c48de380))
+* **pydantic:** do not pass `by_alias` unless set ([2d11f9b](https://github.com/slashfi/slash-sdk-python/commit/2d11f9b1903e6f454ebb23e1141ebaa03373cfb6))
+* sanitize endpoint path params ([509a588](https://github.com/slashfi/slash-sdk-python/commit/509a588cf24e5549ea16f55a4c178a1b9a221935))
+
+
+### Chores
+
+* **ci:** skip lint on metadata-only changes ([a37ad05](https://github.com/slashfi/slash-sdk-python/commit/a37ad0591c6a413ce5957904697c8db606af4c3d))
+* **ci:** skip uploading artifacts on stainless-internal branches ([59a7a78](https://github.com/slashfi/slash-sdk-python/commit/59a7a78b6e534d5e3acb42824220a1e11c9c3a60))
+* **internal:** tweak CI branches ([504ef27](https://github.com/slashfi/slash-sdk-python/commit/504ef27f0aab30e84c40a2f08d89eda3085d7547))
+* **internal:** update gitignore ([0d40ada](https://github.com/slashfi/slash-sdk-python/commit/0d40adadd47ddc74051495812222415aeb254f72))
+
## 0.1.0-alpha.3 (2026-03-06)
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/slashfi/slash-sdk-python/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
diff --git a/api.md b/api.md
index 3f8e5fd..f185e28 100644
--- a/api.md
+++ b/api.md
@@ -146,31 +146,6 @@ Methods:
- client.card_product.list(\*\*params) -> CardProductListResponse
-# SlashHandle
-
-Types:
-
-```python
-from slash_sdk.types import SlashHandleListResponse
-```
-
-Methods:
-
-- client.slash_handle.list(\*\*params) -> SlashHandleListResponse
-
-# Pay
-
-Types:
-
-```python
-from slash_sdk.types import SlashHandle, PaySendResponse
-```
-
-Methods:
-
-- client.pay.retrieve() -> SlashHandle
-- client.pay.send(\*\*params) -> PaySendResponse
-
# Webhook
Types:
diff --git a/pyproject.toml b/pyproject.toml
index 7be5265..93266de 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "slash-sdk"
-version = "0.1.0-alpha.3"
+version = "0.1.0-alpha.4"
description = "The official Python library for the slash-sdk API"
dynamic = ["readme"]
license = "Apache-2.0"
@@ -11,7 +11,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
- "typing-extensions>=4.10, <5",
+ "typing-extensions>=4.14, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
diff --git a/src/slash_sdk/_client.py b/src/slash_sdk/_client.py
index 6df78c0..b3e8e61 100644
--- a/src/slash_sdk/_client.py
+++ b/src/slash_sdk/_client.py
@@ -35,7 +35,6 @@
if TYPE_CHECKING:
from .resources import (
fdx,
- pay,
card,
crypto,
oauth2,
@@ -48,13 +47,11 @@
transaction,
card_product,
legal_entity,
- slash_handle,
virtual_account,
developer_account,
merchant_category,
developer_application,
)
- from .resources.pay import PayResource, AsyncPayResource
from .resources.crypto import CryptoResource, AsyncCryptoResource
from .resources.account import AccountResource, AsyncAccountResource
from .resources.fdx.fdx import FdxResource, AsyncFdxResource
@@ -66,7 +63,6 @@
from .resources.transaction import TransactionResource, AsyncTransactionResource
from .resources.card_product import CardProductResource, AsyncCardProductResource
from .resources.legal_entity import LegalEntityResource, AsyncLegalEntityResource
- from .resources.slash_handle import SlashHandleResource, AsyncSlashHandleResource
from .resources.oauth2.oauth2 import Oauth2Resource, AsyncOauth2Resource
from .resources.virtual_account import VirtualAccountResource, AsyncVirtualAccountResource
from .resources.developer_account import DeveloperAccountResource, AsyncDeveloperAccountResource
@@ -207,18 +203,6 @@ def card_product(self) -> CardProductResource:
return CardProductResource(self)
- @cached_property
- def slash_handle(self) -> SlashHandleResource:
- from .resources.slash_handle import SlashHandleResource
-
- return SlashHandleResource(self)
-
- @cached_property
- def pay(self) -> PayResource:
- from .resources.pay import PayResource
-
- return PayResource(self)
-
@cached_property
def webhook(self) -> WebhookResource:
from .resources.webhook import WebhookResource
@@ -548,18 +532,6 @@ def card_product(self) -> AsyncCardProductResource:
return AsyncCardProductResource(self)
- @cached_property
- def slash_handle(self) -> AsyncSlashHandleResource:
- from .resources.slash_handle import AsyncSlashHandleResource
-
- return AsyncSlashHandleResource(self)
-
- @cached_property
- def pay(self) -> AsyncPayResource:
- from .resources.pay import AsyncPayResource
-
- return AsyncPayResource(self)
-
@cached_property
def webhook(self) -> AsyncWebhookResource:
from .resources.webhook import AsyncWebhookResource
@@ -822,18 +794,6 @@ def card_product(self) -> card_product.CardProductResourceWithRawResponse:
return CardProductResourceWithRawResponse(self._client.card_product)
- @cached_property
- def slash_handle(self) -> slash_handle.SlashHandleResourceWithRawResponse:
- from .resources.slash_handle import SlashHandleResourceWithRawResponse
-
- return SlashHandleResourceWithRawResponse(self._client.slash_handle)
-
- @cached_property
- def pay(self) -> pay.PayResourceWithRawResponse:
- from .resources.pay import PayResourceWithRawResponse
-
- return PayResourceWithRawResponse(self._client.pay)
-
@cached_property
def webhook(self) -> webhook.WebhookResourceWithRawResponse:
from .resources.webhook import WebhookResourceWithRawResponse
@@ -943,18 +903,6 @@ def card_product(self) -> card_product.AsyncCardProductResourceWithRawResponse:
return AsyncCardProductResourceWithRawResponse(self._client.card_product)
- @cached_property
- def slash_handle(self) -> slash_handle.AsyncSlashHandleResourceWithRawResponse:
- from .resources.slash_handle import AsyncSlashHandleResourceWithRawResponse
-
- return AsyncSlashHandleResourceWithRawResponse(self._client.slash_handle)
-
- @cached_property
- def pay(self) -> pay.AsyncPayResourceWithRawResponse:
- from .resources.pay import AsyncPayResourceWithRawResponse
-
- return AsyncPayResourceWithRawResponse(self._client.pay)
-
@cached_property
def webhook(self) -> webhook.AsyncWebhookResourceWithRawResponse:
from .resources.webhook import AsyncWebhookResourceWithRawResponse
@@ -1064,18 +1012,6 @@ def card_product(self) -> card_product.CardProductResourceWithStreamingResponse:
return CardProductResourceWithStreamingResponse(self._client.card_product)
- @cached_property
- def slash_handle(self) -> slash_handle.SlashHandleResourceWithStreamingResponse:
- from .resources.slash_handle import SlashHandleResourceWithStreamingResponse
-
- return SlashHandleResourceWithStreamingResponse(self._client.slash_handle)
-
- @cached_property
- def pay(self) -> pay.PayResourceWithStreamingResponse:
- from .resources.pay import PayResourceWithStreamingResponse
-
- return PayResourceWithStreamingResponse(self._client.pay)
-
@cached_property
def webhook(self) -> webhook.WebhookResourceWithStreamingResponse:
from .resources.webhook import WebhookResourceWithStreamingResponse
@@ -1185,18 +1121,6 @@ def card_product(self) -> card_product.AsyncCardProductResourceWithStreamingResp
return AsyncCardProductResourceWithStreamingResponse(self._client.card_product)
- @cached_property
- def slash_handle(self) -> slash_handle.AsyncSlashHandleResourceWithStreamingResponse:
- from .resources.slash_handle import AsyncSlashHandleResourceWithStreamingResponse
-
- return AsyncSlashHandleResourceWithStreamingResponse(self._client.slash_handle)
-
- @cached_property
- def pay(self) -> pay.AsyncPayResourceWithStreamingResponse:
- from .resources.pay import AsyncPayResourceWithStreamingResponse
-
- return AsyncPayResourceWithStreamingResponse(self._client.pay)
-
@cached_property
def webhook(self) -> webhook.AsyncWebhookResourceWithStreamingResponse:
from .resources.webhook import AsyncWebhookResourceWithStreamingResponse
diff --git a/src/slash_sdk/_compat.py b/src/slash_sdk/_compat.py
index 786ff42..e6690a4 100644
--- a/src/slash_sdk/_compat.py
+++ b/src/slash_sdk/_compat.py
@@ -2,7 +2,7 @@
from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
from datetime import date, datetime
-from typing_extensions import Self, Literal
+from typing_extensions import Self, Literal, TypedDict
import pydantic
from pydantic.fields import FieldInfo
@@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
return model.model_dump_json(indent=indent)
+class _ModelDumpKwargs(TypedDict, total=False):
+ by_alias: bool
+
+
def model_dump(
model: pydantic.BaseModel,
*,
@@ -142,6 +146,9 @@ def model_dump(
by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
+ kwargs: _ModelDumpKwargs = {}
+ if by_alias is not None:
+ kwargs["by_alias"] = by_alias
return model.model_dump(
mode=mode,
exclude=exclude,
@@ -149,7 +156,7 @@ def model_dump(
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
- by_alias=by_alias,
+ **kwargs,
)
return cast(
"dict[str, Any]",
diff --git a/src/slash_sdk/_qs.py b/src/slash_sdk/_qs.py
index ada6fd3..de8c99b 100644
--- a/src/slash_sdk/_qs.py
+++ b/src/slash_sdk/_qs.py
@@ -101,7 +101,10 @@ def _stringify_item(
items.extend(self._stringify_item(key, item, opts))
return items
elif array_format == "indices":
- raise NotImplementedError("The array indices format is not supported yet")
+ items = []
+ for i, item in enumerate(value):
+ items.extend(self._stringify_item(f"{key}[{i}]", item, opts))
+ return items
elif array_format == "brackets":
items = []
key = key + "[]"
diff --git a/src/slash_sdk/_utils/__init__.py b/src/slash_sdk/_utils/__init__.py
index dc64e29..10cb66d 100644
--- a/src/slash_sdk/_utils/__init__.py
+++ b/src/slash_sdk/_utils/__init__.py
@@ -1,3 +1,4 @@
+from ._path import path_template as path_template
from ._sync import asyncify as asyncify
from ._proxy import LazyProxy as LazyProxy
from ._utils import (
diff --git a/src/slash_sdk/_utils/_path.py b/src/slash_sdk/_utils/_path.py
new file mode 100644
index 0000000..4d6e1e4
--- /dev/null
+++ b/src/slash_sdk/_utils/_path.py
@@ -0,0 +1,127 @@
+from __future__ import annotations
+
+import re
+from typing import (
+ Any,
+ Mapping,
+ Callable,
+)
+from urllib.parse import quote
+
+# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E).
+_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$")
+
+_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}")
+
+
+def _quote_path_segment_part(value: str) -> str:
+ """Percent-encode `value` for use in a URI path segment.
+
+ Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe.
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
+ """
+ # quote() already treats unreserved characters (letters, digits, and -._~)
+ # as safe, so we only need to add sub-delims, ':', and '@'.
+ # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted.
+ return quote(value, safe="!$&'()*+,;=:@")
+
+
+def _quote_query_part(value: str) -> str:
+ """Percent-encode `value` for use in a URI query string.
+
+ Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe.
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
+ """
+ return quote(value, safe="!$'()*+,;:@/?")
+
+
+def _quote_fragment_part(value: str) -> str:
+ """Percent-encode `value` for use in a URI fragment.
+
+ Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe.
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
+ """
+ return quote(value, safe="!$&'()*+,;=:@/?")
+
+
+def _interpolate(
+ template: str,
+ values: Mapping[str, Any],
+ quoter: Callable[[str], str],
+) -> str:
+ """Replace {name} placeholders in `template`, quoting each value with `quoter`.
+
+ Placeholder names are looked up in `values`.
+
+ Raises:
+ KeyError: If a placeholder is not found in `values`.
+ """
+ # re.split with a capturing group returns alternating
+ # [text, name, text, name, ..., text] elements.
+ parts = _PLACEHOLDER_RE.split(template)
+
+ for i in range(1, len(parts), 2):
+ name = parts[i]
+ if name not in values:
+ raise KeyError(f"a value for placeholder {{{name}}} was not provided")
+ val = values[name]
+ if val is None:
+ parts[i] = "null"
+ elif isinstance(val, bool):
+ parts[i] = "true" if val else "false"
+ else:
+ parts[i] = quoter(str(values[name]))
+
+ return "".join(parts)
+
+
+def path_template(template: str, /, **kwargs: Any) -> str:
+ """Interpolate {name} placeholders in `template` from keyword arguments.
+
+ Args:
+ template: The template string containing {name} placeholders.
+ **kwargs: Keyword arguments to interpolate into the template.
+
+ Returns:
+ The template with placeholders interpolated and percent-encoded.
+
+ Safe characters for percent-encoding are dependent on the URI component.
+ Placeholders in path and fragment portions are percent-encoded where the `segment`
+ and `fragment` sets from RFC 3986 respectively are considered safe.
+ Placeholders in the query portion are percent-encoded where the `query` set from
+ RFC 3986 §3.3 is considered safe except for = and & characters.
+
+ Raises:
+ KeyError: If a placeholder is not found in `kwargs`.
+ ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments).
+ """
+ # Split the template into path, query, and fragment portions.
+ fragment_template: str | None = None
+ query_template: str | None = None
+
+ rest = template
+ if "#" in rest:
+ rest, fragment_template = rest.split("#", 1)
+ if "?" in rest:
+ rest, query_template = rest.split("?", 1)
+ path_template = rest
+
+ # Interpolate each portion with the appropriate quoting rules.
+ path_result = _interpolate(path_template, kwargs, _quote_path_segment_part)
+
+ # Reject dot-segments (. and ..) in the final assembled path. The check
+ # runs after interpolation so that adjacent placeholders or a mix of static
+ # text and placeholders that together form a dot-segment are caught.
+ # Also reject percent-encoded dot-segments to protect against incorrectly
+ # implemented normalization in servers/proxies.
+ for segment in path_result.split("/"):
+ if _DOT_SEGMENT_RE.match(segment):
+ raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed")
+
+ result = path_result
+ if query_template is not None:
+ result += "?" + _interpolate(query_template, kwargs, _quote_query_part)
+ if fragment_template is not None:
+ result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part)
+
+ return result
diff --git a/src/slash_sdk/_version.py b/src/slash_sdk/_version.py
index bfe6468..4ffe448 100644
--- a/src/slash_sdk/_version.py
+++ b/src/slash_sdk/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "slash_sdk"
-__version__ = "0.1.0-alpha.3" # x-release-please-version
+__version__ = "0.1.0-alpha.4" # x-release-please-version
diff --git a/src/slash_sdk/resources/__init__.py b/src/slash_sdk/resources/__init__.py
index 30052e3..e33636b 100644
--- a/src/slash_sdk/resources/__init__.py
+++ b/src/slash_sdk/resources/__init__.py
@@ -8,14 +8,6 @@
FdxResourceWithStreamingResponse,
AsyncFdxResourceWithStreamingResponse,
)
-from .pay import (
- PayResource,
- AsyncPayResource,
- PayResourceWithRawResponse,
- AsyncPayResourceWithRawResponse,
- PayResourceWithStreamingResponse,
- AsyncPayResourceWithStreamingResponse,
-)
from .card import (
CardResource,
AsyncCardResource,
@@ -112,14 +104,6 @@
LegalEntityResourceWithStreamingResponse,
AsyncLegalEntityResourceWithStreamingResponse,
)
-from .slash_handle import (
- SlashHandleResource,
- AsyncSlashHandleResource,
- SlashHandleResourceWithRawResponse,
- AsyncSlashHandleResourceWithRawResponse,
- SlashHandleResourceWithStreamingResponse,
- AsyncSlashHandleResourceWithStreamingResponse,
-)
from .virtual_account import (
VirtualAccountResource,
AsyncVirtualAccountResource,
@@ -202,18 +186,6 @@
"AsyncCardProductResourceWithRawResponse",
"CardProductResourceWithStreamingResponse",
"AsyncCardProductResourceWithStreamingResponse",
- "SlashHandleResource",
- "AsyncSlashHandleResource",
- "SlashHandleResourceWithRawResponse",
- "AsyncSlashHandleResourceWithRawResponse",
- "SlashHandleResourceWithStreamingResponse",
- "AsyncSlashHandleResourceWithStreamingResponse",
- "PayResource",
- "AsyncPayResource",
- "PayResourceWithRawResponse",
- "AsyncPayResourceWithRawResponse",
- "PayResourceWithStreamingResponse",
- "AsyncPayResourceWithStreamingResponse",
"WebhookResource",
"AsyncWebhookResource",
"WebhookResourceWithRawResponse",
diff --git a/src/slash_sdk/resources/account.py b/src/slash_sdk/resources/account.py
index 3e28203..c61c47c 100644
--- a/src/slash_sdk/resources/account.py
+++ b/src/slash_sdk/resources/account.py
@@ -6,7 +6,7 @@
from ..types import account_list_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import maybe_transform, async_maybe_transform
+from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -69,7 +69,7 @@ def retrieve(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/account/{account_id}",
+ path_template("/account/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -146,7 +146,7 @@ def retrieve_balance(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/account/{account_id}/balance",
+ path_template("/account/{account_id}/balance", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -200,7 +200,7 @@ async def retrieve(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/account/{account_id}",
+ path_template("/account/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -277,7 +277,7 @@ async def retrieve_balance(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/account/{account_id}/balance",
+ path_template("/account/{account_id}/balance", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/slash_sdk/resources/card/card.py b/src/slash_sdk/resources/card/card.py
index 9dd53d1..6af6684 100644
--- a/src/slash_sdk/resources/card/card.py
+++ b/src/slash_sdk/resources/card/card.py
@@ -9,7 +9,7 @@
from ...types import CardStatus, card_list_params, card_create_params, card_update_params, card_retrieve_params
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -165,7 +165,7 @@ def retrieve(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return self._get(
- f"/card/{card_id}",
+ path_template("/card/{card_id}", card_id=card_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -221,7 +221,7 @@ def update(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return self._patch(
- f"/card/{card_id}",
+ path_template("/card/{card_id}", card_id=card_id),
body=maybe_transform(
{
"card_group_id": card_group_id,
@@ -246,6 +246,7 @@ def list(
filter_card_group_id: str | Omit = omit,
filter_card_group_name: str | Omit = omit,
filter_legal_entity_id: str | Omit = omit,
+ filter_modifier: str | Omit = omit,
filter_status: Literal["active", "paused", "closed", "inactive"] | Omit = omit,
filter_virtual_account_id: str | Omit = omit,
sort: Literal["createdAt", "name"] | Omit = omit,
@@ -274,6 +275,10 @@ def list(
filter_legal_entity_id: Pass in a legal entity ID to filter for cards in accounts under a specific legal
entity.
+ filter_modifier: Filter cards by modifier. Format is "modifier_name:value" (e.g.,
+ "only_allow_recurring_payments:true"). Returns cards where the specified
+ modifier has the given value.
+
filter_status: Returns all cards matching the status passed in.
filter_virtual_account_id: Pass in a virtual account ID to filter for cards under a specific virtual
@@ -305,6 +310,7 @@ def list(
"filter_card_group_id": filter_card_group_id,
"filter_card_group_name": filter_card_group_name,
"filter_legal_entity_id": filter_legal_entity_id,
+ "filter_modifier": filter_modifier,
"filter_status": filter_status,
"filter_virtual_account_id": filter_virtual_account_id,
"sort": sort,
@@ -342,7 +348,7 @@ def get_utilization(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return self._get(
- f"/card/{card_id}/utilization",
+ path_template("/card/{card_id}/utilization", card_id=card_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -479,7 +485,7 @@ async def retrieve(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return await self._get(
- f"/card/{card_id}",
+ path_template("/card/{card_id}", card_id=card_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -535,7 +541,7 @@ async def update(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return await self._patch(
- f"/card/{card_id}",
+ path_template("/card/{card_id}", card_id=card_id),
body=await async_maybe_transform(
{
"card_group_id": card_group_id,
@@ -560,6 +566,7 @@ async def list(
filter_card_group_id: str | Omit = omit,
filter_card_group_name: str | Omit = omit,
filter_legal_entity_id: str | Omit = omit,
+ filter_modifier: str | Omit = omit,
filter_status: Literal["active", "paused", "closed", "inactive"] | Omit = omit,
filter_virtual_account_id: str | Omit = omit,
sort: Literal["createdAt", "name"] | Omit = omit,
@@ -588,6 +595,10 @@ async def list(
filter_legal_entity_id: Pass in a legal entity ID to filter for cards in accounts under a specific legal
entity.
+ filter_modifier: Filter cards by modifier. Format is "modifier_name:value" (e.g.,
+ "only_allow_recurring_payments:true"). Returns cards where the specified
+ modifier has the given value.
+
filter_status: Returns all cards matching the status passed in.
filter_virtual_account_id: Pass in a virtual account ID to filter for cards under a specific virtual
@@ -619,6 +630,7 @@ async def list(
"filter_card_group_id": filter_card_group_id,
"filter_card_group_name": filter_card_group_name,
"filter_legal_entity_id": filter_legal_entity_id,
+ "filter_modifier": filter_modifier,
"filter_status": filter_status,
"filter_virtual_account_id": filter_virtual_account_id,
"sort": sort,
@@ -656,7 +668,7 @@ async def get_utilization(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return await self._get(
- f"/card/{card_id}/utilization",
+ path_template("/card/{card_id}/utilization", card_id=card_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/slash_sdk/resources/card/spending_constraint.py b/src/slash_sdk/resources/card/spending_constraint.py
index 9e43f11..30110ec 100644
--- a/src/slash_sdk/resources/card/spending_constraint.py
+++ b/src/slash_sdk/resources/card/spending_constraint.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -75,7 +75,7 @@ def update_full(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return self._put(
- f"/card/{card_id}/spending-constraint",
+ path_template("/card/{card_id}/spending-constraint", card_id=card_id),
body=maybe_transform(
{
"country_rule": country_rule,
@@ -126,7 +126,7 @@ def update_partial(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return self._patch(
- f"/card/{card_id}/spending-constraint",
+ path_template("/card/{card_id}/spending-constraint", card_id=card_id),
body=maybe_transform(
{
"country_rule": country_rule,
@@ -196,7 +196,7 @@ async def update_full(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return await self._put(
- f"/card/{card_id}/spending-constraint",
+ path_template("/card/{card_id}/spending-constraint", card_id=card_id),
body=await async_maybe_transform(
{
"country_rule": country_rule,
@@ -247,7 +247,7 @@ async def update_partial(
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return await self._patch(
- f"/card/{card_id}/spending-constraint",
+ path_template("/card/{card_id}/spending-constraint", card_id=card_id),
body=await async_maybe_transform(
{
"country_rule": country_rule,
diff --git a/src/slash_sdk/resources/card_group/card_group.py b/src/slash_sdk/resources/card_group/card_group.py
index beabdb1..9702f8a 100644
--- a/src/slash_sdk/resources/card_group/card_group.py
+++ b/src/slash_sdk/resources/card_group/card_group.py
@@ -9,7 +9,7 @@
from ...types import card_group_list_params, card_group_create_params, card_group_update_params
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -131,7 +131,7 @@ def retrieve(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return self._get(
- f"/card-group/{card_group_id}",
+ path_template("/card-group/{card_group_id}", card_group_id=card_group_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -169,7 +169,7 @@ def update(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return self._patch(
- f"/card-group/{card_group_id}",
+ path_template("/card-group/{card_group_id}", card_group_id=card_group_id),
body=maybe_transform(
{
"name": name,
@@ -264,7 +264,7 @@ def get_utilization(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return self._get(
- f"/card-group/{card_group_id}/utilization",
+ path_template("/card-group/{card_group_id}/utilization", card_group_id=card_group_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -368,7 +368,7 @@ async def retrieve(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return await self._get(
- f"/card-group/{card_group_id}",
+ path_template("/card-group/{card_group_id}", card_group_id=card_group_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -406,7 +406,7 @@ async def update(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return await self._patch(
- f"/card-group/{card_group_id}",
+ path_template("/card-group/{card_group_id}", card_group_id=card_group_id),
body=await async_maybe_transform(
{
"name": name,
@@ -501,7 +501,7 @@ async def get_utilization(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return await self._get(
- f"/card-group/{card_group_id}/utilization",
+ path_template("/card-group/{card_group_id}/utilization", card_group_id=card_group_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/slash_sdk/resources/card_group/spending_constraint.py b/src/slash_sdk/resources/card_group/spending_constraint.py
index 5041d30..035ff19 100644
--- a/src/slash_sdk/resources/card_group/spending_constraint.py
+++ b/src/slash_sdk/resources/card_group/spending_constraint.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -75,7 +75,7 @@ def update_full(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return self._put(
- f"/card-group/{card_group_id}/spending-constraint",
+ path_template("/card-group/{card_group_id}/spending-constraint", card_group_id=card_group_id),
body=maybe_transform(
{
"country_rule": country_rule,
@@ -126,7 +126,7 @@ def update_partial(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return self._patch(
- f"/card-group/{card_group_id}/spending-constraint",
+ path_template("/card-group/{card_group_id}/spending-constraint", card_group_id=card_group_id),
body=maybe_transform(
{
"country_rule": country_rule,
@@ -196,7 +196,7 @@ async def update_full(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return await self._put(
- f"/card-group/{card_group_id}/spending-constraint",
+ path_template("/card-group/{card_group_id}/spending-constraint", card_group_id=card_group_id),
body=await async_maybe_transform(
{
"country_rule": country_rule,
@@ -247,7 +247,7 @@ async def update_partial(
if not card_group_id:
raise ValueError(f"Expected a non-empty value for `card_group_id` but received {card_group_id!r}")
return await self._patch(
- f"/card-group/{card_group_id}/spending-constraint",
+ path_template("/card-group/{card_group_id}/spending-constraint", card_group_id=card_group_id),
body=await async_maybe_transform(
{
"country_rule": country_rule,
diff --git a/src/slash_sdk/resources/developer_account.py b/src/slash_sdk/resources/developer_account.py
index b8f031f..a3a29c6 100644
--- a/src/slash_sdk/resources/developer_account.py
+++ b/src/slash_sdk/resources/developer_account.py
@@ -6,7 +6,7 @@
from ..types import DeveloperApplicationType, developer_account_create_application_params
from .._types import Body, Query, Headers, NotGiven, not_given
-from .._utils import maybe_transform, async_maybe_transform
+from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -74,7 +74,9 @@ def create_application(
f"Expected a non-empty value for `developer_account_id` but received {developer_account_id!r}"
)
return self._post(
- f"/developer-account/{developer_account_id}/application",
+ path_template(
+ "/developer-account/{developer_account_id}/application", developer_account_id=developer_account_id
+ ),
body=maybe_transform(
{
"data": data,
@@ -141,7 +143,9 @@ async def create_application(
f"Expected a non-empty value for `developer_account_id` but received {developer_account_id!r}"
)
return await self._post(
- f"/developer-account/{developer_account_id}/application",
+ path_template(
+ "/developer-account/{developer_account_id}/application", developer_account_id=developer_account_id
+ ),
body=await async_maybe_transform(
{
"data": data,
diff --git a/src/slash_sdk/resources/developer_application.py b/src/slash_sdk/resources/developer_application.py
index e46610e..5b046f1 100644
--- a/src/slash_sdk/resources/developer_application.py
+++ b/src/slash_sdk/resources/developer_application.py
@@ -6,7 +6,7 @@
from ..types import developer_application_update_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import maybe_transform, async_maybe_transform
+from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -70,7 +70,9 @@ def retrieve(
f"Expected a non-empty value for `developer_application_id` but received {developer_application_id!r}"
)
return self._get(
- f"/developer-application/{developer_application_id}",
+ path_template(
+ "/developer-application/{developer_application_id}", developer_application_id=developer_application_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -107,7 +109,9 @@ def update(
f"Expected a non-empty value for `developer_application_id` but received {developer_application_id!r}"
)
return self._patch(
- f"/developer-application/{developer_application_id}",
+ path_template(
+ "/developer-application/{developer_application_id}", developer_application_id=developer_application_id
+ ),
body=maybe_transform(
{
"data": data,
@@ -149,7 +153,10 @@ def create_or_regenerate_secret(
f"Expected a non-empty value for `developer_application_id` but received {developer_application_id!r}"
)
return self._post(
- f"/developer-application/{developer_application_id}/secret",
+ path_template(
+ "/developer-application/{developer_application_id}/secret",
+ developer_application_id=developer_application_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -205,7 +212,9 @@ async def retrieve(
f"Expected a non-empty value for `developer_application_id` but received {developer_application_id!r}"
)
return await self._get(
- f"/developer-application/{developer_application_id}",
+ path_template(
+ "/developer-application/{developer_application_id}", developer_application_id=developer_application_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -242,7 +251,9 @@ async def update(
f"Expected a non-empty value for `developer_application_id` but received {developer_application_id!r}"
)
return await self._patch(
- f"/developer-application/{developer_application_id}",
+ path_template(
+ "/developer-application/{developer_application_id}", developer_application_id=developer_application_id
+ ),
body=await async_maybe_transform(
{
"data": data,
@@ -284,7 +295,10 @@ async def create_or_regenerate_secret(
f"Expected a non-empty value for `developer_application_id` but received {developer_application_id!r}"
)
return await self._post(
- f"/developer-application/{developer_application_id}/secret",
+ path_template(
+ "/developer-application/{developer_application_id}/secret",
+ developer_application_id=developer_application_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/slash_sdk/resources/fdx/accounts/accounts.py b/src/slash_sdk/resources/fdx/accounts/accounts.py
index 232b565..ac4bd96 100644
--- a/src/slash_sdk/resources/fdx/accounts/accounts.py
+++ b/src/slash_sdk/resources/fdx/accounts/accounts.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from .statements import (
StatementsResource,
@@ -91,7 +91,7 @@ def retrieve(
return cast(
AccountRetrieveResponse,
self._get(
- f"/fdx/accounts/{account_id}",
+ path_template("/fdx/accounts/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -185,7 +185,7 @@ def list_transactions(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/fdx/accounts/{account_id}/transactions",
+ path_template("/fdx/accounts/{account_id}/transactions", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -230,7 +230,7 @@ def retrieve_contact(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/fdx/accounts/{account_id}/contact",
+ path_template("/fdx/accounts/{account_id}/contact", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -269,7 +269,7 @@ def retrieve_payment_networks(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/fdx/accounts/{account_id}/payment-networks",
+ path_template("/fdx/accounts/{account_id}/payment-networks", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -339,7 +339,7 @@ async def retrieve(
return cast(
AccountRetrieveResponse,
await self._get(
- f"/fdx/accounts/{account_id}",
+ path_template("/fdx/accounts/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -433,7 +433,7 @@ async def list_transactions(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/fdx/accounts/{account_id}/transactions",
+ path_template("/fdx/accounts/{account_id}/transactions", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -478,7 +478,7 @@ async def retrieve_contact(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/fdx/accounts/{account_id}/contact",
+ path_template("/fdx/accounts/{account_id}/contact", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -517,7 +517,7 @@ async def retrieve_payment_networks(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/fdx/accounts/{account_id}/payment-networks",
+ path_template("/fdx/accounts/{account_id}/payment-networks", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/slash_sdk/resources/fdx/accounts/statements.py b/src/slash_sdk/resources/fdx/accounts/statements.py
index d18fbc7..5abbf9a 100644
--- a/src/slash_sdk/resources/fdx/accounts/statements.py
+++ b/src/slash_sdk/resources/fdx/accounts/statements.py
@@ -5,7 +5,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -87,7 +87,7 @@ def list(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/fdx/accounts/{account_id}/statements",
+ path_template("/fdx/accounts/{account_id}/statements", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -136,7 +136,9 @@ def retrieve_pdf(
raise ValueError(f"Expected a non-empty value for `statement_id` but received {statement_id!r}")
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
return self._get(
- f"/fdx/accounts/{account_id}/statements/{statement_id}",
+ path_template(
+ "/fdx/accounts/{account_id}/statements/{statement_id}", account_id=account_id, statement_id=statement_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -202,7 +204,7 @@ async def list(
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/fdx/accounts/{account_id}/statements",
+ path_template("/fdx/accounts/{account_id}/statements", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -251,7 +253,9 @@ async def retrieve_pdf(
raise ValueError(f"Expected a non-empty value for `statement_id` but received {statement_id!r}")
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
return await self._get(
- f"/fdx/accounts/{account_id}/statements/{statement_id}",
+ path_template(
+ "/fdx/accounts/{account_id}/statements/{statement_id}", account_id=account_id, statement_id=statement_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/slash_sdk/resources/merchant.py b/src/slash_sdk/resources/merchant.py
index eed3bd4..a8ff825 100644
--- a/src/slash_sdk/resources/merchant.py
+++ b/src/slash_sdk/resources/merchant.py
@@ -6,7 +6,7 @@
from ..types import merchant_list_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import maybe_transform, async_maybe_transform
+from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -68,7 +68,7 @@ def retrieve(
if not merchant_id:
raise ValueError(f"Expected a non-empty value for `merchant_id` but received {merchant_id!r}")
return self._get(
- f"/merchant/{merchant_id}",
+ path_template("/merchant/{merchant_id}", merchant_id=merchant_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -168,7 +168,7 @@ async def retrieve(
if not merchant_id:
raise ValueError(f"Expected a non-empty value for `merchant_id` but received {merchant_id!r}")
return await self._get(
- f"/merchant/{merchant_id}",
+ path_template("/merchant/{merchant_id}", merchant_id=merchant_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/slash_sdk/resources/pay.py b/src/slash_sdk/resources/pay.py
deleted file mode 100644
index c8bbc12..0000000
--- a/src/slash_sdk/resources/pay.py
+++ /dev/null
@@ -1,270 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Any, cast
-
-import httpx
-
-from ..types import pay_send_params
-from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import maybe_transform, async_maybe_transform
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-from ..types.slash_handle import SlashHandle
-from ..types.pay_send_response import PaySendResponse
-
-__all__ = ["PayResource", "AsyncPayResource"]
-
-
-class PayResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> PayResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#accessing-raw-response-data-eg-headers
- """
- return PayResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> PayResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#with_streaming_response
- """
- return PayResourceWithStreamingResponse(self)
-
- def retrieve(
- self,
- *,
- # 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,
- ) -> SlashHandle:
- """Retrieve your pay by slash information."""
- return self._get(
- "/pay",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=SlashHandle,
- )
-
- def send(
- self,
- *,
- amount_cents: float,
- slash_handle: str,
- legal_entity_id: str | Omit = omit,
- source_slash_handle_id: str | Omit = omit,
- # 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,
- ) -> PaySendResponse:
- """
- Send money to a slash handle
-
- Args:
- amount_cents: The amount of money to send in cents.
-
- slash_handle: The username of the SlashHandle to send money to. You can get this by asking
- your recipient for their SlashHandle.
-
- legal_entity_id: The ID of the LegalEntity to send money from. You can get this by calling
- `GET /legal-entity`. This field or `slashHandleId` is required unless you are
- authenticating via API key.
-
- source_slash_handle_id: The ID of the SlashHandle to send money from. You can get this by calling
- `GET /slash-handle`. This field or `legalEntityId` is required unless you are
- authenticating via API key.
-
- 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 cast(
- PaySendResponse,
- self._post(
- "/pay",
- body=maybe_transform(
- {
- "amount_cents": amount_cents,
- "slash_handle": slash_handle,
- "legal_entity_id": legal_entity_id,
- "source_slash_handle_id": source_slash_handle_id,
- },
- pay_send_params.PaySendParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=cast(Any, PaySendResponse), # Union types cannot be passed in as arguments in the type system
- ),
- )
-
-
-class AsyncPayResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncPayResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#accessing-raw-response-data-eg-headers
- """
- return AsyncPayResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncPayResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#with_streaming_response
- """
- return AsyncPayResourceWithStreamingResponse(self)
-
- async def retrieve(
- self,
- *,
- # 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,
- ) -> SlashHandle:
- """Retrieve your pay by slash information."""
- return await self._get(
- "/pay",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=SlashHandle,
- )
-
- async def send(
- self,
- *,
- amount_cents: float,
- slash_handle: str,
- legal_entity_id: str | Omit = omit,
- source_slash_handle_id: str | Omit = omit,
- # 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,
- ) -> PaySendResponse:
- """
- Send money to a slash handle
-
- Args:
- amount_cents: The amount of money to send in cents.
-
- slash_handle: The username of the SlashHandle to send money to. You can get this by asking
- your recipient for their SlashHandle.
-
- legal_entity_id: The ID of the LegalEntity to send money from. You can get this by calling
- `GET /legal-entity`. This field or `slashHandleId` is required unless you are
- authenticating via API key.
-
- source_slash_handle_id: The ID of the SlashHandle to send money from. You can get this by calling
- `GET /slash-handle`. This field or `legalEntityId` is required unless you are
- authenticating via API key.
-
- 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 cast(
- PaySendResponse,
- await self._post(
- "/pay",
- body=await async_maybe_transform(
- {
- "amount_cents": amount_cents,
- "slash_handle": slash_handle,
- "legal_entity_id": legal_entity_id,
- "source_slash_handle_id": source_slash_handle_id,
- },
- pay_send_params.PaySendParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=cast(Any, PaySendResponse), # Union types cannot be passed in as arguments in the type system
- ),
- )
-
-
-class PayResourceWithRawResponse:
- def __init__(self, pay: PayResource) -> None:
- self._pay = pay
-
- self.retrieve = to_raw_response_wrapper(
- pay.retrieve,
- )
- self.send = to_raw_response_wrapper(
- pay.send,
- )
-
-
-class AsyncPayResourceWithRawResponse:
- def __init__(self, pay: AsyncPayResource) -> None:
- self._pay = pay
-
- self.retrieve = async_to_raw_response_wrapper(
- pay.retrieve,
- )
- self.send = async_to_raw_response_wrapper(
- pay.send,
- )
-
-
-class PayResourceWithStreamingResponse:
- def __init__(self, pay: PayResource) -> None:
- self._pay = pay
-
- self.retrieve = to_streamed_response_wrapper(
- pay.retrieve,
- )
- self.send = to_streamed_response_wrapper(
- pay.send,
- )
-
-
-class AsyncPayResourceWithStreamingResponse:
- def __init__(self, pay: AsyncPayResource) -> None:
- self._pay = pay
-
- self.retrieve = async_to_streamed_response_wrapper(
- pay.retrieve,
- )
- self.send = async_to_streamed_response_wrapper(
- pay.send,
- )
diff --git a/src/slash_sdk/resources/slash_handle.py b/src/slash_sdk/resources/slash_handle.py
deleted file mode 100644
index b54c0fc..0000000
--- a/src/slash_sdk/resources/slash_handle.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..types import slash_handle_list_params
-from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import maybe_transform, async_maybe_transform
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-from ..types.slash_handle_list_response import SlashHandleListResponse
-
-__all__ = ["SlashHandleResource", "AsyncSlashHandleResource"]
-
-
-class SlashHandleResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> SlashHandleResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#accessing-raw-response-data-eg-headers
- """
- return SlashHandleResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> SlashHandleResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#with_streaming_response
- """
- return SlashHandleResourceWithStreamingResponse(self)
-
- def list(
- self,
- *,
- cursor: str | Omit = omit,
- # 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,
- ) -> SlashHandleListResponse:
- """
- List all of your Slash Handles
-
- Args:
- cursor: A cursor string to fetch the next page of results
-
- 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(
- "/slash-handle",
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform({"cursor": cursor}, slash_handle_list_params.SlashHandleListParams),
- ),
- cast_to=SlashHandleListResponse,
- )
-
-
-class AsyncSlashHandleResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncSlashHandleResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#accessing-raw-response-data-eg-headers
- """
- return AsyncSlashHandleResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncSlashHandleResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/slashfi/slash-sdk-python#with_streaming_response
- """
- return AsyncSlashHandleResourceWithStreamingResponse(self)
-
- async def list(
- self,
- *,
- cursor: str | Omit = omit,
- # 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,
- ) -> SlashHandleListResponse:
- """
- List all of your Slash Handles
-
- Args:
- cursor: A cursor string to fetch the next page of results
-
- 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 await self._get(
- "/slash-handle",
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=await async_maybe_transform({"cursor": cursor}, slash_handle_list_params.SlashHandleListParams),
- ),
- cast_to=SlashHandleListResponse,
- )
-
-
-class SlashHandleResourceWithRawResponse:
- def __init__(self, slash_handle: SlashHandleResource) -> None:
- self._slash_handle = slash_handle
-
- self.list = to_raw_response_wrapper(
- slash_handle.list,
- )
-
-
-class AsyncSlashHandleResourceWithRawResponse:
- def __init__(self, slash_handle: AsyncSlashHandleResource) -> None:
- self._slash_handle = slash_handle
-
- self.list = async_to_raw_response_wrapper(
- slash_handle.list,
- )
-
-
-class SlashHandleResourceWithStreamingResponse:
- def __init__(self, slash_handle: SlashHandleResource) -> None:
- self._slash_handle = slash_handle
-
- self.list = to_streamed_response_wrapper(
- slash_handle.list,
- )
-
-
-class AsyncSlashHandleResourceWithStreamingResponse:
- def __init__(self, slash_handle: AsyncSlashHandleResource) -> None:
- self._slash_handle = slash_handle
-
- self.list = async_to_streamed_response_wrapper(
- slash_handle.list,
- )
diff --git a/src/slash_sdk/resources/transaction.py b/src/slash_sdk/resources/transaction.py
index d54ef42..0ac025d 100644
--- a/src/slash_sdk/resources/transaction.py
+++ b/src/slash_sdk/resources/transaction.py
@@ -8,7 +8,7 @@
from ..types import transaction_list_params, transaction_aggregate_params, transaction_update_note_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import maybe_transform, async_maybe_transform
+from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -73,7 +73,7 @@ def retrieve(
if not transaction_id:
raise ValueError(f"Expected a non-empty value for `transaction_id` but received {transaction_id!r}")
return self._get(
- f"/transaction/{transaction_id}",
+ path_template("/transaction/{transaction_id}", transaction_id=transaction_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -86,7 +86,9 @@ def list(
account_id: str | Omit = omit,
cursor: str | Omit = omit,
filter_account_id: str | Omit = omit,
+ filter_card_group_id: str | Omit = omit,
filter_card_id: str | Omit = omit,
+ filter_category: Literal["card", "ach", "wire", "international_wire", "rtp", "fee", "internal"] | Omit = omit,
filter_detailed_status: Literal[
"pending", "canceled", "failed", "settled", "declined", "refund", "reversed", "returned", "dispute"
]
@@ -117,8 +119,13 @@ def list(
filter_account_id: Pass in an account ID to filter transactions by account ID. This will return all
transactions that match the account ID passed in.
+ filter_card_group_id: Filter transactions by card group ID. This will return all card transactions
+ that belong to cards in the specified card group.
+
filter_card_id: Filter transactions by cardId
+ filter_category: Filter transactions by category type
+
filter_detailed_status: Filter transactions by detailed status
filter_from_authorized_at: Pass in a unix timestamp in milliseconds to filter transactions by authorization
@@ -165,7 +172,9 @@ def list(
"account_id": account_id,
"cursor": cursor,
"filter_account_id": filter_account_id,
+ "filter_card_group_id": filter_card_group_id,
"filter_card_id": filter_card_id,
+ "filter_category": filter_category,
"filter_detailed_status": filter_detailed_status,
"filter_from_authorized_at": filter_from_authorized_at,
"filter_from_date": filter_from_date,
@@ -188,6 +197,7 @@ def aggregate(
account_id: str | Omit = omit,
filter_account_id: str | Omit = omit,
filter_card_id: str | Omit = omit,
+ filter_category: Literal["card", "ach", "wire", "international_wire", "rtp", "fee", "internal"] | Omit = omit,
filter_detailed_status: Literal[
"pending", "canceled", "failed", "settled", "declined", "refund", "reversed", "returned", "dispute"
]
@@ -217,6 +227,8 @@ def aggregate(
filter_card_id: Filter transactions by cardId
+ filter_category: Filter transactions by category type
+
filter_detailed_status: Filter transactions by detailed status
filter_from_authorized_at: Pass in a unix timestamp in milliseconds to filter transactions by authorization
@@ -261,6 +273,7 @@ def aggregate(
"account_id": account_id,
"filter_account_id": filter_account_id,
"filter_card_id": filter_card_id,
+ "filter_category": filter_category,
"filter_detailed_status": filter_detailed_status,
"filter_from_authorized_at": filter_from_authorized_at,
"filter_from_date": filter_from_date,
@@ -302,7 +315,7 @@ def retrieve_fee_details(
if not transaction_id:
raise ValueError(f"Expected a non-empty value for `transaction_id` but received {transaction_id!r}")
return self._get(
- f"/transaction/{transaction_id}/fee-details",
+ path_template("/transaction/{transaction_id}/fee-details", transaction_id=transaction_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -336,7 +349,7 @@ def update_note(
if not transaction_id:
raise ValueError(f"Expected a non-empty value for `transaction_id` but received {transaction_id!r}")
return self._patch(
- f"/transaction/{transaction_id}/note",
+ path_template("/transaction/{transaction_id}/note", transaction_id=transaction_id),
body=maybe_transform({"note": note}, transaction_update_note_params.TransactionUpdateNoteParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -391,7 +404,7 @@ async def retrieve(
if not transaction_id:
raise ValueError(f"Expected a non-empty value for `transaction_id` but received {transaction_id!r}")
return await self._get(
- f"/transaction/{transaction_id}",
+ path_template("/transaction/{transaction_id}", transaction_id=transaction_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -404,7 +417,9 @@ async def list(
account_id: str | Omit = omit,
cursor: str | Omit = omit,
filter_account_id: str | Omit = omit,
+ filter_card_group_id: str | Omit = omit,
filter_card_id: str | Omit = omit,
+ filter_category: Literal["card", "ach", "wire", "international_wire", "rtp", "fee", "internal"] | Omit = omit,
filter_detailed_status: Literal[
"pending", "canceled", "failed", "settled", "declined", "refund", "reversed", "returned", "dispute"
]
@@ -435,8 +450,13 @@ async def list(
filter_account_id: Pass in an account ID to filter transactions by account ID. This will return all
transactions that match the account ID passed in.
+ filter_card_group_id: Filter transactions by card group ID. This will return all card transactions
+ that belong to cards in the specified card group.
+
filter_card_id: Filter transactions by cardId
+ filter_category: Filter transactions by category type
+
filter_detailed_status: Filter transactions by detailed status
filter_from_authorized_at: Pass in a unix timestamp in milliseconds to filter transactions by authorization
@@ -483,7 +503,9 @@ async def list(
"account_id": account_id,
"cursor": cursor,
"filter_account_id": filter_account_id,
+ "filter_card_group_id": filter_card_group_id,
"filter_card_id": filter_card_id,
+ "filter_category": filter_category,
"filter_detailed_status": filter_detailed_status,
"filter_from_authorized_at": filter_from_authorized_at,
"filter_from_date": filter_from_date,
@@ -506,6 +528,7 @@ async def aggregate(
account_id: str | Omit = omit,
filter_account_id: str | Omit = omit,
filter_card_id: str | Omit = omit,
+ filter_category: Literal["card", "ach", "wire", "international_wire", "rtp", "fee", "internal"] | Omit = omit,
filter_detailed_status: Literal[
"pending", "canceled", "failed", "settled", "declined", "refund", "reversed", "returned", "dispute"
]
@@ -535,6 +558,8 @@ async def aggregate(
filter_card_id: Filter transactions by cardId
+ filter_category: Filter transactions by category type
+
filter_detailed_status: Filter transactions by detailed status
filter_from_authorized_at: Pass in a unix timestamp in milliseconds to filter transactions by authorization
@@ -579,6 +604,7 @@ async def aggregate(
"account_id": account_id,
"filter_account_id": filter_account_id,
"filter_card_id": filter_card_id,
+ "filter_category": filter_category,
"filter_detailed_status": filter_detailed_status,
"filter_from_authorized_at": filter_from_authorized_at,
"filter_from_date": filter_from_date,
@@ -620,7 +646,7 @@ async def retrieve_fee_details(
if not transaction_id:
raise ValueError(f"Expected a non-empty value for `transaction_id` but received {transaction_id!r}")
return await self._get(
- f"/transaction/{transaction_id}/fee-details",
+ path_template("/transaction/{transaction_id}/fee-details", transaction_id=transaction_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -654,7 +680,7 @@ async def update_note(
if not transaction_id:
raise ValueError(f"Expected a non-empty value for `transaction_id` but received {transaction_id!r}")
return await self._patch(
- f"/transaction/{transaction_id}/note",
+ path_template("/transaction/{transaction_id}/note", transaction_id=transaction_id),
body=await async_maybe_transform(
{"note": note}, transaction_update_note_params.TransactionUpdateNoteParams
),
diff --git a/src/slash_sdk/resources/virtual_account.py b/src/slash_sdk/resources/virtual_account.py
index e34799f..b5f075f 100644
--- a/src/slash_sdk/resources/virtual_account.py
+++ b/src/slash_sdk/resources/virtual_account.py
@@ -12,7 +12,7 @@
virtual_account_update_params,
)
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import required_args, maybe_transform, async_maybe_transform
+from .._utils import path_template, required_args, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -125,7 +125,7 @@ def retrieve(
if not virtual_account_id:
raise ValueError(f"Expected a non-empty value for `virtual_account_id` but received {virtual_account_id!r}")
return self._get(
- f"/virtual-account/{virtual_account_id}",
+ path_template("/virtual-account/{virtual_account_id}", virtual_account_id=virtual_account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -216,7 +216,7 @@ def update(
if not virtual_account_id:
raise ValueError(f"Expected a non-empty value for `virtual_account_id` but received {virtual_account_id!r}")
return self._patch(
- f"/virtual-account/{virtual_account_id}",
+ path_template("/virtual-account/{virtual_account_id}", virtual_account_id=virtual_account_id),
body=maybe_transform(
{
"action": action,
@@ -385,7 +385,7 @@ async def retrieve(
if not virtual_account_id:
raise ValueError(f"Expected a non-empty value for `virtual_account_id` but received {virtual_account_id!r}")
return await self._get(
- f"/virtual-account/{virtual_account_id}",
+ path_template("/virtual-account/{virtual_account_id}", virtual_account_id=virtual_account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -476,7 +476,7 @@ async def update(
if not virtual_account_id:
raise ValueError(f"Expected a non-empty value for `virtual_account_id` but received {virtual_account_id!r}")
return await self._patch(
- f"/virtual-account/{virtual_account_id}",
+ path_template("/virtual-account/{virtual_account_id}", virtual_account_id=virtual_account_id),
body=await async_maybe_transform(
{
"action": action,
diff --git a/src/slash_sdk/resources/webhook.py b/src/slash_sdk/resources/webhook.py
index 09bee4f..8307ffd 100644
--- a/src/slash_sdk/resources/webhook.py
+++ b/src/slash_sdk/resources/webhook.py
@@ -8,7 +8,7 @@
from ..types import webhook_list_params, webhook_create_params, webhook_update_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from .._utils import maybe_transform, async_maybe_transform
+from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -145,7 +145,7 @@ def update(
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return self._patch(
- f"/webhook/{webhook_id}",
+ path_template("/webhook/{webhook_id}", webhook_id=webhook_id),
body=maybe_transform(
{
"status": status,
@@ -327,7 +327,7 @@ async def update(
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return await self._patch(
- f"/webhook/{webhook_id}",
+ path_template("/webhook/{webhook_id}", webhook_id=webhook_id),
body=await async_maybe_transform(
{
"status": status,
diff --git a/src/slash_sdk/types/__init__.py b/src/slash_sdk/types/__init__.py
index 0d60e31..f389de0 100644
--- a/src/slash_sdk/types/__init__.py
+++ b/src/slash_sdk/types/__init__.py
@@ -11,12 +11,9 @@
from .card_status import CardStatus as CardStatus
from .money_param import MoneyParam as MoneyParam
from .transaction import Transaction as Transaction
-from .slash_handle import SlashHandle as SlashHandle
from .commission_rule import CommissionRule as CommissionRule
-from .pay_send_params import PaySendParams as PaySendParams
from .virtual_account import VirtualAccount as VirtualAccount
from .card_list_params import CardListParams as CardListParams
-from .pay_send_response import PaySendResponse as PaySendResponse
from .card_create_params import CardCreateParams as CardCreateParams
from .card_list_response import CardListResponse as CardListResponse
from .card_update_params import CardUpdateParams as CardUpdateParams
@@ -41,14 +38,12 @@
from .card_group_update_params import CardGroupUpdateParams as CardGroupUpdateParams
from .card_product_list_params import CardProductListParams as CardProductListParams
from .commission_details_param import CommissionDetailsParam as CommissionDetailsParam
-from .slash_handle_list_params import SlashHandleListParams as SlashHandleListParams
from .oauth2_get_token_response import Oauth2GetTokenResponse as Oauth2GetTokenResponse
from .transaction_list_response import TransactionListResponse as TransactionListResponse
from .card_product_list_response import CardProductListResponse as CardProductListResponse
from .developer_application_data import DeveloperApplicationData as DeveloperApplicationData
from .developer_application_type import DeveloperApplicationType as DeveloperApplicationType
from .legal_entity_list_response import LegalEntityListResponse as LegalEntityListResponse
-from .slash_handle_list_response import SlashHandleListResponse as SlashHandleListResponse
from .developer_application_model import DeveloperApplicationModel as DeveloperApplicationModel
from .virtual_account_list_params import VirtualAccountListParams as VirtualAccountListParams
from .crypto_create_offramp_params import CryptoCreateOfframpParams as CryptoCreateOfframpParams
diff --git a/src/slash_sdk/types/card/card.py b/src/slash_sdk/types/card/card.py
index 5e41ef7..81613ef 100644
--- a/src/slash_sdk/types/card/card.py
+++ b/src/slash_sdk/types/card/card.py
@@ -1,7 +1,8 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import List, Optional
from datetime import datetime
+from typing_extensions import Literal
from pydantic import Field as FieldInfo
@@ -9,7 +10,17 @@
from ..card_status import CardStatus
from .spending_constraint import SpendingConstraint
-__all__ = ["Card"]
+__all__ = ["Card", "Modifier"]
+
+
+class Modifier(BaseModel):
+ name: Literal["only_allow_recurring_payments"]
+
+ value: bool
+ """Whether to only allow recurring payments.
+
+ The default value for newly created cards is false.
+ """
class Card(BaseModel):
@@ -60,6 +71,12 @@ class Card(BaseModel):
drops
"""
+ modifiers: Optional[List[Modifier]] = None
+ """The modifiers applied to this card.
+
+ Modifiers control card behavior like restricting to recurring payments only.
+ """
+
pan: Optional[str] = None
"""
This field contains the full PAN which will only be sent on a request for a
diff --git a/src/slash_sdk/types/card_list_params.py b/src/slash_sdk/types/card_list_params.py
index 9f11d3b..37513ca 100644
--- a/src/slash_sdk/types/card_list_params.py
+++ b/src/slash_sdk/types/card_list_params.py
@@ -34,6 +34,13 @@ class CardListParams(TypedDict, total=False):
entity.
"""
+ filter_modifier: Annotated[str, PropertyInfo(alias="filter:modifier")]
+ """Filter cards by modifier.
+
+ Format is "modifier_name:value" (e.g., "only_allow_recurring_payments:true").
+ Returns cards where the specified modifier has the given value.
+ """
+
filter_status: Annotated[Literal["active", "paused", "closed", "inactive"], PropertyInfo(alias="filter:status")]
"""Returns all cards matching the status passed in."""
diff --git a/src/slash_sdk/types/pay_send_params.py b/src/slash_sdk/types/pay_send_params.py
deleted file mode 100644
index 91d0630..0000000
--- a/src/slash_sdk/types/pay_send_params.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, Annotated, TypedDict
-
-from .._utils import PropertyInfo
-
-__all__ = ["PaySendParams"]
-
-
-class PaySendParams(TypedDict, total=False):
- amount_cents: Required[Annotated[float, PropertyInfo(alias="amountCents")]]
- """The amount of money to send in cents."""
-
- slash_handle: Required[Annotated[str, PropertyInfo(alias="slashHandle")]]
- """The username of the SlashHandle to send money to.
-
- You can get this by asking your recipient for their SlashHandle.
- """
-
- legal_entity_id: Annotated[str, PropertyInfo(alias="legalEntityId")]
- """The ID of the LegalEntity to send money from.
-
- You can get this by calling `GET /legal-entity`. This field or `slashHandleId`
- is required unless you are authenticating via API key.
- """
-
- source_slash_handle_id: Annotated[str, PropertyInfo(alias="sourceSlashHandleId")]
- """The ID of the SlashHandle to send money from.
-
- You can get this by calling `GET /slash-handle`. This field or `legalEntityId`
- is required unless you are authenticating via API key.
- """
diff --git a/src/slash_sdk/types/pay_send_response.py b/src/slash_sdk/types/pay_send_response.py
deleted file mode 100644
index 55981f8..0000000
--- a/src/slash_sdk/types/pay_send_response.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Union, Optional
-from typing_extensions import Literal, TypeAlias
-
-from .._models import BaseModel
-
-__all__ = ["PaySendResponse", "UnionMember0", "UnionMember1"]
-
-
-class UnionMember0(BaseModel):
- success: Literal[True]
-
- redirect: Optional[str] = None
-
-
-class UnionMember1(BaseModel):
- error: str
-
- success: Literal[False]
-
-
-PaySendResponse: TypeAlias = Union[UnionMember0, UnionMember1]
diff --git a/src/slash_sdk/types/slash_handle.py b/src/slash_sdk/types/slash_handle.py
deleted file mode 100644
index 8434e05..0000000
--- a/src/slash_sdk/types/slash_handle.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from pydantic import Field as FieldInfo
-
-from .._models import BaseModel
-
-__all__ = ["SlashHandle"]
-
-
-class SlashHandle(BaseModel):
- """Details about a single SlashHandle"""
-
- id: str
- """The id of the SlashHandle"""
-
- account_id: str = FieldInfo(alias="accountId")
- """The ID of the account that will send and receive funds for this entity"""
-
- name: str
- """The display name of the entity"""
-
- slash_handle: str = FieldInfo(alias="slashHandle")
- """The username that others can use to send money to this entity"""
diff --git a/src/slash_sdk/types/slash_handle_list_params.py b/src/slash_sdk/types/slash_handle_list_params.py
deleted file mode 100644
index 0e996e8..0000000
--- a/src/slash_sdk/types/slash_handle_list_params.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import TypedDict
-
-__all__ = ["SlashHandleListParams"]
-
-
-class SlashHandleListParams(TypedDict, total=False):
- cursor: str
- """A cursor string to fetch the next page of results"""
diff --git a/src/slash_sdk/types/slash_handle_list_response.py b/src/slash_sdk/types/slash_handle_list_response.py
deleted file mode 100644
index dfd2e55..0000000
--- a/src/slash_sdk/types/slash_handle_list_response.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List
-
-from .._models import BaseModel
-from .slash_handle import SlashHandle
-from .pagination_response import PaginationResponse
-
-__all__ = ["SlashHandleListResponse"]
-
-
-class SlashHandleListResponse(BaseModel):
- items: List[SlashHandle]
-
- metadata: PaginationResponse
- """Response sent when requesting a list of data"""
diff --git a/src/slash_sdk/types/transaction_aggregate_params.py b/src/slash_sdk/types/transaction_aggregate_params.py
index 96c9751..86c3831 100644
--- a/src/slash_sdk/types/transaction_aggregate_params.py
+++ b/src/slash_sdk/types/transaction_aggregate_params.py
@@ -22,6 +22,12 @@ class TransactionAggregateParams(TypedDict, total=False):
filter_card_id: Annotated[str, PropertyInfo(alias="filter:cardId")]
"""Filter transactions by cardId"""
+ filter_category: Annotated[
+ Literal["card", "ach", "wire", "international_wire", "rtp", "fee", "internal"],
+ PropertyInfo(alias="filter:category"),
+ ]
+ """Filter transactions by category type"""
+
filter_detailed_status: Annotated[
Literal["pending", "canceled", "failed", "settled", "declined", "refund", "reversed", "returned", "dispute"],
PropertyInfo(alias="filter:detailed_status"),
diff --git a/src/slash_sdk/types/transaction_list_params.py b/src/slash_sdk/types/transaction_list_params.py
index edea1d3..91007bf 100644
--- a/src/slash_sdk/types/transaction_list_params.py
+++ b/src/slash_sdk/types/transaction_list_params.py
@@ -22,9 +22,22 @@ class TransactionListParams(TypedDict, total=False):
This will return all transactions that match the account ID passed in.
"""
+ filter_card_group_id: Annotated[str, PropertyInfo(alias="filter:cardGroupId")]
+ """Filter transactions by card group ID.
+
+ This will return all card transactions that belong to cards in the specified
+ card group.
+ """
+
filter_card_id: Annotated[str, PropertyInfo(alias="filter:cardId")]
"""Filter transactions by cardId"""
+ filter_category: Annotated[
+ Literal["card", "ach", "wire", "international_wire", "rtp", "fee", "internal"],
+ PropertyInfo(alias="filter:category"),
+ ]
+ """Filter transactions by category type"""
+
filter_detailed_status: Annotated[
Literal["pending", "canceled", "failed", "settled", "declined", "refund", "reversed", "returned", "dispute"],
PropertyInfo(alias="filter:detailed_status"),
diff --git a/tests/api_resources/test_card.py b/tests/api_resources/test_card.py
index a43001b..9259478 100644
--- a/tests/api_resources/test_card.py
+++ b/tests/api_resources/test_card.py
@@ -270,6 +270,7 @@ def test_method_list_with_all_params(self, client: SlashSDK) -> None:
filter_card_group_id="filter:cardGroupId",
filter_card_group_name="filter:cardGroupName",
filter_legal_entity_id="filter:legalEntityId",
+ filter_modifier="filter:modifier",
filter_status="active",
filter_virtual_account_id="filter:virtualAccountId",
sort="createdAt",
@@ -596,6 +597,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncSlashSDK) ->
filter_card_group_id="filter:cardGroupId",
filter_card_group_name="filter:cardGroupName",
filter_legal_entity_id="filter:legalEntityId",
+ filter_modifier="filter:modifier",
filter_status="active",
filter_virtual_account_id="filter:virtualAccountId",
sort="createdAt",
diff --git a/tests/api_resources/test_pay.py b/tests/api_resources/test_pay.py
deleted file mode 100644
index b2fe0b7..0000000
--- a/tests/api_resources/test_pay.py
+++ /dev/null
@@ -1,176 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from slash_sdk import SlashSDK, AsyncSlashSDK
-from tests.utils import assert_matches_type
-from slash_sdk.types import SlashHandle, PaySendResponse
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestPay:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_retrieve(self, client: SlashSDK) -> None:
- pay = client.pay.retrieve()
- assert_matches_type(SlashHandle, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_raw_response_retrieve(self, client: SlashSDK) -> None:
- response = client.pay.with_raw_response.retrieve()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- pay = response.parse()
- assert_matches_type(SlashHandle, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_streaming_response_retrieve(self, client: SlashSDK) -> None:
- with client.pay.with_streaming_response.retrieve() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- pay = response.parse()
- assert_matches_type(SlashHandle, pay, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_send(self, client: SlashSDK) -> None:
- pay = client.pay.send(
- amount_cents=0,
- slash_handle="slashHandle",
- )
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_send_with_all_params(self, client: SlashSDK) -> None:
- pay = client.pay.send(
- amount_cents=0,
- slash_handle="slashHandle",
- legal_entity_id="legalEntityId",
- source_slash_handle_id="sourceSlashHandleId",
- )
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_raw_response_send(self, client: SlashSDK) -> None:
- response = client.pay.with_raw_response.send(
- amount_cents=0,
- slash_handle="slashHandle",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- pay = response.parse()
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_streaming_response_send(self, client: SlashSDK) -> None:
- with client.pay.with_streaming_response.send(
- amount_cents=0,
- slash_handle="slashHandle",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- pay = response.parse()
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncPay:
- parametrize = pytest.mark.parametrize(
- "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
- )
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncSlashSDK) -> None:
- pay = await async_client.pay.retrieve()
- assert_matches_type(SlashHandle, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncSlashSDK) -> None:
- response = await async_client.pay.with_raw_response.retrieve()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- pay = await response.parse()
- assert_matches_type(SlashHandle, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncSlashSDK) -> None:
- async with async_client.pay.with_streaming_response.retrieve() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- pay = await response.parse()
- assert_matches_type(SlashHandle, pay, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_send(self, async_client: AsyncSlashSDK) -> None:
- pay = await async_client.pay.send(
- amount_cents=0,
- slash_handle="slashHandle",
- )
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_send_with_all_params(self, async_client: AsyncSlashSDK) -> None:
- pay = await async_client.pay.send(
- amount_cents=0,
- slash_handle="slashHandle",
- legal_entity_id="legalEntityId",
- source_slash_handle_id="sourceSlashHandleId",
- )
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_raw_response_send(self, async_client: AsyncSlashSDK) -> None:
- response = await async_client.pay.with_raw_response.send(
- amount_cents=0,
- slash_handle="slashHandle",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- pay = await response.parse()
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_streaming_response_send(self, async_client: AsyncSlashSDK) -> None:
- async with async_client.pay.with_streaming_response.send(
- amount_cents=0,
- slash_handle="slashHandle",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- pay = await response.parse()
- assert_matches_type(PaySendResponse, pay, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_slash_handle.py b/tests/api_resources/test_slash_handle.py
deleted file mode 100644
index a1dee57..0000000
--- a/tests/api_resources/test_slash_handle.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from slash_sdk import SlashSDK, AsyncSlashSDK
-from tests.utils import assert_matches_type
-from slash_sdk.types import SlashHandleListResponse
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestSlashHandle:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_list(self, client: SlashSDK) -> None:
- slash_handle = client.slash_handle.list()
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_list_with_all_params(self, client: SlashSDK) -> None:
- slash_handle = client.slash_handle.list(
- cursor="cursor",
- )
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_raw_response_list(self, client: SlashSDK) -> None:
- response = client.slash_handle.with_raw_response.list()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- slash_handle = response.parse()
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_streaming_response_list(self, client: SlashSDK) -> None:
- with client.slash_handle.with_streaming_response.list() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- slash_handle = response.parse()
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncSlashHandle:
- parametrize = pytest.mark.parametrize(
- "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
- )
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_list(self, async_client: AsyncSlashSDK) -> None:
- slash_handle = await async_client.slash_handle.list()
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncSlashSDK) -> None:
- slash_handle = await async_client.slash_handle.list(
- cursor="cursor",
- )
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_raw_response_list(self, async_client: AsyncSlashSDK) -> None:
- response = await async_client.slash_handle.with_raw_response.list()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- slash_handle = await response.parse()
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_streaming_response_list(self, async_client: AsyncSlashSDK) -> None:
- async with async_client.slash_handle.with_streaming_response.list() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- slash_handle = await response.parse()
- assert_matches_type(SlashHandleListResponse, slash_handle, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_transaction.py b/tests/api_resources/test_transaction.py
index 9e3be9b..1cd23f1 100644
--- a/tests/api_resources/test_transaction.py
+++ b/tests/api_resources/test_transaction.py
@@ -78,7 +78,9 @@ def test_method_list_with_all_params(self, client: SlashSDK) -> None:
account_id="accountId",
cursor="cursor",
filter_account_id="filter:accountId",
+ filter_card_group_id="filter:cardGroupId",
filter_card_id="filter:cardId",
+ filter_category="card",
filter_detailed_status="pending",
filter_from_authorized_at="filter:from_authorized_at",
filter_from_date="filter:from_date",
@@ -126,6 +128,7 @@ def test_method_aggregate_with_all_params(self, client: SlashSDK) -> None:
account_id="accountId",
filter_account_id="filter:accountId",
filter_card_id="filter:cardId",
+ filter_category="card",
filter_detailed_status="pending",
filter_from_authorized_at="filter:from_authorized_at",
filter_from_date="filter:from_date",
@@ -308,7 +311,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncSlashSDK) ->
account_id="accountId",
cursor="cursor",
filter_account_id="filter:accountId",
+ filter_card_group_id="filter:cardGroupId",
filter_card_id="filter:cardId",
+ filter_category="card",
filter_detailed_status="pending",
filter_from_authorized_at="filter:from_authorized_at",
filter_from_date="filter:from_date",
@@ -356,6 +361,7 @@ async def test_method_aggregate_with_all_params(self, async_client: AsyncSlashSD
account_id="accountId",
filter_account_id="filter:accountId",
filter_card_id="filter:cardId",
+ filter_category="card",
filter_detailed_status="pending",
filter_from_authorized_at="filter:from_authorized_at",
filter_from_date="filter:from_date",
diff --git a/tests/test_utils/test_path.py b/tests/test_utils/test_path.py
new file mode 100644
index 0000000..a614103
--- /dev/null
+++ b/tests/test_utils/test_path.py
@@ -0,0 +1,89 @@
+from __future__ import annotations
+
+from typing import Any
+
+import pytest
+
+from slash_sdk._utils._path import path_template
+
+
+@pytest.mark.parametrize(
+ "template, kwargs, expected",
+ [
+ ("/v1/{id}", dict(id="abc"), "/v1/abc"),
+ ("/v1/{a}/{b}", dict(a="x", b="y"), "/v1/x/y"),
+ ("/v1/{a}{b}/path/{c}?val={d}#{e}", dict(a="x", b="y", c="z", d="u", e="v"), "/v1/xy/path/z?val=u#v"),
+ ("/{w}/{w}", dict(w="echo"), "/echo/echo"),
+ ("/v1/static", {}, "/v1/static"),
+ ("", {}, ""),
+ ("/v1/?q={n}&count=10", dict(n=42), "/v1/?q=42&count=10"),
+ ("/v1/{v}", dict(v=None), "/v1/null"),
+ ("/v1/{v}", dict(v=True), "/v1/true"),
+ ("/v1/{v}", dict(v=False), "/v1/false"),
+ ("/v1/{v}", dict(v=".hidden"), "/v1/.hidden"), # dot prefix ok
+ ("/v1/{v}", dict(v="file.txt"), "/v1/file.txt"), # dot in middle ok
+ ("/v1/{v}", dict(v="..."), "/v1/..."), # triple dot ok
+ ("/v1/{a}{b}", dict(a=".", b="txt"), "/v1/.txt"), # dot var combining with adjacent to be ok
+ ("/items?q={v}#{f}", dict(v=".", f=".."), "/items?q=.#.."), # dots in query/fragment are fine
+ (
+ "/v1/{a}?query={b}",
+ dict(a="../../other/endpoint", b="a&bad=true"),
+ "/v1/..%2F..%2Fother%2Fendpoint?query=a%26bad%3Dtrue",
+ ),
+ ("/v1/{val}", dict(val="a/b/c"), "/v1/a%2Fb%2Fc"),
+ ("/v1/{val}", dict(val="a/b/c?query=value"), "/v1/a%2Fb%2Fc%3Fquery=value"),
+ ("/v1/{val}", dict(val="a/b/c?query=value&bad=true"), "/v1/a%2Fb%2Fc%3Fquery=value&bad=true"),
+ ("/v1/{val}", dict(val="%20"), "/v1/%2520"), # escapes escape sequences in input
+ # Query: slash and ? are safe, # is not
+ ("/items?q={v}", dict(v="a/b"), "/items?q=a/b"),
+ ("/items?q={v}", dict(v="a?b"), "/items?q=a?b"),
+ ("/items?q={v}", dict(v="a#b"), "/items?q=a%23b"),
+ ("/items?q={v}", dict(v="a b"), "/items?q=a%20b"),
+ # Fragment: slash and ? are safe
+ ("/docs#{v}", dict(v="a/b"), "/docs#a/b"),
+ ("/docs#{v}", dict(v="a?b"), "/docs#a?b"),
+ # Path: slash, ? and # are all encoded
+ ("/v1/{v}", dict(v="a/b"), "/v1/a%2Fb"),
+ ("/v1/{v}", dict(v="a?b"), "/v1/a%3Fb"),
+ ("/v1/{v}", dict(v="a#b"), "/v1/a%23b"),
+ # same var encoded differently by component
+ (
+ "/v1/{v}?q={v}#{v}",
+ dict(v="a/b?c#d"),
+ "/v1/a%2Fb%3Fc%23d?q=a/b?c%23d#a/b?c%23d",
+ ),
+ ("/v1/{val}", dict(val="x?admin=true"), "/v1/x%3Fadmin=true"), # query injection
+ ("/v1/{val}", dict(val="x#admin"), "/v1/x%23admin"), # fragment injection
+ ],
+)
+def test_interpolation(template: str, kwargs: dict[str, Any], expected: str) -> None:
+ assert path_template(template, **kwargs) == expected
+
+
+def test_missing_kwarg_raises_key_error() -> None:
+ with pytest.raises(KeyError, match="org_id"):
+ path_template("/v1/{org_id}")
+
+
+@pytest.mark.parametrize(
+ "template, kwargs",
+ [
+ ("{a}/path", dict(a=".")),
+ ("{a}/path", dict(a="..")),
+ ("/v1/{a}", dict(a=".")),
+ ("/v1/{a}", dict(a="..")),
+ ("/v1/{a}/path", dict(a=".")),
+ ("/v1/{a}/path", dict(a="..")),
+ ("/v1/{a}{b}", dict(a=".", b=".")), # adjacent vars → ".."
+ ("/v1/{a}.", dict(a=".")), # var + static → ".."
+ ("/v1/{a}{b}", dict(a="", b=".")), # empty + dot → "."
+ ("/v1/%2e/{x}", dict(x="ok")), # encoded dot in static text
+ ("/v1/%2e./{x}", dict(x="ok")), # mixed encoded ".." in static
+ ("/v1/.%2E/{x}", dict(x="ok")), # mixed encoded ".." in static
+ ("/v1/{v}?q=1", dict(v="..")),
+ ("/v1/{v}#frag", dict(v="..")),
+ ],
+)
+def test_dot_segment_rejected(template: str, kwargs: dict[str, Any]) -> None:
+ with pytest.raises(ValueError, match="dot-segment"):
+ path_template(template, **kwargs)