Skip to content
This repository was archived by the owner on Nov 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.15.0"
".": "0.16.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 8 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

- <code title="get /api/v1/users/profile">client.api.v1.users.profile.<a href="./src/inty/resources/api/v1/users/profile.py">retrieve</a>() -> <a href="./src/inty/types/api/v1/users/profile_retrieve_response.py">ProfileRetrieveResponse</a></code>
- <code title="put /api/v1/users/profile">client.api.v1.users.profile.<a href="./src/inty/resources/api/v1/users/profile.py">update</a>(\*\*<a href="src/inty/types/api/v1/users/profile_update_params.py">params</a>) -> <a href="./src/inty/types/api/v1/users/profile_update_response.py">ProfileUpdateResponse</a></code>
- <code title="get /api/v1/users/me">client.api.v1.users.profile.<a href="./src/inty/resources/api/v1/users/profile.py">me</a>() -> <a href="./src/inty/types/api/v1/users/profile_me_response.py">ProfileMeResponse</a></code>

#### Device

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/inty/_version.py
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions src/inty/resources/api/v1/users/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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,
)
1 change: 1 addition & 0 deletions src/inty/types/api/v1/users/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions src/inty/types/api/v1/users/profile_me_response.py
Original file line number Diff line number Diff line change
@@ -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
62 changes: 61 additions & 1 deletion tests/api_resources/api/v1/users/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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