Skip to content

Commit 5b74e46

Browse files
feat: chore(stlc): seal custom-code tracking files
Stainless-Generated-From: 6d79f6bf702d5e653e96eb43611b7593c0c3620b
1 parent 6cf4ef2 commit 5b74e46

8 files changed

Lines changed: 492 additions & 1 deletion

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 139
1+
configured_endpoints: 140

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,18 @@ Methods:
472472

473473
# Organization
474474

475+
## Entitlements
476+
477+
Types:
478+
479+
```python
480+
from kernel.types.organization import OrgEntitlements
481+
```
482+
483+
Methods:
484+
485+
- <code title="get /org/entitlements">client.organization.entitlements.<a href="./src/kernel/resources/organization/entitlements.py">retrieve</a>() -> <a href="./src/kernel/types/organization/org_entitlements.py">OrgEntitlements</a></code>
486+
475487
## Limits
476488

477489
Types:

src/kernel/resources/organization/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
LimitsResourceWithStreamingResponse,
99
AsyncLimitsResourceWithStreamingResponse,
1010
)
11+
from .entitlements import (
12+
EntitlementsResource,
13+
AsyncEntitlementsResource,
14+
EntitlementsResourceWithRawResponse,
15+
AsyncEntitlementsResourceWithRawResponse,
16+
EntitlementsResourceWithStreamingResponse,
17+
AsyncEntitlementsResourceWithStreamingResponse,
18+
)
1119
from .organization import (
1220
OrganizationResource,
1321
AsyncOrganizationResource,
@@ -18,6 +26,12 @@
1826
)
1927

2028
__all__ = [
29+
"EntitlementsResource",
30+
"AsyncEntitlementsResource",
31+
"EntitlementsResourceWithRawResponse",
32+
"AsyncEntitlementsResourceWithRawResponse",
33+
"EntitlementsResourceWithStreamingResponse",
34+
"AsyncEntitlementsResourceWithStreamingResponse",
2135
"LimitsResource",
2236
"AsyncLimitsResource",
2337
"LimitsResourceWithRawResponse",
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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.organization.org_entitlements import OrgEntitlements
18+
19+
__all__ = ["EntitlementsResource", "AsyncEntitlementsResource"]
20+
21+
22+
class EntitlementsResource(SyncAPIResource):
23+
"""Read and manage organization-level limits."""
24+
25+
@cached_property
26+
def with_raw_response(self) -> EntitlementsResourceWithRawResponse:
27+
"""
28+
This property can be used as a prefix for any HTTP method call to return
29+
the raw response object instead of the parsed content.
30+
31+
For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
32+
"""
33+
return EntitlementsResourceWithRawResponse(self)
34+
35+
@cached_property
36+
def with_streaming_response(self) -> EntitlementsResourceWithStreamingResponse:
37+
"""
38+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39+
40+
For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
41+
"""
42+
return EntitlementsResourceWithStreamingResponse(self)
43+
44+
def retrieve(
45+
self,
46+
*,
47+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
48+
# The extra values given here take precedence over values defined on the client or passed to this method.
49+
extra_headers: Headers | None = None,
50+
extra_query: Query | None = None,
51+
extra_body: Body | None = None,
52+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
53+
) -> OrgEntitlements:
54+
"""
55+
Get the authenticated organization's effective feature access and constraints
56+
after applying its plan, active trial treatment, plan status, and
57+
organization-specific overrides. Null constraint values mean unlimited.
58+
"""
59+
return self._get(
60+
"/org/entitlements",
61+
options=make_request_options(
62+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
63+
),
64+
cast_to=OrgEntitlements,
65+
)
66+
67+
68+
class AsyncEntitlementsResource(AsyncAPIResource):
69+
"""Read and manage organization-level limits."""
70+
71+
@cached_property
72+
def with_raw_response(self) -> AsyncEntitlementsResourceWithRawResponse:
73+
"""
74+
This property can be used as a prefix for any HTTP method call to return
75+
the raw response object instead of the parsed content.
76+
77+
For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
78+
"""
79+
return AsyncEntitlementsResourceWithRawResponse(self)
80+
81+
@cached_property
82+
def with_streaming_response(self) -> AsyncEntitlementsResourceWithStreamingResponse:
83+
"""
84+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
85+
86+
For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
87+
"""
88+
return AsyncEntitlementsResourceWithStreamingResponse(self)
89+
90+
async def retrieve(
91+
self,
92+
*,
93+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
94+
# The extra values given here take precedence over values defined on the client or passed to this method.
95+
extra_headers: Headers | None = None,
96+
extra_query: Query | None = None,
97+
extra_body: Body | None = None,
98+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
99+
) -> OrgEntitlements:
100+
"""
101+
Get the authenticated organization's effective feature access and constraints
102+
after applying its plan, active trial treatment, plan status, and
103+
organization-specific overrides. Null constraint values mean unlimited.
104+
"""
105+
return await self._get(
106+
"/org/entitlements",
107+
options=make_request_options(
108+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
109+
),
110+
cast_to=OrgEntitlements,
111+
)
112+
113+
114+
class EntitlementsResourceWithRawResponse:
115+
def __init__(self, entitlements: EntitlementsResource) -> None:
116+
self._entitlements = entitlements
117+
118+
self.retrieve = to_raw_response_wrapper(
119+
entitlements.retrieve,
120+
)
121+
122+
123+
class AsyncEntitlementsResourceWithRawResponse:
124+
def __init__(self, entitlements: AsyncEntitlementsResource) -> None:
125+
self._entitlements = entitlements
126+
127+
self.retrieve = async_to_raw_response_wrapper(
128+
entitlements.retrieve,
129+
)
130+
131+
132+
class EntitlementsResourceWithStreamingResponse:
133+
def __init__(self, entitlements: EntitlementsResource) -> None:
134+
self._entitlements = entitlements
135+
136+
self.retrieve = to_streamed_response_wrapper(
137+
entitlements.retrieve,
138+
)
139+
140+
141+
class AsyncEntitlementsResourceWithStreamingResponse:
142+
def __init__(self, entitlements: AsyncEntitlementsResource) -> None:
143+
self._entitlements = entitlements
144+
145+
self.retrieve = async_to_streamed_response_wrapper(
146+
entitlements.retrieve,
147+
)

src/kernel/resources/organization/organization.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,24 @@
1212
)
1313
from ..._compat import cached_property
1414
from ..._resource import SyncAPIResource, AsyncAPIResource
15+
from .entitlements import (
16+
EntitlementsResource,
17+
AsyncEntitlementsResource,
18+
EntitlementsResourceWithRawResponse,
19+
AsyncEntitlementsResourceWithRawResponse,
20+
EntitlementsResourceWithStreamingResponse,
21+
AsyncEntitlementsResourceWithStreamingResponse,
22+
)
1523

1624
__all__ = ["OrganizationResource", "AsyncOrganizationResource"]
1725

1826

1927
class OrganizationResource(SyncAPIResource):
28+
@cached_property
29+
def entitlements(self) -> EntitlementsResource:
30+
"""Read and manage organization-level limits."""
31+
return EntitlementsResource(self._client)
32+
2033
@cached_property
2134
def limits(self) -> LimitsResource:
2235
"""Read and manage organization-level limits."""
@@ -43,6 +56,11 @@ def with_streaming_response(self) -> OrganizationResourceWithStreamingResponse:
4356

4457

4558
class AsyncOrganizationResource(AsyncAPIResource):
59+
@cached_property
60+
def entitlements(self) -> AsyncEntitlementsResource:
61+
"""Read and manage organization-level limits."""
62+
return AsyncEntitlementsResource(self._client)
63+
4664
@cached_property
4765
def limits(self) -> AsyncLimitsResource:
4866
"""Read and manage organization-level limits."""
@@ -72,6 +90,11 @@ class OrganizationResourceWithRawResponse:
7290
def __init__(self, organization: OrganizationResource) -> None:
7391
self._organization = organization
7492

93+
@cached_property
94+
def entitlements(self) -> EntitlementsResourceWithRawResponse:
95+
"""Read and manage organization-level limits."""
96+
return EntitlementsResourceWithRawResponse(self._organization.entitlements)
97+
7598
@cached_property
7699
def limits(self) -> LimitsResourceWithRawResponse:
77100
"""Read and manage organization-level limits."""
@@ -82,6 +105,11 @@ class AsyncOrganizationResourceWithRawResponse:
82105
def __init__(self, organization: AsyncOrganizationResource) -> None:
83106
self._organization = organization
84107

108+
@cached_property
109+
def entitlements(self) -> AsyncEntitlementsResourceWithRawResponse:
110+
"""Read and manage organization-level limits."""
111+
return AsyncEntitlementsResourceWithRawResponse(self._organization.entitlements)
112+
85113
@cached_property
86114
def limits(self) -> AsyncLimitsResourceWithRawResponse:
87115
"""Read and manage organization-level limits."""
@@ -92,6 +120,11 @@ class OrganizationResourceWithStreamingResponse:
92120
def __init__(self, organization: OrganizationResource) -> None:
93121
self._organization = organization
94122

123+
@cached_property
124+
def entitlements(self) -> EntitlementsResourceWithStreamingResponse:
125+
"""Read and manage organization-level limits."""
126+
return EntitlementsResourceWithStreamingResponse(self._organization.entitlements)
127+
95128
@cached_property
96129
def limits(self) -> LimitsResourceWithStreamingResponse:
97130
"""Read and manage organization-level limits."""
@@ -102,6 +135,11 @@ class AsyncOrganizationResourceWithStreamingResponse:
102135
def __init__(self, organization: AsyncOrganizationResource) -> None:
103136
self._organization = organization
104137

138+
@cached_property
139+
def entitlements(self) -> AsyncEntitlementsResourceWithStreamingResponse:
140+
"""Read and manage organization-level limits."""
141+
return AsyncEntitlementsResourceWithStreamingResponse(self._organization.entitlements)
142+
105143
@cached_property
106144
def limits(self) -> AsyncLimitsResourceWithStreamingResponse:
107145
"""Read and manage organization-level limits."""

src/kernel/types/organization/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
from __future__ import annotations
44

55
from .org_limits import OrgLimits as OrgLimits
6+
from .org_entitlements import OrgEntitlements as OrgEntitlements
67
from .limit_update_params import LimitUpdateParams as LimitUpdateParams

0 commit comments

Comments
 (0)