From 41a58d40928ab6392025af88b54b83a0ad2f37de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:05:42 +0000 Subject: [PATCH 1/4] chore(internal/tests): avoid race condition with implicit client cleanup --- tests/test_client.py | 386 ++++++++++++++++++++++++------------------- 1 file changed, 212 insertions(+), 174 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index a0e31a991..3122d2f29 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -59,51 +59,49 @@ def _get_open_connections(client: Increase | AsyncIncrease) -> int: class TestIncrease: - client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - def test_raw_response(self, respx_mock: MockRouter) -> None: + def test_raw_response(self, respx_mock: MockRouter, client: Increase) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Increase) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, client: Increase) -> None: + copied = client.copy() + assert id(copied) != id(client) - copied = self.client.copy(api_key="another My API Key") + copied = client.copy(api_key="another My API Key") assert copied.api_key == "another My API Key" - assert self.client.api_key == "My API Key" + assert client.api_key == "My API Key" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, client: Increase) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(client.timeout, httpx.Timeout) + copied = client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: client = Increase( @@ -138,6 +136,7 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + client.close() def test_copy_default_query(self) -> None: client = Increase( @@ -175,13 +174,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + client.close() + + def test_copy_signature(self, client: Increase) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -192,12 +193,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, client: Increase) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -254,14 +255,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + def test_request_timeout(self, client: Increase) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( - FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0))) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(100.0) @@ -274,6 +273,8 @@ def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + client.close() + def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: @@ -285,6 +286,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + client.close() + # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: client = Increase( @@ -295,6 +298,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + client.close() + # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = Increase( @@ -305,6 +310,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + client.close() + async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: @@ -316,14 +323,14 @@ async def test_invalid_http_client(self) -> None: ) def test_default_headers_option(self) -> None: - client = Increase( + test_client = Increase( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = Increase( + test_client2 = Increase( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -332,10 +339,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + test_client.close() + test_client2.close() + def test_validate_headers(self) -> None: client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -364,8 +374,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + client.close() + + def test_request_extra_json(self, client: Increase) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -376,7 +388,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -387,7 +399,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -398,8 +410,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Increase) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -409,7 +421,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -420,8 +432,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Increase) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -434,7 +446,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -448,7 +460,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -491,7 +503,7 @@ def test_multipart_repeating_array(self, client: Increase) -> None: ] @pytest.mark.respx(base_url=base_url) - def test_basic_union_response(self, respx_mock: MockRouter) -> None: + def test_basic_union_response(self, respx_mock: MockRouter, client: Increase) -> None: class Model1(BaseModel): name: str @@ -500,12 +512,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + def test_union_response_different_types(self, respx_mock: MockRouter, client: Increase) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -516,18 +528,18 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: Increase) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -543,29 +555,29 @@ class Model(BaseModel): ) ) - response = self.client.get("/foo", cast_to=Model) + response = client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 @pytest.mark.respx(base_url=base_url) - def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: + def test_idempotency_header_options(self, respx_mock: MockRouter, client: Increase) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) header = response.request.headers.get("Idempotency-Key") assert header is not None assert header.startswith("increase-python-retry") # explicit header - response = self.client.post( + response = client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"Idempotency-Key": "custom-key"}), ) assert response.request.headers.get("Idempotency-Key") == "custom-key" - response = self.client.post( + response = client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"idempotency-key": "custom-key"}), @@ -573,7 +585,7 @@ def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: assert response.request.headers.get("Idempotency-Key") == "custom-key" # custom argument - response = self.client.post( + response = client.post( "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") ) assert response.request.headers.get("Idempotency-Key") == "custom-key" @@ -586,6 +598,8 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" + client.close() + def test_base_url_env(self) -> None: with update_env(INCREASE_BASE_URL="http://localhost:5000/from/env"): client = Increase(api_key=api_key, _strict_response_validation=True) @@ -601,6 +615,8 @@ def test_base_url_env(self) -> None: ) assert str(client.base_url).startswith("https://api.increase.com") + client.close() + @pytest.mark.parametrize( "client", [ @@ -623,6 +639,7 @@ def test_base_url_trailing_slash(self, client: Increase) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -646,6 +663,7 @@ def test_base_url_no_trailing_slash(self, client: Increase) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -669,35 +687,36 @@ def test_absolute_request_url(self, client: Increase) -> None: ), ) assert request.url == "https://myapi.com/foo" + client.close() def test_copied_client_does_not_close_http(self) -> None: - client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) - assert not client.is_closed() + test_client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied - assert not client.is_closed() + assert not test_client.is_closed() def test_client_context_manager(self) -> None: - client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) - with client as c2: - assert c2 is client + test_client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) + with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + def test_client_response_validation_error(self, respx_mock: MockRouter, client: Increase) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - self.client.get("/foo", cast_to=Model) + client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -717,11 +736,14 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=False) + non_strict_client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=False) - response = client.get("/foo", cast_to=Model) + response = non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + strict_client.close() + non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -744,9 +766,9 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) - + def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, client: Increase + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) @@ -760,7 +782,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien with pytest.raises(APITimeoutError): client.accounts.with_streaming_response.create(name="New Account!").__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @mock.patch("increase._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -769,7 +791,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client with pytest.raises(APIStatusError): client.accounts.with_streaming_response.create(name="New Account!").__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("increase._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -875,83 +897,77 @@ def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - def test_follow_redirects(self, respx_mock: MockRouter) -> None: + def test_follow_redirects(self, respx_mock: MockRouter, client: Increase) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Increase) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - self.client.post( - "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response - ) + client.post("/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response) assert exc_info.value.response.status_code == 302 assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" class TestAsyncIncrease: - client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response(self, respx_mock: MockRouter) -> None: + async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, async_client: AsyncIncrease) -> None: + copied = async_client.copy() + assert id(copied) != id(async_client) - copied = self.client.copy(api_key="another My API Key") + copied = async_client.copy(api_key="another My API Key") assert copied.api_key == "another My API Key" - assert self.client.api_key == "My API Key" + assert async_client.api_key == "My API Key" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, async_client: AsyncIncrease) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = async_client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert async_client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(async_client.timeout, httpx.Timeout) + copied = async_client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(async_client.timeout, httpx.Timeout) - def test_copy_default_headers(self) -> None: + async def test_copy_default_headers(self) -> None: client = AsyncIncrease( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) @@ -984,8 +1000,9 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + await client.close() - def test_copy_default_query(self) -> None: + async def test_copy_default_query(self) -> None: client = AsyncIncrease( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"} ) @@ -1021,13 +1038,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + await client.close() + + def test_copy_signature(self, async_client: AsyncIncrease) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + async_client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(async_client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -1038,12 +1057,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, async_client: AsyncIncrease) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = async_client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -1100,12 +1119,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - async def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + async def test_request_timeout(self, async_client: AsyncIncrease) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( + request = async_client._build_request( FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) ) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1120,6 +1139,8 @@ async def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + await client.close() + async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: @@ -1131,6 +1152,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + await client.close() + # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: client = AsyncIncrease( @@ -1141,6 +1164,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + await client.close() + # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = AsyncIncrease( @@ -1151,6 +1176,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + await client.close() + def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: @@ -1161,15 +1188,15 @@ def test_invalid_http_client(self) -> None: http_client=cast(Any, http_client), ) - def test_default_headers_option(self) -> None: - client = AsyncIncrease( + async def test_default_headers_option(self) -> None: + test_client = AsyncIncrease( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = AsyncIncrease( + test_client2 = AsyncIncrease( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -1178,10 +1205,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + await test_client.close() + await test_client2.close() + def test_validate_headers(self) -> None: client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1192,7 +1222,7 @@ def test_validate_headers(self) -> None: client2 = AsyncIncrease(base_url=base_url, api_key=None, _strict_response_validation=True) _ = client2 - def test_default_query_option(self) -> None: + async def test_default_query_option(self) -> None: client = AsyncIncrease( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"} ) @@ -1210,8 +1240,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + await client.close() + + def test_request_extra_json(self, client: Increase) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1222,7 +1254,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1233,7 +1265,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1244,8 +1276,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Increase) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1255,7 +1287,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1266,8 +1298,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Increase) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1280,7 +1312,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1294,7 +1326,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1337,7 +1369,7 @@ def test_multipart_repeating_array(self, async_client: AsyncIncrease) -> None: ] @pytest.mark.respx(base_url=base_url) - async def test_basic_union_response(self, respx_mock: MockRouter) -> None: + async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: class Model1(BaseModel): name: str @@ -1346,12 +1378,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - async def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1362,18 +1394,20 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - async def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + async def test_non_application_json_content_type_for_json_data( + self, respx_mock: MockRouter, async_client: AsyncIncrease + ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -1389,29 +1423,29 @@ class Model(BaseModel): ) ) - response = await self.client.get("/foo", cast_to=Model) + response = await async_client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 @pytest.mark.respx(base_url=base_url) - async def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: + async def test_idempotency_header_options(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) header = response.request.headers.get("Idempotency-Key") assert header is not None assert header.startswith("increase-python-retry") # explicit header - response = await self.client.post( + response = await async_client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"Idempotency-Key": "custom-key"}), ) assert response.request.headers.get("Idempotency-Key") == "custom-key" - response = await self.client.post( + response = await async_client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"idempotency-key": "custom-key"}), @@ -1419,12 +1453,12 @@ async def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: assert response.request.headers.get("Idempotency-Key") == "custom-key" # custom argument - response = await self.client.post( + response = await async_client.post( "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") ) assert response.request.headers.get("Idempotency-Key") == "custom-key" - def test_base_url_setter(self) -> None: + async def test_base_url_setter(self) -> None: client = AsyncIncrease( base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True ) @@ -1434,7 +1468,9 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" - def test_base_url_env(self) -> None: + await client.close() + + async def test_base_url_env(self) -> None: with update_env(INCREASE_BASE_URL="http://localhost:5000/from/env"): client = AsyncIncrease(api_key=api_key, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @@ -1449,6 +1485,8 @@ def test_base_url_env(self) -> None: ) assert str(client.base_url).startswith("https://api.increase.com") + await client.close() + @pytest.mark.parametrize( "client", [ @@ -1464,7 +1502,7 @@ def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_trailing_slash(self, client: AsyncIncrease) -> None: + async def test_base_url_trailing_slash(self, client: AsyncIncrease) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1473,6 +1511,7 @@ def test_base_url_trailing_slash(self, client: AsyncIncrease) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1489,7 +1528,7 @@ def test_base_url_trailing_slash(self, client: AsyncIncrease) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_no_trailing_slash(self, client: AsyncIncrease) -> None: + async def test_base_url_no_trailing_slash(self, client: AsyncIncrease) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1498,6 +1537,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncIncrease) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1514,7 +1554,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncIncrease) -> None: ], ids=["standard", "custom http client"], ) - def test_absolute_request_url(self, client: AsyncIncrease) -> None: + async def test_absolute_request_url(self, client: AsyncIncrease) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1523,37 +1563,37 @@ def test_absolute_request_url(self, client: AsyncIncrease) -> None: ), ) assert request.url == "https://myapi.com/foo" + await client.close() async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) - assert not client.is_closed() + test_client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied await asyncio.sleep(0.2) - assert not client.is_closed() + assert not test_client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) - async with client as c2: - assert c2 is client + test_client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) + async with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + async def test_client_response_validation_error(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - await self.client.get("/foo", cast_to=Model) + await async_client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -1564,7 +1604,6 @@ async def test_client_max_retries_validation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): name: str @@ -1576,11 +1615,14 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=False) + non_strict_client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=False) - response = await client.get("/foo", cast_to=Model) + response = await non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + await strict_client.close() + await non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -1603,13 +1645,12 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - @pytest.mark.asyncio - async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) - + async def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncIncrease + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) - calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("increase._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -1622,7 +1663,7 @@ async def test_retrying_timeout_errors_doesnt_leak( with pytest.raises(APITimeoutError): await async_client.accounts.with_streaming_response.create(name="New Account!").__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @mock.patch("increase._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1633,12 +1674,11 @@ async def test_retrying_status_errors_doesnt_leak( with pytest.raises(APIStatusError): await async_client.accounts.with_streaming_response.create(name="New Account!").__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("increase._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio @pytest.mark.parametrize("failure_mode", ["status", "exception"]) async def test_retries_taken( self, @@ -1670,7 +1710,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("increase._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_omit_retry_count_header( self, async_client: AsyncIncrease, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1696,7 +1735,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("increase._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_overwrite_retry_count_header( self, async_client: AsyncIncrease, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1746,26 +1784,26 @@ async def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = await async_client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncIncrease) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - await self.client.post( + await async_client.post( "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response ) From da7b55d2191378721e1ebf49acfde8e8b4dacbda Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 14:07:02 +0000 Subject: [PATCH 2/4] feat(api): api update --- .stats.yml | 4 +- src/increase/resources/wire_transfers.py | 100 ++++------------ src/increase/types/wire_transfer.py | 87 +++++++++----- .../types/wire_transfer_create_params.py | 111 +++++++++++------- tests/api_resources/test_wire_transfers.py | 86 +++++++++----- 5 files changed, 214 insertions(+), 174 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6a120e927..9256ec13b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2453598e129a8305006487bc7616f3ee69eb4355a6d3f185dd51404fa8142246.yml -openapi_spec_hash: e0b54d0015d39f9434659d8899bb2706 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-7689739a12916f3e4cc15be2e057e78b4ede38202bf4cf5f9358ef10374db9b3.yml +openapi_spec_hash: 39b4a0d5d1441d03ed9de368335d78ec config_hash: fc8a0ae068f2feeac76f728ac6838543 diff --git a/src/increase/resources/wire_transfers.py b/src/increase/resources/wire_transfers.py index 0ee8c5cbd..080468288 100644 --- a/src/increase/resources/wire_transfers.py +++ b/src/increase/resources/wire_transfers.py @@ -47,18 +47,12 @@ def create( *, account_id: str, amount: int, - beneficiary_name: str, + creditor: wire_transfer_create_params.Creditor, + remittance: wire_transfer_create_params.Remittance, account_number: str | Omit = omit, - beneficiary_address_line1: str | Omit = omit, - beneficiary_address_line2: str | Omit = omit, - beneficiary_address_line3: str | Omit = omit, + debtor: wire_transfer_create_params.Debtor | Omit = omit, external_account_id: str | Omit = omit, inbound_wire_drawdown_request_id: str | Omit = omit, - originator_address_line1: str | Omit = omit, - originator_address_line2: str | Omit = omit, - originator_address_line3: str | Omit = omit, - originator_name: str | Omit = omit, - remittance: wire_transfer_create_params.Remittance | Omit = omit, require_approval: bool | Omit = omit, routing_number: str | Omit = omit, source_account_number_id: str | Omit = omit, @@ -78,15 +72,15 @@ def create( amount: The transfer amount in USD cents. - beneficiary_name: The beneficiary's name. + creditor: The person or business that is receiving the funds from the transfer. - account_number: The account number for the destination account. - - beneficiary_address_line1: The beneficiary's address line 1. + remittance: Additional remittance information related to the wire transfer. - beneficiary_address_line2: The beneficiary's address line 2. + account_number: The account number for the destination account. - beneficiary_address_line3: The beneficiary's address line 3. + debtor: The person or business whose funds are being transferred. This is only necessary + if you're transferring from a commingled account. Otherwise, we'll use the + associated entity's details. external_account_id: The ID of an External Account to initiate a transfer to. If this parameter is provided, `account_number` and `routing_number` must be absent. @@ -94,20 +88,6 @@ def create( inbound_wire_drawdown_request_id: The ID of an Inbound Wire Drawdown Request in response to which this transfer is being sent. - originator_address_line1: The originator's address line 1. This is only necessary if you're transferring - from a commingled account. Otherwise, we'll use the associated entity's details. - - originator_address_line2: The originator's address line 2. This is only necessary if you're transferring - from a commingled account. Otherwise, we'll use the associated entity's details. - - originator_address_line3: The originator's address line 3. This is only necessary if you're transferring - from a commingled account. Otherwise, we'll use the associated entity's details. - - originator_name: The originator's name. This is only necessary if you're transferring from a - commingled account. Otherwise, we'll use the associated entity's details. - - remittance: Additional remittance information related to the wire transfer. - require_approval: Whether the transfer requires explicit approval via the dashboard or API. routing_number: The American Bankers' Association (ABA) Routing Transit Number (RTN) for the @@ -131,18 +111,12 @@ def create( { "account_id": account_id, "amount": amount, - "beneficiary_name": beneficiary_name, + "creditor": creditor, + "remittance": remittance, "account_number": account_number, - "beneficiary_address_line1": beneficiary_address_line1, - "beneficiary_address_line2": beneficiary_address_line2, - "beneficiary_address_line3": beneficiary_address_line3, + "debtor": debtor, "external_account_id": external_account_id, "inbound_wire_drawdown_request_id": inbound_wire_drawdown_request_id, - "originator_address_line1": originator_address_line1, - "originator_address_line2": originator_address_line2, - "originator_address_line3": originator_address_line3, - "originator_name": originator_name, - "remittance": remittance, "require_approval": require_approval, "routing_number": routing_number, "source_account_number_id": source_account_number_id, @@ -369,18 +343,12 @@ async def create( *, account_id: str, amount: int, - beneficiary_name: str, + creditor: wire_transfer_create_params.Creditor, + remittance: wire_transfer_create_params.Remittance, account_number: str | Omit = omit, - beneficiary_address_line1: str | Omit = omit, - beneficiary_address_line2: str | Omit = omit, - beneficiary_address_line3: str | Omit = omit, + debtor: wire_transfer_create_params.Debtor | Omit = omit, external_account_id: str | Omit = omit, inbound_wire_drawdown_request_id: str | Omit = omit, - originator_address_line1: str | Omit = omit, - originator_address_line2: str | Omit = omit, - originator_address_line3: str | Omit = omit, - originator_name: str | Omit = omit, - remittance: wire_transfer_create_params.Remittance | Omit = omit, require_approval: bool | Omit = omit, routing_number: str | Omit = omit, source_account_number_id: str | Omit = omit, @@ -400,15 +368,15 @@ async def create( amount: The transfer amount in USD cents. - beneficiary_name: The beneficiary's name. + creditor: The person or business that is receiving the funds from the transfer. - account_number: The account number for the destination account. - - beneficiary_address_line1: The beneficiary's address line 1. + remittance: Additional remittance information related to the wire transfer. - beneficiary_address_line2: The beneficiary's address line 2. + account_number: The account number for the destination account. - beneficiary_address_line3: The beneficiary's address line 3. + debtor: The person or business whose funds are being transferred. This is only necessary + if you're transferring from a commingled account. Otherwise, we'll use the + associated entity's details. external_account_id: The ID of an External Account to initiate a transfer to. If this parameter is provided, `account_number` and `routing_number` must be absent. @@ -416,20 +384,6 @@ async def create( inbound_wire_drawdown_request_id: The ID of an Inbound Wire Drawdown Request in response to which this transfer is being sent. - originator_address_line1: The originator's address line 1. This is only necessary if you're transferring - from a commingled account. Otherwise, we'll use the associated entity's details. - - originator_address_line2: The originator's address line 2. This is only necessary if you're transferring - from a commingled account. Otherwise, we'll use the associated entity's details. - - originator_address_line3: The originator's address line 3. This is only necessary if you're transferring - from a commingled account. Otherwise, we'll use the associated entity's details. - - originator_name: The originator's name. This is only necessary if you're transferring from a - commingled account. Otherwise, we'll use the associated entity's details. - - remittance: Additional remittance information related to the wire transfer. - require_approval: Whether the transfer requires explicit approval via the dashboard or API. routing_number: The American Bankers' Association (ABA) Routing Transit Number (RTN) for the @@ -453,18 +407,12 @@ async def create( { "account_id": account_id, "amount": amount, - "beneficiary_name": beneficiary_name, + "creditor": creditor, + "remittance": remittance, "account_number": account_number, - "beneficiary_address_line1": beneficiary_address_line1, - "beneficiary_address_line2": beneficiary_address_line2, - "beneficiary_address_line3": beneficiary_address_line3, + "debtor": debtor, "external_account_id": external_account_id, "inbound_wire_drawdown_request_id": inbound_wire_drawdown_request_id, - "originator_address_line1": originator_address_line1, - "originator_address_line2": originator_address_line2, - "originator_address_line3": originator_address_line3, - "originator_name": originator_name, - "remittance": remittance, "require_approval": require_approval, "routing_number": routing_number, "source_account_number_id": source_account_number_id, diff --git a/src/increase/types/wire_transfer.py b/src/increase/types/wire_transfer.py index c1bfb0d6f..f0132b3f4 100644 --- a/src/increase/types/wire_transfer.py +++ b/src/increase/types/wire_transfer.py @@ -14,6 +14,12 @@ "CreatedByAPIKey", "CreatedByOAuthApplication", "CreatedByUser", + "Creditor", + "CreditorAddress", + "CreditorAddressUnstructured", + "Debtor", + "DebtorAddress", + "DebtorAddressUnstructured", "Remittance", "RemittanceTax", "RemittanceUnstructured", @@ -86,6 +92,54 @@ class CreatedBy(BaseModel): """If present, details about the User that created the transfer.""" +class CreditorAddressUnstructured(BaseModel): + line1: Optional[str] = None + """The first line.""" + + line2: Optional[str] = None + """The second line.""" + + line3: Optional[str] = None + """The third line.""" + + +class CreditorAddress(BaseModel): + unstructured: Optional[CreditorAddressUnstructured] = None + """Unstructured address lines.""" + + +class Creditor(BaseModel): + address: Optional[CreditorAddress] = None + """The person or business's address.""" + + name: Optional[str] = None + """The person or business's name.""" + + +class DebtorAddressUnstructured(BaseModel): + line1: Optional[str] = None + """The first line.""" + + line2: Optional[str] = None + """The second line.""" + + line3: Optional[str] = None + """The third line.""" + + +class DebtorAddress(BaseModel): + unstructured: Optional[DebtorAddressUnstructured] = None + """Unstructured address lines.""" + + +class Debtor(BaseModel): + address: Optional[DebtorAddress] = None + """The person or business's address.""" + + name: Optional[str] = None + """The person or business's name.""" + + class RemittanceTax(BaseModel): date: datetime.date """The month and year the tax payment is for, in YYYY-MM-DD format. @@ -215,18 +269,6 @@ class WireTransfer(BaseModel): this will contain details of the approval. """ - beneficiary_address_line1: Optional[str] = None - """The beneficiary's address line 1.""" - - beneficiary_address_line2: Optional[str] = None - """The beneficiary's address line 2.""" - - beneficiary_address_line3: Optional[str] = None - """The beneficiary's address line 3.""" - - beneficiary_name: Optional[str] = None - """The beneficiary's name.""" - cancellation: Optional[Cancellation] = None """ If your account requires approvals for transfers and the transfer was not @@ -242,6 +284,9 @@ class WireTransfer(BaseModel): created_by: Optional[CreatedBy] = None """What object created the transfer, either via the API or the dashboard.""" + creditor: Optional[Creditor] = None + """The person or business that is receiving the funds from the transfer.""" + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's @@ -255,6 +300,9 @@ class WireTransfer(BaseModel): - `USD` - US Dollar (USD) """ + debtor: Optional[Debtor] = None + """The person or business whose funds are being transferred.""" + external_account_id: Optional[str] = None """The identifier of the External Account the transfer was made to, if any.""" @@ -272,24 +320,9 @@ class WireTransfer(BaseModel): was sent. """ - message_to_recipient: str - """The message that will show on the recipient's bank statement.""" - network: Literal["wire"] """The transfer's network.""" - originator_address_line1: Optional[str] = None - """The originator's address line 1.""" - - originator_address_line2: Optional[str] = None - """The originator's address line 2.""" - - originator_address_line3: Optional[str] = None - """The originator's address line 3.""" - - originator_name: Optional[str] = None - """The originator's name.""" - pending_transaction_id: Optional[str] = None """The ID for the pending transaction representing the transfer. diff --git a/src/increase/types/wire_transfer_create_params.py b/src/increase/types/wire_transfer_create_params.py index e9361645d..6786b5629 100644 --- a/src/increase/types/wire_transfer_create_params.py +++ b/src/increase/types/wire_transfer_create_params.py @@ -8,7 +8,18 @@ from .._utils import PropertyInfo -__all__ = ["WireTransferCreateParams", "Remittance", "RemittanceTax", "RemittanceUnstructured"] +__all__ = [ + "WireTransferCreateParams", + "Creditor", + "CreditorAddress", + "CreditorAddressUnstructured", + "Remittance", + "RemittanceTax", + "RemittanceUnstructured", + "Debtor", + "DebtorAddress", + "DebtorAddressUnstructured", +] class WireTransferCreateParams(TypedDict, total=False): @@ -18,20 +29,21 @@ class WireTransferCreateParams(TypedDict, total=False): amount: Required[int] """The transfer amount in USD cents.""" - beneficiary_name: Required[str] - """The beneficiary's name.""" + creditor: Required[Creditor] + """The person or business that is receiving the funds from the transfer.""" + + remittance: Required[Remittance] + """Additional remittance information related to the wire transfer.""" account_number: str """The account number for the destination account.""" - beneficiary_address_line1: str - """The beneficiary's address line 1.""" - - beneficiary_address_line2: str - """The beneficiary's address line 2.""" + debtor: Debtor + """The person or business whose funds are being transferred. - beneficiary_address_line3: str - """The beneficiary's address line 3.""" + This is only necessary if you're transferring from a commingled account. + Otherwise, we'll use the associated entity's details. + """ external_account_id: str """The ID of an External Account to initiate a transfer to. @@ -46,48 +58,41 @@ class WireTransferCreateParams(TypedDict, total=False): being sent. """ - originator_address_line1: str - """The originator's address line 1. + require_approval: bool + """Whether the transfer requires explicit approval via the dashboard or API.""" - This is only necessary if you're transferring from a commingled account. - Otherwise, we'll use the associated entity's details. + routing_number: str + """ + The American Bankers' Association (ABA) Routing Transit Number (RTN) for the + destination account. """ - originator_address_line2: str - """The originator's address line 2. + source_account_number_id: str + """The ID of an Account Number that will be passed to the wire's recipient""" - This is only necessary if you're transferring from a commingled account. - Otherwise, we'll use the associated entity's details. - """ - originator_address_line3: str - """The originator's address line 3. +class CreditorAddressUnstructured(TypedDict, total=False): + line1: Required[str] + """The address line 1.""" - This is only necessary if you're transferring from a commingled account. - Otherwise, we'll use the associated entity's details. - """ + line2: str + """The address line 2.""" - originator_name: str - """The originator's name. + line3: str + """The address line 3.""" - This is only necessary if you're transferring from a commingled account. - Otherwise, we'll use the associated entity's details. - """ - remittance: Remittance - """Additional remittance information related to the wire transfer.""" +class CreditorAddress(TypedDict, total=False): + unstructured: Required[CreditorAddressUnstructured] + """Unstructured address lines.""" - require_approval: bool - """Whether the transfer requires explicit approval via the dashboard or API.""" - routing_number: str - """ - The American Bankers' Association (ABA) Routing Transit Number (RTN) for the - destination account. - """ +class Creditor(TypedDict, total=False): + name: Required[str] + """The person or business's name.""" - source_account_number_id: str - """The ID of an Account Number that will be passed to the wire's recipient""" + address: CreditorAddress + """The person or business's address.""" class RemittanceTax(TypedDict, total=False): @@ -109,7 +114,7 @@ class RemittanceTax(TypedDict, total=False): class RemittanceUnstructured(TypedDict, total=False): message: Required[str] - """The message to the beneficiary.""" + """The information.""" class Remittance(TypedDict, total=False): @@ -133,3 +138,27 @@ class Remittance(TypedDict, total=False): Required if `category` is equal to `unstructured`. """ + + +class DebtorAddressUnstructured(TypedDict, total=False): + line1: Required[str] + """The address line 1.""" + + line2: str + """The address line 2.""" + + line3: str + """The address line 3.""" + + +class DebtorAddress(TypedDict, total=False): + unstructured: Required[DebtorAddressUnstructured] + """Unstructured address lines.""" + + +class Debtor(TypedDict, total=False): + name: Required[str] + """The person or business's name.""" + + address: DebtorAddress + """The person or business's address.""" diff --git a/tests/api_resources/test_wire_transfers.py b/tests/api_resources/test_wire_transfers.py index b2d2884e4..e68b36452 100644 --- a/tests/api_resources/test_wire_transfers.py +++ b/tests/api_resources/test_wire_transfers.py @@ -24,7 +24,8 @@ def test_method_create(self, client: Increase) -> None: wire_transfer = client.wire_transfers.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", + creditor={"name": "Ian Crease"}, + remittance={"category": "unstructured"}, ) assert_matches_type(WireTransfer, wire_transfer, path=["response"]) @@ -33,17 +34,16 @@ def test_method_create_with_all_params(self, client: Increase) -> None: wire_transfer = client.wire_transfers.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", - account_number="987654321", - beneficiary_address_line1="33 Liberty Street", - beneficiary_address_line2="New York", - beneficiary_address_line3="NY 10045", - external_account_id="external_account_id", - inbound_wire_drawdown_request_id="inbound_wire_drawdown_request_id", - originator_address_line1="x", - originator_address_line2="x", - originator_address_line3="x", - originator_name="x", + creditor={ + "name": "Ian Crease", + "address": { + "unstructured": { + "line1": "33 Liberty Street", + "line2": "New York", + "line3": "NY 10045", + } + }, + }, remittance={ "category": "unstructured", "tax": { @@ -53,6 +53,19 @@ def test_method_create_with_all_params(self, client: Increase) -> None: }, "unstructured": {"message": "New account transfer"}, }, + account_number="987654321", + debtor={ + "name": "x", + "address": { + "unstructured": { + "line1": "x", + "line2": "x", + "line3": "x", + } + }, + }, + external_account_id="external_account_id", + inbound_wire_drawdown_request_id="inbound_wire_drawdown_request_id", require_approval=True, routing_number="101050001", source_account_number_id="source_account_number_id", @@ -64,7 +77,8 @@ def test_raw_response_create(self, client: Increase) -> None: response = client.wire_transfers.with_raw_response.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", + creditor={"name": "Ian Crease"}, + remittance={"category": "unstructured"}, ) assert response.is_closed is True @@ -77,7 +91,8 @@ def test_streaming_response_create(self, client: Increase) -> None: with client.wire_transfers.with_streaming_response.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", + creditor={"name": "Ian Crease"}, + remittance={"category": "unstructured"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,7 +269,8 @@ async def test_method_create(self, async_client: AsyncIncrease) -> None: wire_transfer = await async_client.wire_transfers.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", + creditor={"name": "Ian Crease"}, + remittance={"category": "unstructured"}, ) assert_matches_type(WireTransfer, wire_transfer, path=["response"]) @@ -263,17 +279,16 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease) wire_transfer = await async_client.wire_transfers.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", - account_number="987654321", - beneficiary_address_line1="33 Liberty Street", - beneficiary_address_line2="New York", - beneficiary_address_line3="NY 10045", - external_account_id="external_account_id", - inbound_wire_drawdown_request_id="inbound_wire_drawdown_request_id", - originator_address_line1="x", - originator_address_line2="x", - originator_address_line3="x", - originator_name="x", + creditor={ + "name": "Ian Crease", + "address": { + "unstructured": { + "line1": "33 Liberty Street", + "line2": "New York", + "line3": "NY 10045", + } + }, + }, remittance={ "category": "unstructured", "tax": { @@ -283,6 +298,19 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease) }, "unstructured": {"message": "New account transfer"}, }, + account_number="987654321", + debtor={ + "name": "x", + "address": { + "unstructured": { + "line1": "x", + "line2": "x", + "line3": "x", + } + }, + }, + external_account_id="external_account_id", + inbound_wire_drawdown_request_id="inbound_wire_drawdown_request_id", require_approval=True, routing_number="101050001", source_account_number_id="source_account_number_id", @@ -294,7 +322,8 @@ async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: response = await async_client.wire_transfers.with_raw_response.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", + creditor={"name": "Ian Crease"}, + remittance={"category": "unstructured"}, ) assert response.is_closed is True @@ -307,7 +336,8 @@ async def test_streaming_response_create(self, async_client: AsyncIncrease) -> N async with async_client.wire_transfers.with_streaming_response.create( account_id="account_in71c4amph0vgo2qllky", amount=100, - beneficiary_name="Ian Crease", + creditor={"name": "Ian Crease"}, + remittance={"category": "unstructured"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From d705fa1a03274a1b31c73f40e5754445d4503184 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 18:05:06 +0000 Subject: [PATCH 3/4] feat(api): api update --- .stats.yml | 6 +- src/increase/_exceptions.py | 6 +- src/increase/types/account.py | 16 +- src/increase/types/account_number.py | 16 +- src/increase/types/account_transfer.py | 16 +- src/increase/types/ach_transfer.py | 38 +- src/increase/types/card.py | 16 +- src/increase/types/card_dispute.py | 16 +- src/increase/types/card_payment.py | 136 +++++- .../types/card_purchase_supplement.py | 16 +- src/increase/types/card_push_transfer.py | 16 +- src/increase/types/card_validation.py | 16 +- src/increase/types/check_deposit.py | 64 ++- src/increase/types/check_transfer.py | 64 ++- src/increase/types/declined_transaction.py | 100 +++- src/increase/types/entity.py | 64 ++- src/increase/types/external_account.py | 16 +- src/increase/types/file.py | 16 +- src/increase/types/inbound_fednow_transfer.py | 28 +- src/increase/types/inbound_mail_item.py | 16 +- .../types/inbound_wire_drawdown_request.py | 16 +- src/increase/types/inbound_wire_transfer.py | 16 +- src/increase/types/pending_transaction.py | 150 +++++- src/increase/types/physical_card_profile.py | 16 +- src/increase/types/real_time_decision.py | 16 +- .../types/real_time_payments_transfer.py | 16 +- src/increase/types/transaction.py | 448 +++++++++++++++++- src/increase/types/wire_transfer.py | 28 +- 28 files changed, 1342 insertions(+), 46 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9256ec13b..7f33565d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-7689739a12916f3e4cc15be2e057e78b4ede38202bf4cf5f9358ef10374db9b3.yml -openapi_spec_hash: 39b4a0d5d1441d03ed9de368335d78ec -config_hash: fc8a0ae068f2feeac76f728ac6838543 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fd1e9a0d66098ce0c20cb6c15bbb8c26a8662d52730907deb4a179aebd6b89d6.yml +openapi_spec_hash: 2139b75a9f653c413775fb96f70ba794 +config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/src/increase/_exceptions.py b/src/increase/_exceptions.py index aa472b775..40ea13832 100644 --- a/src/increase/_exceptions.py +++ b/src/increase/_exceptions.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Mapping, Optional, cast +from typing import Any, Dict, List, Mapping, Optional, cast from typing_extensions import Literal import httpx @@ -122,7 +122,7 @@ class RateLimitError(APIStatusError): class InvalidParametersError(BadRequestError): detail: Optional[str] = None - errors: List[object] + errors: List[Dict[str, object]] """All errors related to parsing the request parameters.""" status: Literal[400] @@ -138,7 +138,7 @@ def __init__(self, message: str, *, body: object, response: httpx.Response) -> N self.title = title self.detail = cast(Any, construct_type(type_=Optional[str], value=data.get("detail"))) - self.errors = cast(Any, construct_type(type_=List[object], value=data.get("errors"))) + self.errors = cast(Any, construct_type(type_=List[Dict[str, object]], value=data.get("errors"))) self.status = cast(Any, construct_type(type_=Literal[400], value=data.get("status"))) self.type = cast(Any, construct_type(type_=Literal["invalid_parameters_error"], value=data.get("type"))) diff --git a/src/increase/types/account.py b/src/increase/types/account.py index a10f4b4ee..468c92274 100644 --- a/src/increase/types/account.py +++ b/src/increase/types/account.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import date, datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["Account"] @@ -111,3 +113,15 @@ class Account(BaseModel): For this resource it will always be `account`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/account_number.py b/src/increase/types/account_number.py index 5c5921561..5d0cade9a 100644 --- a/src/increase/types/account_number.py +++ b/src/increase/types/account_number.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["AccountNumber", "InboundACH", "InboundChecks"] @@ -84,3 +86,15 @@ class AccountNumber(BaseModel): For this resource it will always be `account_number`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/account_transfer.py b/src/increase/types/account_transfer.py index 727af025b..a2b627c00 100644 --- a/src/increase/types/account_transfer.py +++ b/src/increase/types/account_transfer.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -180,3 +182,15 @@ class AccountTransfer(BaseModel): For this resource it will always be `account_transfer`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/ach_transfer.py b/src/increase/types/ach_transfer.py index f2305dbf6..b405e01b6 100644 --- a/src/increase/types/ach_transfer.py +++ b/src/increase/types/ach_transfer.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import datetime -from typing import List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -209,6 +209,18 @@ class InboundFundsHold(BaseModel): For this resource it will always be `inbound_funds_hold`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class NotificationsOfChange(BaseModel): change_code: Literal[ @@ -557,6 +569,18 @@ class Return(BaseModel): transfer_id: str """The identifier of the ACH Transfer associated with this return.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Settlement(BaseModel): settled_at: datetime.datetime @@ -836,3 +860,15 @@ class ACHTransfer(BaseModel): For this resource it will always be `ach_transfer`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/card.py b/src/increase/types/card.py index 6e96d690b..46025eb85 100644 --- a/src/increase/types/card.py +++ b/src/increase/types/card.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["Card", "BillingAddress", "DigitalWallet"] @@ -105,3 +107,15 @@ class Card(BaseModel): For this resource it will always be `card`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/card_dispute.py b/src/increase/types/card_dispute.py index fc04b7a5e..eced5df31 100644 --- a/src/increase/types/card_dispute.py +++ b/src/increase/types/card_dispute.py @@ -25,7 +25,6 @@ "VisaNetworkEventRepresentedCardholderNoLongerDisputes", "VisaNetworkEventRepresentedCreditOrReversalProcessed", "VisaNetworkEventRepresentedInvalidDispute", - "VisaNetworkEventRepresentedNonFiatCurrencyOrNonFungibleTokenAsDescribed", "VisaNetworkEventRepresentedNonFiatCurrencyOrNonFungibleTokenReceived", "VisaNetworkEventRepresentedProofOfCashDisbursement", "VisaNetworkEventRepresentedReversalIssued", @@ -60,7 +59,6 @@ "VisaUserSubmissionChargebackConsumerMerchandiseNotReceivedDelayedReturned", "VisaUserSubmissionChargebackConsumerMerchandiseNotReceivedDeliveredToWrongLocation", "VisaUserSubmissionChargebackConsumerMerchandiseNotReceivedMerchantCancellation", - "VisaUserSubmissionChargebackConsumerNonReceiptOfCash", "VisaUserSubmissionChargebackConsumerOriginalCreditTransactionNotAccepted", "VisaUserSubmissionChargebackConsumerQualityMerchandise", "VisaUserSubmissionChargebackConsumerQualityMerchandiseOngoingNegotiations", @@ -443,10 +441,6 @@ class VisaNetworkEventRepresentedInvalidDispute(BaseModel): """ -class VisaNetworkEventRepresentedNonFiatCurrencyOrNonFungibleTokenAsDescribed(BaseModel): - pass - - class VisaNetworkEventRepresentedNonFiatCurrencyOrNonFungibleTokenReceived(BaseModel): blockchain_transaction_hash: str """Blockchain transaction hash.""" @@ -487,9 +481,7 @@ class VisaNetworkEventRepresented(BaseModel): invalid_dispute: Optional[VisaNetworkEventRepresentedInvalidDispute] = None """Invalid dispute details. Present if and only if `reason` is `invalid_dispute`.""" - non_fiat_currency_or_non_fungible_token_as_described: Optional[ - VisaNetworkEventRepresentedNonFiatCurrencyOrNonFungibleTokenAsDescribed - ] = None + non_fiat_currency_or_non_fungible_token_as_described: Optional[object] = None """Non-fiat currency or non-fungible token as described details. Present if and only if `reason` is @@ -1371,10 +1363,6 @@ class VisaUserSubmissionChargebackConsumerMerchandiseNotReceived(BaseModel): """Purchase information and explanation.""" -class VisaUserSubmissionChargebackConsumerNonReceiptOfCash(BaseModel): - pass - - class VisaUserSubmissionChargebackConsumerOriginalCreditTransactionNotAccepted(BaseModel): explanation: str """Explanation.""" @@ -1897,7 +1885,7 @@ class VisaUserSubmissionChargeback(BaseModel): Present if and only if `category` is `consumer_merchandise_not_received`. """ - consumer_non_receipt_of_cash: Optional[VisaUserSubmissionChargebackConsumerNonReceiptOfCash] = None + consumer_non_receipt_of_cash: Optional[object] = None """Non-receipt of cash. Present if and only if `category` is `consumer_non_receipt_of_cash`. diff --git a/src/increase/types/card_payment.py b/src/increase/types/card_payment.py index f649681fa..6bcb0e4e1 100644 --- a/src/increase/types/card_payment.py +++ b/src/increase/types/card_payment.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from datetime import date, datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -295,6 +297,18 @@ class ElementCardAuthentication(BaseModel): For this resource it will always be `card_authentication`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardAuthorizationAdditionalAmountsClinic(BaseModel): amount: int @@ -889,6 +903,18 @@ class ElementCardAuthorization(BaseModel): verification: ElementCardAuthorizationVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardAuthorizationExpiration(BaseModel): id: str @@ -929,6 +955,18 @@ class ElementCardAuthorizationExpiration(BaseModel): For this resource it will always be `card_authorization_expiration`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardDeclineAdditionalAmountsClinic(BaseModel): amount: int @@ -1602,6 +1640,18 @@ class ElementCardDecline(BaseModel): verification: ElementCardDeclineVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardFinancialAdditionalAmountsClinic(BaseModel): amount: int @@ -2190,6 +2240,18 @@ class ElementCardFinancial(BaseModel): verification: ElementCardFinancialVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardFuelConfirmationNetworkIdentifiers(BaseModel): authorization_identification_response: Optional[str] = None @@ -2266,6 +2328,18 @@ class ElementCardFuelConfirmation(BaseModel): of the transaction's currency. For dollars, for example, this is cents. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardIncrementAdditionalAmountsClinic(BaseModel): amount: int @@ -2572,6 +2646,18 @@ class ElementCardIncrement(BaseModel): transaction's currency. For dollars, for example, this is cents. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardRefundCashback(BaseModel): amount: str @@ -3135,6 +3221,18 @@ class ElementCardRefund(BaseModel): For this resource it will always be `card_refund`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardReversalNetworkIdentifiers(BaseModel): authorization_identification_response: Optional[str] = None @@ -3285,6 +3383,18 @@ class ElementCardReversal(BaseModel): transaction's presentment currency. For dollars, for example, this is cents. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardSettlementCashback(BaseModel): amount: str @@ -3885,6 +3995,18 @@ class ElementCardSettlement(BaseModel): For this resource it will always be `card_settlement`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ElementCardValidationAdditionalAmountsClinic(BaseModel): amount: int @@ -4410,6 +4532,18 @@ class ElementCardValidation(BaseModel): verification: ElementCardValidationVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Element(BaseModel): card_authentication: Optional[ElementCardAuthentication] = None diff --git a/src/increase/types/card_purchase_supplement.py b/src/increase/types/card_purchase_supplement.py index 85d9f60ed..6b063db88 100644 --- a/src/increase/types/card_purchase_supplement.py +++ b/src/increase/types/card_purchase_supplement.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from datetime import date from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["CardPurchaseSupplement", "Invoice", "LineItem"] @@ -191,3 +193,15 @@ class CardPurchaseSupplement(BaseModel): For this resource it will always be `card_purchase_supplement`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/card_push_transfer.py b/src/increase/types/card_push_transfer.py index d659da368..516072251 100644 --- a/src/increase/types/card_push_transfer.py +++ b/src/increase/types/card_push_transfer.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -449,3 +451,15 @@ class CardPushTransfer(BaseModel): For this resource it will always be `card_push_transfer`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/card_validation.py b/src/increase/types/card_validation.py index 1fe048745..3ce823044 100644 --- a/src/increase/types/card_validation.py +++ b/src/increase/types/card_validation.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -380,3 +382,15 @@ class CardValidation(BaseModel): For this resource it will always be `card_validation`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/check_deposit.py b/src/increase/types/check_deposit.py index 9d2afbee7..4f6cd1a2d 100644 --- a/src/increase/types/check_deposit.py +++ b/src/increase/types/check_deposit.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -64,6 +66,18 @@ class DepositAcceptance(BaseModel): field. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class DepositRejection(BaseModel): amount: int @@ -128,6 +142,18 @@ class DepositRejection(BaseModel): the check deposit was rejected. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class DepositReturn(BaseModel): amount: int @@ -236,6 +262,18 @@ class DepositReturn(BaseModel): transaction. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class DepositSubmission(BaseModel): back_file_id: str @@ -312,6 +350,18 @@ class InboundFundsHold(BaseModel): For this resource it will always be `inbound_funds_hold`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class CheckDeposit(BaseModel): id: str @@ -406,3 +456,15 @@ class CheckDeposit(BaseModel): For this resource it will always be `check_deposit`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/check_transfer.py b/src/increase/types/check_transfer.py index d955b0a3d..e42b1e670 100644 --- a/src/increase/types/check_transfer.py +++ b/src/increase/types/check_transfer.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -215,6 +217,18 @@ class PhysicalCheck(BaseModel): tracking_updates: List[PhysicalCheckTrackingUpdate] """Tracking updates relating to the physical check's delivery.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class StopPaymentRequest(BaseModel): reason: Literal["mail_delivery_failed", "rejected_by_increase", "not_authorized", "unknown"] @@ -239,6 +253,18 @@ class StopPaymentRequest(BaseModel): For this resource it will always be `check_transfer_stop_payment_request`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SubmissionSubmittedAddress(BaseModel): city: str @@ -285,11 +311,35 @@ class Submission(BaseModel): submitted_at: datetime """When this check transfer was submitted to our check printer.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class ThirdParty(BaseModel): recipient_name: Optional[str] = None """The name that you will print on the check.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class CheckTransfer(BaseModel): id: str @@ -451,3 +501,15 @@ class CheckTransfer(BaseModel): For this resource it will always be `check_transfer`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/declined_transaction.py b/src/increase/types/declined_transaction.py index 63e486271..c6fdabf0b 100644 --- a/src/increase/types/declined_transaction.py +++ b/src/increase/types/declined_transaction.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -122,6 +124,18 @@ class SourceACHDecline(BaseModel): For this resource it will always be `ach_decline`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardDeclineAdditionalAmountsClinic(BaseModel): amount: int @@ -795,6 +809,18 @@ class SourceCardDecline(BaseModel): verification: SourceCardDeclineVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCheckDecline(BaseModel): amount: int @@ -873,6 +899,18 @@ class SourceCheckDecline(BaseModel): - `user_initiated` - Your integration declined this check via the API. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCheckDepositRejection(BaseModel): amount: int @@ -937,6 +975,18 @@ class SourceCheckDepositRejection(BaseModel): the check deposit was rejected. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundFednowTransferDecline(BaseModel): reason: Literal[ @@ -961,6 +1011,18 @@ class SourceInboundFednowTransferDecline(BaseModel): transfer_id: str """The identifier of the FedNow Transfer that led to this declined transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundRealTimePaymentsTransferDecline(BaseModel): amount: int @@ -1047,6 +1109,18 @@ class SourceWireDecline(BaseModel): terms. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Source(BaseModel): ach_decline: Optional[SourceACHDecline] = None @@ -1137,6 +1211,18 @@ class Source(BaseModel): equal to `wire_decline`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class DeclinedTransaction(BaseModel): id: str @@ -1202,3 +1288,15 @@ class DeclinedTransaction(BaseModel): For this resource it will always be `declined_transaction`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/entity.py b/src/increase/types/entity.py index 2bd94c198..3415982ef 100644 --- a/src/increase/types/entity.py +++ b/src/increase/types/entity.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from datetime import date, datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel from .entity_supplemental_document import EntitySupplementalDocument @@ -102,6 +104,18 @@ class CorporationBeneficialOwnerIndividualIdentification(BaseModel): individual's identity. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class CorporationBeneficialOwnerIndividual(BaseModel): address: CorporationBeneficialOwnerIndividualAddress @@ -263,6 +277,18 @@ class JointIndividualIdentification(BaseModel): individual's identity. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class JointIndividual(BaseModel): address: JointIndividualAddress @@ -326,6 +352,18 @@ class NaturalPersonIdentification(BaseModel): individual's identity. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class NaturalPerson(BaseModel): address: NaturalPersonAddress @@ -430,6 +468,18 @@ class TrustGrantorIdentification(BaseModel): individual's identity. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class TrustGrantor(BaseModel): address: TrustGrantorAddress @@ -485,6 +535,18 @@ class TrustTrusteeIndividualIdentification(BaseModel): individual's identity. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class TrustTrusteeIndividual(BaseModel): address: TrustTrusteeIndividualAddress diff --git a/src/increase/types/external_account.py b/src/increase/types/external_account.py index 42c40dcf9..c0cfac121 100644 --- a/src/increase/types/external_account.py +++ b/src/increase/types/external_account.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["ExternalAccount"] @@ -66,3 +68,15 @@ class ExternalAccount(BaseModel): For this resource it will always be `external_account`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/file.py b/src/increase/types/file.py index 73af3da80..1675fba58 100644 --- a/src/increase/types/file.py +++ b/src/increase/types/file.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["File"] @@ -125,3 +127,15 @@ class File(BaseModel): For this resource it will always be `file`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/inbound_fednow_transfer.py b/src/increase/types/inbound_fednow_transfer.py index 78c915104..6dc720184 100644 --- a/src/increase/types/inbound_fednow_transfer.py +++ b/src/increase/types/inbound_fednow_transfer.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["InboundFednowTransfer", "Confirmation", "Decline"] @@ -13,6 +15,18 @@ class Confirmation(BaseModel): transfer_id: str """The identifier of the FedNow Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Decline(BaseModel): reason: Literal[ @@ -37,6 +51,18 @@ class Decline(BaseModel): transfer_id: str """The identifier of the FedNow Transfer that led to this declined transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class InboundFednowTransfer(BaseModel): id: str diff --git a/src/increase/types/inbound_mail_item.py b/src/increase/types/inbound_mail_item.py index 3e1660b2d..5386061b7 100644 --- a/src/increase/types/inbound_mail_item.py +++ b/src/increase/types/inbound_mail_item.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["InboundMailItem", "Check"] @@ -67,3 +69,15 @@ class InboundMailItem(BaseModel): For this resource it will always be `inbound_mail_item`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/inbound_wire_drawdown_request.py b/src/increase/types/inbound_wire_drawdown_request.py index 3810c3424..eba97035f 100644 --- a/src/increase/types/inbound_wire_drawdown_request.py +++ b/src/increase/types/inbound_wire_drawdown_request.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["InboundWireDrawdownRequest"] @@ -95,3 +97,15 @@ class InboundWireDrawdownRequest(BaseModel): unstructured_remittance_information: Optional[str] = None """A free-form message set by the sender.""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/inbound_wire_transfer.py b/src/increase/types/inbound_wire_transfer.py index 07c638079..0eab26d60 100644 --- a/src/increase/types/inbound_wire_transfer.py +++ b/src/increase/types/inbound_wire_transfer.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["InboundWireTransfer", "Reversal"] @@ -124,3 +126,15 @@ class InboundWireTransfer(BaseModel): wire_drawdown_request_id: Optional[str] = None """The wire drawdown request the inbound wire transfer is fulfilling.""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/pending_transaction.py b/src/increase/types/pending_transaction.py index e4d75174a..bebe00811 100644 --- a/src/increase/types/pending_transaction.py +++ b/src/increase/types/pending_transaction.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -64,6 +66,18 @@ class SourceAccountTransferInstruction(BaseModel): transfer_id: str """The identifier of the Account Transfer that led to this Pending Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceACHTransferInstruction(BaseModel): amount: int @@ -72,6 +86,18 @@ class SourceACHTransferInstruction(BaseModel): transfer_id: str """The identifier of the ACH Transfer that led to this Pending Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardAuthorizationAdditionalAmountsClinic(BaseModel): amount: int @@ -666,6 +692,18 @@ class SourceCardAuthorization(BaseModel): verification: SourceCardAuthorizationVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardPushTransferInstruction(BaseModel): amount: int @@ -707,6 +745,18 @@ class SourceCheckDepositInstruction(BaseModel): was deposited. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCheckTransferInstruction(BaseModel): amount: int @@ -728,11 +778,35 @@ class SourceCheckTransferInstruction(BaseModel): transfer_id: str """The identifier of the Check Transfer that led to this Pending Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceFednowTransferInstruction(BaseModel): transfer_id: str """The identifier of the FedNow Transfer that led to this Pending Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundFundsHold(BaseModel): amount: int @@ -788,11 +862,35 @@ class SourceInboundFundsHold(BaseModel): For this resource it will always be `inbound_funds_hold`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundWireTransferReversal(BaseModel): inbound_wire_transfer_id: str """The ID of the Inbound Wire Transfer that is being reversed.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceRealTimePaymentsTransferInstruction(BaseModel): amount: int @@ -809,6 +907,18 @@ class SourceSwiftTransferInstruction(BaseModel): transfer_id: str """The identifier of the Swift Transfer that led to this Pending Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceWireTransferInstruction(BaseModel): account_number: str @@ -829,6 +939,18 @@ class SourceWireTransferInstruction(BaseModel): transfer_id: str """The identifier of the Wire Transfer that led to this Pending Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Source(BaseModel): account_transfer_instruction: Optional[SourceAccountTransferInstruction] = None @@ -971,7 +1093,7 @@ class Source(BaseModel): equal to `swift_transfer_instruction`. """ - user_initiated_hold: Optional[object] = None + user_initiated_hold: Optional[Dict[str, object]] = None """An User Initiated Hold object. This field will be present in the JSON response if and only if `category` is @@ -986,6 +1108,18 @@ class Source(BaseModel): equal to `wire_transfer_instruction`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class PendingTransaction(BaseModel): id: str @@ -1081,3 +1215,15 @@ class PendingTransaction(BaseModel): For this resource it will always be `pending_transaction`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/physical_card_profile.py b/src/increase/types/physical_card_profile.py index 77eb2ac30..dac8be685 100644 --- a/src/increase/types/physical_card_profile.py +++ b/src/increase/types/physical_card_profile.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = ["PhysicalCardProfile"] @@ -77,3 +79,15 @@ class PhysicalCardProfile(BaseModel): For this resource it will always be `physical_card_profile`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/real_time_decision.py b/src/increase/types/real_time_decision.py index 5489e91c5..3e3c971c6 100644 --- a/src/increase/types/real_time_decision.py +++ b/src/increase/types/real_time_decision.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -700,6 +702,18 @@ class CardAuthorization(BaseModel): verification: CardAuthorizationVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class DigitalWalletAuthentication(BaseModel): card_id: str diff --git a/src/increase/types/real_time_payments_transfer.py b/src/increase/types/real_time_payments_transfer.py index eec89c8f8..07b182dd7 100644 --- a/src/increase/types/real_time_payments_transfer.py +++ b/src/increase/types/real_time_payments_transfer.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -346,3 +348,15 @@ class RealTimePaymentsTransfer(BaseModel): Set this if the funds are being sent on behalf of someone who is not the account holder at Increase. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/transaction.py b/src/increase/types/transaction.py index d84a4d124..3512af64e 100644 --- a/src/increase/types/transaction.py +++ b/src/increase/types/transaction.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from datetime import date, datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -99,6 +101,18 @@ class SourceAccountRevenuePayment(BaseModel): period_start: datetime """The start of the period for which this transaction paid account revenue.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceAccountTransferIntention(BaseModel): amount: int @@ -132,6 +146,18 @@ class SourceAccountTransferIntention(BaseModel): transfer_id: str """The identifier of the Account Transfer that led to this Pending Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceACHTransferIntention(BaseModel): account_number: str @@ -155,11 +181,35 @@ class SourceACHTransferIntention(BaseModel): transfer_id: str """The identifier of the ACH Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceACHTransferRejection(BaseModel): transfer_id: str """The identifier of the ACH Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceACHTransferReturn(BaseModel): created_at: datetime @@ -410,6 +460,18 @@ class SourceACHTransferReturn(BaseModel): transfer_id: str """The identifier of the ACH Transfer associated with this return.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardDisputeAcceptance(BaseModel): accepted_at: datetime @@ -424,6 +486,18 @@ class SourceCardDisputeAcceptance(BaseModel): to your account. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardDisputeFinancialVisa(BaseModel): event_type: Literal[ @@ -474,6 +548,18 @@ class SourceCardDisputeFinancial(BaseModel): `network` is equal to `visa`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardDisputeLoss(BaseModel): explanation: str @@ -491,6 +577,18 @@ class SourceCardDisputeLoss(BaseModel): from your account. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardFinancialAdditionalAmountsClinic(BaseModel): amount: int @@ -1079,6 +1177,18 @@ class SourceCardFinancial(BaseModel): verification: SourceCardFinancialVerification """Fields related to verification of cardholder-provided values.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardPushTransferAcceptance(BaseModel): amount: int @@ -1087,6 +1197,18 @@ class SourceCardPushTransferAcceptance(BaseModel): transfer_id: str """The identifier of the Card Push Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardRefundCashback(BaseModel): amount: str @@ -1650,6 +1772,18 @@ class SourceCardRefund(BaseModel): For this resource it will always be `card_refund`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardRevenuePayment(BaseModel): amount: int @@ -1680,6 +1814,18 @@ class SourceCardRevenuePayment(BaseModel): transacted_on_account_id: Optional[str] = None """The account the card belonged to.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCardSettlementCashback(BaseModel): amount: str @@ -2280,6 +2426,18 @@ class SourceCardSettlement(BaseModel): For this resource it will always be `card_settlement`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCashbackPayment(BaseModel): accrued_on_card_id: Optional[str] = None @@ -2310,6 +2468,18 @@ class SourceCashbackPayment(BaseModel): period_start: datetime """The start of the period for which this transaction paid cashback.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCheckDepositAcceptance(BaseModel): account_number: str @@ -2359,6 +2529,18 @@ class SourceCheckDepositAcceptance(BaseModel): field. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCheckDepositReturn(BaseModel): amount: int @@ -2467,6 +2649,18 @@ class SourceCheckDepositReturn(BaseModel): transaction. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceCheckTransferDeposit(BaseModel): back_image_file_id: Optional[str] = None @@ -2509,11 +2703,35 @@ class SourceCheckTransferDeposit(BaseModel): For this resource it will always be `check_transfer_deposit`. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceFednowTransferAcknowledgement(BaseModel): transfer_id: str """The identifier of the FedNow Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceFeePayment(BaseModel): amount: int @@ -2541,6 +2759,18 @@ class SourceFeePayment(BaseModel): program_id: Optional[str] = None """The Program for which this fee was incurred.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundACHTransferAddendaFreeformEntry(BaseModel): payment_related_information: str @@ -2610,11 +2840,35 @@ class SourceInboundACHTransfer(BaseModel): transfer_id: str """The Inbound ACH Transfer's identifier.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundACHTransferReturnIntention(BaseModel): inbound_ach_transfer_id: str """The ID of the Inbound ACH Transfer that is being returned.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundCheckAdjustment(BaseModel): adjusted_transaction_id: str @@ -2636,6 +2890,18 @@ class SourceInboundCheckAdjustment(BaseModel): usually happens for e.g., low quality images. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundCheckDepositReturnIntention(BaseModel): inbound_check_deposit_id: str @@ -2644,11 +2910,35 @@ class SourceInboundCheckDepositReturnIntention(BaseModel): transfer_id: Optional[str] = None """The identifier of the Check Transfer object that was deposited.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundFednowTransferConfirmation(BaseModel): transfer_id: str """The identifier of the FedNow Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundRealTimePaymentsTransferConfirmation(BaseModel): amount: int @@ -2691,6 +2981,18 @@ class SourceInboundRealTimePaymentsTransferConfirmation(BaseModel): transfer_id: str """The identifier of the Real-Time Payments Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundWireReversal(BaseModel): amount: int @@ -2748,6 +3050,18 @@ class SourceInboundWireReversal(BaseModel): wire_transfer_id: str """The ID for the Wire Transfer that is being reversed.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundWireTransfer(BaseModel): amount: int @@ -2812,11 +3126,35 @@ class SourceInboundWireTransfer(BaseModel): unstructured_remittance_information: Optional[str] = None """A free-form message set by the sender.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInboundWireTransferReversal(BaseModel): inbound_wire_transfer_id: str """The ID of the Inbound Wire Transfer that is being reversed.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInterestPayment(BaseModel): accrued_on_account_id: str @@ -2847,6 +3185,18 @@ class SourceInterestPayment(BaseModel): period_start: datetime """The start of the period for which this transaction paid interest.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceInternalSource(BaseModel): amount: int @@ -2910,6 +3260,18 @@ class SourceInternalSource(BaseModel): - `sample_funds_return` - Sample funds return """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceRealTimePaymentsTransferAcknowledgement(BaseModel): amount: int @@ -2927,21 +3289,69 @@ class SourceRealTimePaymentsTransferAcknowledgement(BaseModel): transfer_id: str """The identifier of the Real-Time Payments Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceSampleFunds(BaseModel): originator: str """Where the sample funds came from.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceSwiftTransferIntention(BaseModel): transfer_id: str """The identifier of the Swift Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceSwiftTransferReturn(BaseModel): transfer_id: str """The identifier of the Swift Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class SourceWireTransferIntention(BaseModel): account_number: str @@ -2959,6 +3369,18 @@ class SourceWireTransferIntention(BaseModel): transfer_id: str """The identifier of the Wire Transfer that led to this Transaction.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Source(BaseModel): account_revenue_payment: Optional[SourceAccountRevenuePayment] = None @@ -3384,6 +3806,18 @@ class Source(BaseModel): sent to a different bank. """ + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Transaction(BaseModel): id: str @@ -3452,3 +3886,15 @@ class Transaction(BaseModel): For this resource it will always be `transaction`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] diff --git a/src/increase/types/wire_transfer.py b/src/increase/types/wire_transfer.py index f0132b3f4..d14ac9c66 100644 --- a/src/increase/types/wire_transfer.py +++ b/src/increase/types/wire_transfer.py @@ -1,9 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import datetime -from typing import Optional +from typing import TYPE_CHECKING, Dict, Optional from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel __all__ = [ @@ -241,6 +243,18 @@ class Reversal(BaseModel): wire_transfer_id: str """The ID for the Wire Transfer that is being reversed.""" + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + class Submission(BaseModel): input_message_accountability_data: str @@ -383,3 +397,15 @@ class WireTransfer(BaseModel): For this resource it will always be `wire_transfer`. """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] From 6a64b22c6ce4dcb1a9559ed9356f2d2a2e71c27a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 18:05:29 +0000 Subject: [PATCH 4/4] release: 0.374.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 211b9f1a0..f83bd1f73 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.373.0" + ".": "0.374.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a59efa0e6..00822b412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.374.0 (2025-10-30) + +Full Changelog: [v0.373.0...v0.374.0](https://github.com/Increase/increase-python/compare/v0.373.0...v0.374.0) + +### Features + +* **api:** api update ([d705fa1](https://github.com/Increase/increase-python/commit/d705fa1a03274a1b31c73f40e5754445d4503184)) +* **api:** api update ([da7b55d](https://github.com/Increase/increase-python/commit/da7b55d2191378721e1ebf49acfde8e8b4dacbda)) + + +### Chores + +* **internal/tests:** avoid race condition with implicit client cleanup ([41a58d4](https://github.com/Increase/increase-python/commit/41a58d40928ab6392025af88b54b83a0ad2f37de)) + ## 0.373.0 (2025-10-29) Full Changelog: [v0.372.0...v0.373.0](https://github.com/Increase/increase-python/compare/v0.372.0...v0.373.0) diff --git a/pyproject.toml b/pyproject.toml index 7e8390cb4..e97ac3959 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.373.0" +version = "0.374.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_version.py b/src/increase/_version.py index 84b24d068..d0f423244 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.373.0" # x-release-please-version +__version__ = "0.374.0" # x-release-please-version