diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0e5f1cfb3..45e440e64 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.200.0" + ".": "0.201.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 85960561b..b861b7f29 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 201 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-8882da77555a843811f51c01d96a8a0f5dd36dc70de46bdf01a1e624807ba3a6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-6a74a7c2c7897ef6df01004d4e776e33d166bad2206cf5e66152e30bba5a6807.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae7e7c24..d71968ee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.201.0 (2025-03-03) + +Full Changelog: [v0.200.0...v0.201.0](https://github.com/Increase/increase-python/compare/v0.200.0...v0.201.0) + +### Features + +* **api:** api update ([#1003](https://github.com/Increase/increase-python/issues/1003)) ([fbf7fdb](https://github.com/Increase/increase-python/commit/fbf7fdb355be413902a52d4e2c58a2f8169005fb)) + + +### Chores + +* **internal:** remove unused http client options forwarding ([#1001](https://github.com/Increase/increase-python/issues/1001)) ([e2dd741](https://github.com/Increase/increase-python/commit/e2dd74105c3394df41a3cc1a1f300bb4992506df)) + ## 0.200.0 (2025-03-01) Full Changelog: [v0.199.0...v0.200.0](https://github.com/Increase/increase-python/compare/v0.199.0...v0.200.0) diff --git a/pyproject.toml b/pyproject.toml index e9ca73d48..88d31bc8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.200.0" +version = "0.201.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_base_client.py b/src/increase/_base_client.py index 67dc8a43d..8e8b4ef29 100644 --- a/src/increase/_base_client.py +++ b/src/increase/_base_client.py @@ -9,7 +9,6 @@ import inspect import logging import platform -import warnings import email.utils from types import TracebackType from random import random @@ -36,7 +35,7 @@ import httpx import distro import pydantic -from httpx import URL, Limits +from httpx import URL from pydantic import PrivateAttr from . import _exceptions @@ -51,13 +50,10 @@ Timeout, NotGiven, ResponseT, - Transport, AnyMapping, PostParser, - ProxiesTypes, RequestFiles, HttpxSendArgs, - AsyncTransport, RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, @@ -337,9 +333,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]): _base_url: URL max_retries: int timeout: Union[float, Timeout, None] - _limits: httpx.Limits - _proxies: ProxiesTypes | None - _transport: Transport | AsyncTransport | None _strict_response_validation: bool _idempotency_header: str | None _default_stream_cls: type[_DefaultStreamT] | None = None @@ -352,9 +345,6 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None = DEFAULT_TIMEOUT, - limits: httpx.Limits, - transport: Transport | AsyncTransport | None, - proxies: ProxiesTypes | None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: @@ -362,9 +352,6 @@ def __init__( self._base_url = self._enforce_trailing_slash(URL(base_url)) self.max_retries = max_retries self.timeout = timeout - self._limits = limits - self._proxies = proxies - self._transport = transport self._custom_headers = custom_headers or {} self._custom_query = custom_query or {} self._strict_response_validation = _strict_response_validation @@ -800,46 +787,11 @@ def __init__( base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: Transport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -860,12 +812,9 @@ def __init__( super().__init__( version=version, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, base_url=base_url, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -875,9 +824,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: @@ -1372,45 +1318,10 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: AsyncTransport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -1432,11 +1343,8 @@ def __init__( super().__init__( version=version, base_url=base_url, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -1446,9 +1354,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: diff --git a/src/increase/_version.py b/src/increase/_version.py index ea436ce40..a11ac61c3 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.200.0" # x-release-please-version +__version__ = "0.201.0" # x-release-please-version diff --git a/src/increase/resources/cards.py b/src/increase/resources/cards.py index ae584b344..70c7b7e00 100644 --- a/src/increase/resources/cards.py +++ b/src/increase/resources/cards.py @@ -232,6 +232,7 @@ def list( cursor: str | NotGiven = NOT_GIVEN, idempotency_key: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + status: card_list_params.Status | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -278,6 +279,7 @@ def list( "cursor": cursor, "idempotency_key": idempotency_key, "limit": limit, + "status": status, }, card_list_params.CardListParams, ), @@ -525,6 +527,7 @@ def list( cursor: str | NotGiven = NOT_GIVEN, idempotency_key: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + status: card_list_params.Status | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -571,6 +574,7 @@ def list( "cursor": cursor, "idempotency_key": idempotency_key, "limit": limit, + "status": status, }, card_list_params.CardListParams, ), diff --git a/src/increase/types/card_list_params.py b/src/increase/types/card_list_params.py index 8042a2912..c1eef0f8c 100644 --- a/src/increase/types/card_list_params.py +++ b/src/increase/types/card_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["CardListParams", "CreatedAt"] +__all__ = ["CardListParams", "CreatedAt", "Status"] class CardListParams(TypedDict, total=False): @@ -34,6 +34,8 @@ class CardListParams(TypedDict, total=False): The default (and maximum) is 100 objects. """ + status: Status + class CreatedAt(TypedDict, total=False): after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] @@ -59,3 +61,16 @@ class CreatedAt(TypedDict, total=False): Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. """ + + +_StatusReservedKeywords = TypedDict( + "_StatusReservedKeywords", + { + "in": List[Literal["active", "disabled", "canceled"]], + }, + total=False, +) + + +class Status(_StatusReservedKeywords, total=False): + pass diff --git a/tests/api_resources/test_cards.py b/tests/api_resources/test_cards.py index 007a6d91a..ea7da68a8 100644 --- a/tests/api_resources/test_cards.py +++ b/tests/api_resources/test_cards.py @@ -187,6 +187,7 @@ def test_method_list_with_all_params(self, client: Increase) -> None: cursor="cursor", idempotency_key="x", limit=1, + status={"in": ["active"]}, ) assert_matches_type(SyncPage[Card], card, path=["response"]) @@ -420,6 +421,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> cursor="cursor", idempotency_key="x", limit=1, + status={"in": ["active"]}, ) assert_matches_type(AsyncPage[Card], card, path=["response"])