Skip to content

Commit 3f9cbe1

Browse files
build(stainless): map /v1/accounts/me to accounts.me in the SDK (#9569)
1 parent 2fdce83 commit 3f9cbe1

8 files changed

Lines changed: 380 additions & 3 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 119
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-7235763cbdfd60834a897f356688d758b598a1dd723623330ea398dea2abea68.yml
1+
configured_endpoints: 120
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-96b0ac0a148db6fde2e8363ea2dcfaa63f2dc23cf35c30c5fcfffbefc222e5d1.yml
33
openapi_spec_hash: 01b9dbab4b732e4b83952debd108e404
4-
config_hash: 444e00951b440bf92e7548b2807584a4
4+
config_hash: ed1fdd7c9f0a25647e16b602bad4ff2e

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ from runloop_api_client.types import (
1717
)
1818
```
1919

20+
# Accounts
21+
22+
Types:
23+
24+
```python
25+
from runloop_api_client.types import AccountView
26+
```
27+
28+
Methods:
29+
30+
- <code title="get /v1/accounts/me">client.accounts.<a href="./src/runloop_api_client/resources/accounts.py">me</a>() -> <a href="./src/runloop_api_client/types/account_view.py">AccountView</a></code>
31+
2032
# Benchmarks
2133

2234
Types:

src/runloop_api_client/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
apikeys,
4343
objects,
4444
secrets,
45+
accounts,
4546
devboxes,
4647
scenarios,
4748
benchmarks,
@@ -58,6 +59,7 @@
5859
from .resources.apikeys import ApikeysResource, AsyncApikeysResource
5960
from .resources.objects import ObjectsResource, AsyncObjectsResource
6061
from .resources.secrets import SecretsResource, AsyncSecretsResource
62+
from .resources.accounts import AccountsResource, AsyncAccountsResource
6163
from .resources.benchmarks import BenchmarksResource, AsyncBenchmarksResource
6264
from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource
6365
from .resources.axons.axons import AxonsResource, AsyncAxonsResource
@@ -144,6 +146,12 @@ def __init__(
144146

145147
self._idempotency_header = "x-request-id"
146148

149+
@cached_property
150+
def accounts(self) -> AccountsResource:
151+
from .resources.accounts import AccountsResource
152+
153+
return AccountsResource(self)
154+
147155
@cached_property
148156
def benchmarks(self) -> BenchmarksResource:
149157
from .resources.benchmarks import BenchmarksResource
@@ -432,6 +440,12 @@ def __init__(
432440

433441
self._idempotency_header = "x-request-id"
434442

443+
@cached_property
444+
def accounts(self) -> AsyncAccountsResource:
445+
from .resources.accounts import AsyncAccountsResource
446+
447+
return AsyncAccountsResource(self)
448+
435449
@cached_property
436450
def benchmarks(self) -> AsyncBenchmarksResource:
437451
from .resources.benchmarks import AsyncBenchmarksResource
@@ -655,6 +669,12 @@ class RunloopWithRawResponse:
655669
def __init__(self, client: Runloop) -> None:
656670
self._client = client
657671

672+
@cached_property
673+
def accounts(self) -> accounts.AccountsResourceWithRawResponse:
674+
from .resources.accounts import AccountsResourceWithRawResponse
675+
676+
return AccountsResourceWithRawResponse(self._client.accounts)
677+
658678
@cached_property
659679
def benchmarks(self) -> benchmarks.BenchmarksResourceWithRawResponse:
660680
from .resources.benchmarks import BenchmarksResourceWithRawResponse
@@ -758,6 +778,12 @@ class AsyncRunloopWithRawResponse:
758778
def __init__(self, client: AsyncRunloop) -> None:
759779
self._client = client
760780

781+
@cached_property
782+
def accounts(self) -> accounts.AsyncAccountsResourceWithRawResponse:
783+
from .resources.accounts import AsyncAccountsResourceWithRawResponse
784+
785+
return AsyncAccountsResourceWithRawResponse(self._client.accounts)
786+
761787
@cached_property
762788
def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithRawResponse:
763789
from .resources.benchmarks import AsyncBenchmarksResourceWithRawResponse
@@ -861,6 +887,12 @@ class RunloopWithStreamedResponse:
861887
def __init__(self, client: Runloop) -> None:
862888
self._client = client
863889

890+
@cached_property
891+
def accounts(self) -> accounts.AccountsResourceWithStreamingResponse:
892+
from .resources.accounts import AccountsResourceWithStreamingResponse
893+
894+
return AccountsResourceWithStreamingResponse(self._client.accounts)
895+
864896
@cached_property
865897
def benchmarks(self) -> benchmarks.BenchmarksResourceWithStreamingResponse:
866898
from .resources.benchmarks import BenchmarksResourceWithStreamingResponse
@@ -964,6 +996,12 @@ class AsyncRunloopWithStreamedResponse:
964996
def __init__(self, client: AsyncRunloop) -> None:
965997
self._client = client
966998

999+
@cached_property
1000+
def accounts(self) -> accounts.AsyncAccountsResourceWithStreamingResponse:
1001+
from .resources.accounts import AsyncAccountsResourceWithStreamingResponse
1002+
1003+
return AsyncAccountsResourceWithStreamingResponse(self._client.accounts)
1004+
9671005
@cached_property
9681006
def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithStreamingResponse:
9691007
from .resources.benchmarks import AsyncBenchmarksResourceWithStreamingResponse

src/runloop_api_client/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
SecretsResourceWithStreamingResponse,
4949
AsyncSecretsResourceWithStreamingResponse,
5050
)
51+
from .accounts import (
52+
AccountsResource,
53+
AsyncAccountsResource,
54+
AccountsResourceWithRawResponse,
55+
AsyncAccountsResourceWithRawResponse,
56+
AccountsResourceWithStreamingResponse,
57+
AsyncAccountsResourceWithStreamingResponse,
58+
)
5159
from .devboxes import (
5260
DevboxesResource,
5361
AsyncDevboxesResource,
@@ -130,6 +138,12 @@
130138
)
131139

132140
__all__ = [
141+
"AccountsResource",
142+
"AsyncAccountsResource",
143+
"AccountsResourceWithRawResponse",
144+
"AsyncAccountsResourceWithRawResponse",
145+
"AccountsResourceWithStreamingResponse",
146+
"AsyncAccountsResourceWithStreamingResponse",
133147
"BenchmarksResource",
134148
"AsyncBenchmarksResource",
135149
"BenchmarksResourceWithRawResponse",
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from .._types import Body, Query, Headers, NotGiven, not_given
8+
from .._compat import cached_property
9+
from .._resource import SyncAPIResource, AsyncAPIResource
10+
from .._response import (
11+
to_raw_response_wrapper,
12+
to_streamed_response_wrapper,
13+
async_to_raw_response_wrapper,
14+
async_to_streamed_response_wrapper,
15+
)
16+
from .._base_client import make_request_options
17+
from ..types.account_view import AccountView
18+
19+
__all__ = ["AccountsResource", "AsyncAccountsResource"]
20+
21+
22+
class AccountsResource(SyncAPIResource):
23+
@cached_property
24+
def with_raw_response(self) -> AccountsResourceWithRawResponse:
25+
"""
26+
This property can be used as a prefix for any HTTP method call to return
27+
the raw response object instead of the parsed content.
28+
29+
For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers
30+
"""
31+
return AccountsResourceWithRawResponse(self)
32+
33+
@cached_property
34+
def with_streaming_response(self) -> AccountsResourceWithStreamingResponse:
35+
"""
36+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37+
38+
For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response
39+
"""
40+
return AccountsResourceWithStreamingResponse(self)
41+
42+
def me(
43+
self,
44+
*,
45+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46+
# The extra values given here take precedence over values defined on the client or passed to this method.
47+
extra_headers: Headers | None = None,
48+
extra_query: Query | None = None,
49+
extra_body: Body | None = None,
50+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
51+
) -> AccountView:
52+
"""
53+
Returns the account the API key or session is authenticated against, including
54+
id, name, tier, and billing summary.
55+
"""
56+
return self._get(
57+
"/v1/accounts/me",
58+
options=make_request_options(
59+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
60+
),
61+
cast_to=AccountView,
62+
)
63+
64+
65+
class AsyncAccountsResource(AsyncAPIResource):
66+
@cached_property
67+
def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse:
68+
"""
69+
This property can be used as a prefix for any HTTP method call to return
70+
the raw response object instead of the parsed content.
71+
72+
For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers
73+
"""
74+
return AsyncAccountsResourceWithRawResponse(self)
75+
76+
@cached_property
77+
def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse:
78+
"""
79+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
80+
81+
For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response
82+
"""
83+
return AsyncAccountsResourceWithStreamingResponse(self)
84+
85+
async def me(
86+
self,
87+
*,
88+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
89+
# The extra values given here take precedence over values defined on the client or passed to this method.
90+
extra_headers: Headers | None = None,
91+
extra_query: Query | None = None,
92+
extra_body: Body | None = None,
93+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
94+
) -> AccountView:
95+
"""
96+
Returns the account the API key or session is authenticated against, including
97+
id, name, tier, and billing summary.
98+
"""
99+
return await self._get(
100+
"/v1/accounts/me",
101+
options=make_request_options(
102+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
103+
),
104+
cast_to=AccountView,
105+
)
106+
107+
108+
class AccountsResourceWithRawResponse:
109+
def __init__(self, accounts: AccountsResource) -> None:
110+
self._accounts = accounts
111+
112+
self.me = to_raw_response_wrapper(
113+
accounts.me,
114+
)
115+
116+
117+
class AsyncAccountsResourceWithRawResponse:
118+
def __init__(self, accounts: AsyncAccountsResource) -> None:
119+
self._accounts = accounts
120+
121+
self.me = async_to_raw_response_wrapper(
122+
accounts.me,
123+
)
124+
125+
126+
class AccountsResourceWithStreamingResponse:
127+
def __init__(self, accounts: AccountsResource) -> None:
128+
self._accounts = accounts
129+
130+
self.me = to_streamed_response_wrapper(
131+
accounts.me,
132+
)
133+
134+
135+
class AsyncAccountsResourceWithStreamingResponse:
136+
def __init__(self, accounts: AsyncAccountsResource) -> None:
137+
self._accounts = accounts
138+
139+
self.me = async_to_streamed_response_wrapper(
140+
accounts.me,
141+
)

src/runloop_api_client/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .object_view import ObjectView as ObjectView
2323
from .secret_view import SecretView as SecretView
2424
from .tunnel_view import TunnelView as TunnelView
25+
from .account_view import AccountView as AccountView
2526
from .input_context import InputContext as InputContext
2627
from .scenario_view import ScenarioView as ScenarioView
2728
from .axon_list_view import AxonListView as AxonListView
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
from typing_extensions import Literal
5+
6+
from .._models import BaseModel
7+
8+
__all__ = ["AccountView", "Billing", "BillingAws", "BillingStripe"]
9+
10+
11+
class BillingAws(BaseModel):
12+
"""AWS Marketplace billing information."""
13+
14+
customer_identifier: Optional[str] = None
15+
"""The AWS account ID used for Marketplace billing (12-digit)."""
16+
17+
license_arn: Optional[str] = None
18+
"""The AWS Marketplace license ARN."""
19+
20+
subscription_status: Optional[str] = None
21+
"""The AWS Marketplace subscription status."""
22+
23+
24+
class BillingStripe(BaseModel):
25+
"""Stripe billing information."""
26+
27+
active_subscription: Optional[str] = None
28+
"""The active Stripe subscription ID."""
29+
30+
customer_id: Optional[str] = None
31+
"""The Stripe customer ID."""
32+
33+
34+
class Billing(BaseModel):
35+
"""The account billing information."""
36+
37+
account_billing_type: Literal["STRIPE", "AWS_MARKETPLACE", "STRIPE_PROJECTS", "UNRECOGNIZED"]
38+
"""The account billing type."""
39+
40+
aws: Optional[BillingAws] = None
41+
"""AWS Marketplace billing information."""
42+
43+
stripe: Optional[BillingStripe] = None
44+
"""Stripe billing information."""
45+
46+
stripe_customer_id: Optional[str] = None
47+
"""Deprecated: use stripe.customer_id."""
48+
49+
50+
class AccountView(BaseModel):
51+
"""Account information."""
52+
53+
id: str
54+
"""The account ID."""
55+
56+
account_status: Literal[
57+
"ACCOUNT_STATUS_INVALID",
58+
"ACCOUNT_STATUS_ONBOARDING",
59+
"ACCOUNT_STATUS_ENABLED",
60+
"ACCOUNT_STATUS_DISABLED_BY_ADMIN",
61+
"ACCOUNT_STATUS_DISABLED_QUOTA_REACHED",
62+
"ACCOUNT_STATUS_TRIAL_CANCELLED",
63+
"ACCOUNT_STATUS_STRIPE_PENDING_RESOURCES",
64+
"UNRECOGNIZED",
65+
]
66+
"""The account status."""
67+
68+
billing: Billing
69+
"""The account billing information."""
70+
71+
created_at: str
72+
"""The account creation timestamp."""
73+
74+
name: str
75+
"""The account name."""
76+
77+
tier: Literal[
78+
"ACCOUNT_TIER_INVALID",
79+
"ACCOUNT_TIER_BASIC",
80+
"ACCOUNT_TIER_PRO",
81+
"ACCOUNT_TIER_ENTERPRISE",
82+
"ACCOUNT_TIER_TRIAL",
83+
"UNRECOGNIZED",
84+
]
85+
"""The account tier."""
86+
87+
account_billing_type: Optional[Literal["STRIPE", "AWS_MARKETPLACE", "STRIPE_PROJECTS", "UNRECOGNIZED"]] = None
88+
"""Deprecated: use billing.account_billing_type."""
89+
90+
active_subscription: Optional[str] = None
91+
"""Deprecated: use billing.stripe.active_subscription."""
92+
93+
external_billing_account_id: Optional[str] = None
94+
"""Deprecated: use billing.aws.customer_identifier."""
95+
96+
stripe_customer_id: Optional[str] = None
97+
"""Deprecated: use billing.stripe.customer_id."""

0 commit comments

Comments
 (0)