diff --git a/.stats.yml b/.stats.yml index 62894e9..f75004e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openint%2Fopenint-603899f0fe4bb2708f918f1c736c2f244adce7936136aeeb3b45f727d209b4af.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openint%2Fopenint-a33b999e54f4c80e7d83d29703b3936b2a821474af967faa2737c4fb281281c4.yml diff --git a/src/openint/_client.py b/src/openint/_client.py index aa7a6b4..f851d03 100644 --- a/src/openint/_client.py +++ b/src/openint/_client.py @@ -492,17 +492,12 @@ def get_current_user( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> GetCurrentUserResponse: """Get information about the current authenticated user""" - return cast( - GetCurrentUserResponse, - self.get( - "/viewer", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast( - Any, GetCurrentUserResponse - ), # Union types cannot be passed in as arguments in the type system + return self.get( + "/viewer", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + cast_to=GetCurrentUserResponse, ) def list_connection_configs( @@ -1183,17 +1178,12 @@ async def get_current_user( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> GetCurrentUserResponse: """Get information about the current authenticated user""" - return cast( - GetCurrentUserResponse, - await self.get( - "/viewer", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast( - Any, GetCurrentUserResponse - ), # Union types cannot be passed in as arguments in the type system + return await self.get( + "/viewer", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + cast_to=GetCurrentUserResponse, ) def list_connection_configs( diff --git a/src/openint/types/get_current_user_response.py b/src/openint/types/get_current_user_response.py index 73e7b34..cbb3b16 100644 --- a/src/openint/types/get_current_user_response.py +++ b/src/openint/types/get_current_user_response.py @@ -1,43 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Union, Optional -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing_extensions import Literal from .._models import BaseModel -__all__ = ["GetCurrentUserResponse", "Role", "UnionMember1", "UnionMember2", "UnionMember3"] - - -class Role(BaseModel): - role: Literal["anon"] - - -class UnionMember1(BaseModel): - customer_id: str = FieldInfo(alias="customerId") - - org_id: str = FieldInfo(alias="orgId") - - role: Literal["customer"] - - -class UnionMember2(BaseModel): - role: Literal["user"] - - user_id: str = FieldInfo(alias="userId") - - extra: Optional[Dict[str, object]] = None - - org_id: Optional[str] = FieldInfo(alias="orgId", default=None) - - -class UnionMember3(BaseModel): - org_id: str = FieldInfo(alias="orgId") - - role: Literal["org"] - - extra: Optional[Dict[str, object]] = None +__all__ = ["GetCurrentUserResponse"] -GetCurrentUserResponse: TypeAlias = Union[Role, UnionMember1, UnionMember2, UnionMember3, Role] +class GetCurrentUserResponse(BaseModel): + role: Literal["customer", "org", "anon"]