diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8f3e0a4..b4e9013 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.15.0" + ".": "0.16.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 5536ff4..0734cd0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 43 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-bd9470194fe169e6dc79216a8f03c401fd3b160d551d1a102ad6586f151c3b61.yml -openapi_spec_hash: 766cd330850dd373f4115b98a8da27c3 -config_hash: 432e018b959089e4736f74b52bafad54 +configured_endpoints: 44 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-8c144d825fdfa369cf16995bf00706fb8bef562ade8cf6948b28b737ecb6a6cb.yml +openapi_spec_hash: 0131ffad8903eedaf491699b0e28351b +config_hash: c0a34dbff811a8b614d969c58e58846e diff --git a/CHANGELOG.md b/CHANGELOG.md index ccae14f..e61fb17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.16.0 (2025-10-06) + +Full Changelog: [v0.15.0...v0.16.0](https://github.com/NascentCore/inty-python/compare/v0.15.0...v0.16.0) + +### Features + +* **api:** manual updates ([03513e9](https://github.com/NascentCore/inty-python/commit/03513e98a8e180aee6b2d3113952c3472d903b96)) + ## 0.15.0 (2025-09-29) Full Changelog: [v0.14.0...v0.15.0](https://github.com/NascentCore/inty-python/compare/v0.14.0...v0.15.0) diff --git a/api.md b/api.md index 5106e36..350bea9 100644 --- a/api.md +++ b/api.md @@ -54,13 +54,20 @@ Methods: Types: ```python -from inty.types.api.v1.users import Gender, User, ProfileRetrieveResponse, ProfileUpdateResponse +from inty.types.api.v1.users import ( + Gender, + User, + ProfileRetrieveResponse, + ProfileUpdateResponse, + ProfileMeResponse, +) ``` Methods: - client.api.v1.users.profile.retrieve() -> ProfileRetrieveResponse - client.api.v1.users.profile.update(\*\*params) -> ProfileUpdateResponse +- client.api.v1.users.profile.me() -> ProfileMeResponse #### Device diff --git a/pyproject.toml b/pyproject.toml index 857a420..947a250 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "inty" -version = "0.15.0" +version = "0.16.0" description = "The official Python library for the inty API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/inty/_version.py b/src/inty/_version.py index ab60647..e2dc4ca 100644 --- a/src/inty/_version.py +++ b/src/inty/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "inty" -__version__ = "0.15.0" # x-release-please-version +__version__ = "0.16.0" # x-release-please-version diff --git a/src/inty/resources/api/v1/users/profile.py b/src/inty/resources/api/v1/users/profile.py index 0480c64..36982d8 100644 --- a/src/inty/resources/api/v1/users/profile.py +++ b/src/inty/resources/api/v1/users/profile.py @@ -19,6 +19,7 @@ from ....._base_client import make_request_options from .....types.api.v1.users import Gender, profile_update_params from .....types.api.v1.users.gender import Gender +from .....types.api.v1.users.profile_me_response import ProfileMeResponse from .....types.api.v1.users.profile_update_response import ProfileUpdateResponse from .....types.api.v1.users.profile_retrieve_response import ProfileRetrieveResponse @@ -119,6 +120,25 @@ def update( cast_to=ProfileUpdateResponse, ) + def me( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProfileMeResponse: + """Get current user profile.""" + return self._get( + "/api/v1/users/me", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProfileMeResponse, + ) + class AsyncProfileResource(AsyncAPIResource): @cached_property @@ -214,6 +234,25 @@ async def update( cast_to=ProfileUpdateResponse, ) + async def me( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ProfileMeResponse: + """Get current user profile.""" + return await self._get( + "/api/v1/users/me", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProfileMeResponse, + ) + class ProfileResourceWithRawResponse: def __init__(self, profile: ProfileResource) -> None: @@ -225,6 +264,9 @@ def __init__(self, profile: ProfileResource) -> None: self.update = to_raw_response_wrapper( profile.update, ) + self.me = to_raw_response_wrapper( + profile.me, + ) class AsyncProfileResourceWithRawResponse: @@ -237,6 +279,9 @@ def __init__(self, profile: AsyncProfileResource) -> None: self.update = async_to_raw_response_wrapper( profile.update, ) + self.me = async_to_raw_response_wrapper( + profile.me, + ) class ProfileResourceWithStreamingResponse: @@ -249,6 +294,9 @@ def __init__(self, profile: ProfileResource) -> None: self.update = to_streamed_response_wrapper( profile.update, ) + self.me = to_streamed_response_wrapper( + profile.me, + ) class AsyncProfileResourceWithStreamingResponse: @@ -261,3 +309,6 @@ def __init__(self, profile: AsyncProfileResource) -> None: self.update = async_to_streamed_response_wrapper( profile.update, ) + self.me = async_to_streamed_response_wrapper( + profile.me, + ) diff --git a/src/inty/types/api/v1/users/__init__.py b/src/inty/types/api/v1/users/__init__.py index 2fdc4d2..c6accc6 100644 --- a/src/inty/types/api/v1/users/__init__.py +++ b/src/inty/types/api/v1/users/__init__.py @@ -5,6 +5,7 @@ from .user import User as User from .gender import Gender as Gender from .api_response import APIResponse as APIResponse +from .profile_me_response import ProfileMeResponse as ProfileMeResponse from .profile_update_params import ProfileUpdateParams as ProfileUpdateParams from .device_register_params import DeviceRegisterParams as DeviceRegisterParams from .profile_update_response import ProfileUpdateResponse as ProfileUpdateResponse diff --git a/src/inty/types/api/v1/users/profile_me_response.py b/src/inty/types/api/v1/users/profile_me_response.py new file mode 100644 index 0000000..8ee45a7 --- /dev/null +++ b/src/inty/types/api/v1/users/profile_me_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .user import User +from ....._models import BaseModel + +__all__ = ["ProfileMeResponse"] + + +class ProfileMeResponse(BaseModel): + code: Optional[int] = None + + data: Optional[User] = None + """返回给客户端的用户信息""" + + message: Optional[str] = None diff --git a/tests/api_resources/api/v1/users/test_profile.py b/tests/api_resources/api/v1/users/test_profile.py index da2235b..9606160 100644 --- a/tests/api_resources/api/v1/users/test_profile.py +++ b/tests/api_resources/api/v1/users/test_profile.py @@ -9,7 +9,11 @@ from inty import Inty, AsyncInty from tests.utils import assert_matches_type -from inty.types.api.v1.users import ProfileUpdateResponse, ProfileRetrieveResponse +from inty.types.api.v1.users import ( + ProfileMeResponse, + ProfileUpdateResponse, + ProfileRetrieveResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -89,6 +93,34 @@ def test_streaming_response_update(self, client: Inty) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_me(self, client: Inty) -> None: + profile = client.api.v1.users.profile.me() + assert_matches_type(ProfileMeResponse, profile, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_me(self, client: Inty) -> None: + response = client.api.v1.users.profile.with_raw_response.me() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + profile = response.parse() + assert_matches_type(ProfileMeResponse, profile, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_me(self, client: Inty) -> None: + with client.api.v1.users.profile.with_streaming_response.me() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + profile = response.parse() + assert_matches_type(ProfileMeResponse, profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncProfile: parametrize = pytest.mark.parametrize( @@ -166,3 +198,31 @@ async def test_streaming_response_update(self, async_client: AsyncInty) -> None: assert_matches_type(ProfileUpdateResponse, profile, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_me(self, async_client: AsyncInty) -> None: + profile = await async_client.api.v1.users.profile.me() + assert_matches_type(ProfileMeResponse, profile, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_me(self, async_client: AsyncInty) -> None: + response = await async_client.api.v1.users.profile.with_raw_response.me() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + profile = await response.parse() + assert_matches_type(ProfileMeResponse, profile, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_me(self, async_client: AsyncInty) -> None: + async with async_client.api.v1.users.profile.with_streaming_response.me() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + profile = await response.parse() + assert_matches_type(ProfileMeResponse, profile, path=["response"]) + + assert cast(Any, response.is_closed) is True