From 63efedb5dcf1660a5724c5ce090905362026a2ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:34:07 +0000 Subject: [PATCH 1/2] feat(api): api update (#885) --- .stats.yml | 2 +- src/increase/resources/oauth_applications.py | 8 +++ .../types/oauth_application_list_params.py | 51 ++++++++++++++++++- .../api_resources/test_oauth_applications.py | 15 ++++++ 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index d0500faee..8e652dc26 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-6e3f74c1cfeef92447868eb9d50fb5bd703bd25191aa1c4583d659082e1adea7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4bd84f4d9170653e443265bdf92c0520b008f613be5f60334e07b4151765e16a.yml diff --git a/src/increase/resources/oauth_applications.py b/src/increase/resources/oauth_applications.py index c46086de3..f12c01d6a 100644 --- a/src/increase/resources/oauth_applications.py +++ b/src/increase/resources/oauth_applications.py @@ -82,8 +82,10 @@ def retrieve( def list( self, *, + created_at: oauth_application_list_params.CreatedAt | NotGiven = NOT_GIVEN, cursor: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + status: oauth_application_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, @@ -118,8 +120,10 @@ def list( timeout=timeout, query=maybe_transform( { + "created_at": created_at, "cursor": cursor, "limit": limit, + "status": status, }, oauth_application_list_params.OAuthApplicationListParams, ), @@ -188,8 +192,10 @@ async def retrieve( def list( self, *, + created_at: oauth_application_list_params.CreatedAt | NotGiven = NOT_GIVEN, cursor: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + status: oauth_application_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, @@ -224,8 +230,10 @@ def list( timeout=timeout, query=maybe_transform( { + "created_at": created_at, "cursor": cursor, "limit": limit, + "status": status, }, oauth_application_list_params.OAuthApplicationListParams, ), diff --git a/src/increase/types/oauth_application_list_params.py b/src/increase/types/oauth_application_list_params.py index fa0d4f42b..f0069a737 100644 --- a/src/increase/types/oauth_application_list_params.py +++ b/src/increase/types/oauth_application_list_params.py @@ -2,12 +2,18 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict -__all__ = ["OAuthApplicationListParams"] +from .._utils import PropertyInfo + +__all__ = ["OAuthApplicationListParams", "CreatedAt", "Status"] class OAuthApplicationListParams(TypedDict, total=False): + created_at: CreatedAt + cursor: str """Return the page of entries after this one.""" @@ -16,3 +22,44 @@ class OAuthApplicationListParams(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")] + """ + Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + timestamp. + """ + + before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + timestamp. + """ + + on_or_after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results on or after this + [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + """ + + on_or_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results on or before this + [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + """ + + +_StatusReservedKeywords = TypedDict( + "_StatusReservedKeywords", + { + "in": List[Literal["active", "deleted"]], + }, + total=False, +) + + +class Status(_StatusReservedKeywords, total=False): + pass diff --git a/tests/api_resources/test_oauth_applications.py b/tests/api_resources/test_oauth_applications.py index 1aed1fe00..c9e04f15e 100644 --- a/tests/api_resources/test_oauth_applications.py +++ b/tests/api_resources/test_oauth_applications.py @@ -10,6 +10,7 @@ from increase import Increase, AsyncIncrease from tests.utils import assert_matches_type from increase.types import OAuthApplication +from increase._utils import parse_datetime from increase.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -64,8 +65,15 @@ def test_method_list(self, client: Increase) -> None: @parametrize def test_method_list_with_all_params(self, client: Increase) -> None: oauth_application = client.oauth_applications.list( + created_at={ + "after": parse_datetime("2019-12-27T18:11:19.117Z"), + "before": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_after": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_before": parse_datetime("2019-12-27T18:11:19.117Z"), + }, cursor="cursor", limit=1, + status={"in": ["active"]}, ) assert_matches_type(SyncPage[OAuthApplication], oauth_application, path=["response"]) @@ -139,8 +147,15 @@ async def test_method_list(self, async_client: AsyncIncrease) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> None: oauth_application = await async_client.oauth_applications.list( + created_at={ + "after": parse_datetime("2019-12-27T18:11:19.117Z"), + "before": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_after": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_before": parse_datetime("2019-12-27T18:11:19.117Z"), + }, cursor="cursor", limit=1, + status={"in": ["active"]}, ) assert_matches_type(AsyncPage[OAuthApplication], oauth_application, path=["response"]) From 598e3906be3b59949fefd0938241b42b612dadb0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:34:31 +0000 Subject: [PATCH 2/2] release: 0.173.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bf939b09f..dd670d780 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.172.0" + ".": "0.173.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ad898b615..7bb27cbb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.173.0 (2024-12-23) + +Full Changelog: [v0.172.0...v0.173.0](https://github.com/Increase/increase-python/compare/v0.172.0...v0.173.0) + +### Features + +* **api:** api update ([#885](https://github.com/Increase/increase-python/issues/885)) ([63efedb](https://github.com/Increase/increase-python/commit/63efedb5dcf1660a5724c5ce090905362026a2ad)) + ## 0.172.0 (2024-12-23) Full Changelog: [v0.171.0...v0.172.0](https://github.com/Increase/increase-python/compare/v0.171.0...v0.172.0) diff --git a/pyproject.toml b/pyproject.toml index a15d255d6..c5b56ca7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.172.0" +version = "0.173.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 51c5bdced..386576a80 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.172.0" # x-release-please-version +__version__ = "0.173.0" # x-release-please-version