Skip to content
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.91.0"
".": "0.92.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 139
configured_endpoints: 140
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.92.0](https://github.com/kernel/kernel-python-sdk/compare/v0.91.0...v0.92.0) (2026-08-17)


### Features

* chore(stlc): seal custom-code tracking files ([5b74e46](https://github.com/kernel/kernel-python-sdk/commit/5b74e460198b174e69f0bf690b01f216e89b3dd0))

## [0.91.0](https://github.com/kernel/kernel-python-sdk/compare/v0.90.0...v0.91.0) (2026-08-14)


Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,18 @@ Methods:

# Organization

## Entitlements

Types:

```python
from kernel.types.organization import OrgEntitlements
```

Methods:

- <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>

## Limits

Types:
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 = "kernel"
version = "0.91.0"
version = "0.92.0"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/_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__ = "kernel"
__version__ = "0.91.0" # x-release-please-version
__version__ = "0.92.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/kernel/resources/organization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
LimitsResourceWithStreamingResponse,
AsyncLimitsResourceWithStreamingResponse,
)
from .entitlements import (
EntitlementsResource,
AsyncEntitlementsResource,
EntitlementsResourceWithRawResponse,
AsyncEntitlementsResourceWithRawResponse,
EntitlementsResourceWithStreamingResponse,
AsyncEntitlementsResourceWithStreamingResponse,
)
from .organization import (
OrganizationResource,
AsyncOrganizationResource,
Expand All @@ -18,6 +26,12 @@
)

__all__ = [
"EntitlementsResource",
"AsyncEntitlementsResource",
"EntitlementsResourceWithRawResponse",
"AsyncEntitlementsResourceWithRawResponse",
"EntitlementsResourceWithStreamingResponse",
"AsyncEntitlementsResourceWithStreamingResponse",
"LimitsResource",
"AsyncLimitsResource",
"LimitsResourceWithRawResponse",
Expand Down
147 changes: 147 additions & 0 deletions src/kernel/resources/organization/entitlements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import httpx

from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.organization.org_entitlements import OrgEntitlements

__all__ = ["EntitlementsResource", "AsyncEntitlementsResource"]


class EntitlementsResource(SyncAPIResource):
"""Read and manage organization-level limits."""

@cached_property
def with_raw_response(self) -> EntitlementsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
"""
return EntitlementsResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> EntitlementsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
"""
return EntitlementsResourceWithStreamingResponse(self)

def retrieve(
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,
) -> OrgEntitlements:
"""
Get the authenticated organization's effective feature access and constraints
after applying its plan, active trial treatment, plan status, and
organization-specific overrides. Null constraint values mean unlimited.
"""
return self._get(
"/org/entitlements",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=OrgEntitlements,
)


class AsyncEntitlementsResource(AsyncAPIResource):
"""Read and manage organization-level limits."""

@cached_property
def with_raw_response(self) -> AsyncEntitlementsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
"""
return AsyncEntitlementsResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncEntitlementsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
"""
return AsyncEntitlementsResourceWithStreamingResponse(self)

async def retrieve(
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,
) -> OrgEntitlements:
"""
Get the authenticated organization's effective feature access and constraints
after applying its plan, active trial treatment, plan status, and
organization-specific overrides. Null constraint values mean unlimited.
"""
return await self._get(
"/org/entitlements",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=OrgEntitlements,
)


class EntitlementsResourceWithRawResponse:
def __init__(self, entitlements: EntitlementsResource) -> None:
self._entitlements = entitlements

self.retrieve = to_raw_response_wrapper(
entitlements.retrieve,
)


class AsyncEntitlementsResourceWithRawResponse:
def __init__(self, entitlements: AsyncEntitlementsResource) -> None:
self._entitlements = entitlements

self.retrieve = async_to_raw_response_wrapper(
entitlements.retrieve,
)


class EntitlementsResourceWithStreamingResponse:
def __init__(self, entitlements: EntitlementsResource) -> None:
self._entitlements = entitlements

self.retrieve = to_streamed_response_wrapper(
entitlements.retrieve,
)


class AsyncEntitlementsResourceWithStreamingResponse:
def __init__(self, entitlements: AsyncEntitlementsResource) -> None:
self._entitlements = entitlements

self.retrieve = async_to_streamed_response_wrapper(
entitlements.retrieve,
)
38 changes: 38 additions & 0 deletions src/kernel/resources/organization/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,24 @@
)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from .entitlements import (
EntitlementsResource,
AsyncEntitlementsResource,
EntitlementsResourceWithRawResponse,
AsyncEntitlementsResourceWithRawResponse,
EntitlementsResourceWithStreamingResponse,
AsyncEntitlementsResourceWithStreamingResponse,
)

__all__ = ["OrganizationResource", "AsyncOrganizationResource"]


class OrganizationResource(SyncAPIResource):
@cached_property
def entitlements(self) -> EntitlementsResource:
"""Read and manage organization-level limits."""
return EntitlementsResource(self._client)

@cached_property
def limits(self) -> LimitsResource:
"""Read and manage organization-level limits."""
Expand All @@ -43,6 +56,11 @@ def with_streaming_response(self) -> OrganizationResourceWithStreamingResponse:


class AsyncOrganizationResource(AsyncAPIResource):
@cached_property
def entitlements(self) -> AsyncEntitlementsResource:
"""Read and manage organization-level limits."""
return AsyncEntitlementsResource(self._client)

@cached_property
def limits(self) -> AsyncLimitsResource:
"""Read and manage organization-level limits."""
Expand Down Expand Up @@ -72,6 +90,11 @@ class OrganizationResourceWithRawResponse:
def __init__(self, organization: OrganizationResource) -> None:
self._organization = organization

@cached_property
def entitlements(self) -> EntitlementsResourceWithRawResponse:
"""Read and manage organization-level limits."""
return EntitlementsResourceWithRawResponse(self._organization.entitlements)

@cached_property
def limits(self) -> LimitsResourceWithRawResponse:
"""Read and manage organization-level limits."""
Expand All @@ -82,6 +105,11 @@ class AsyncOrganizationResourceWithRawResponse:
def __init__(self, organization: AsyncOrganizationResource) -> None:
self._organization = organization

@cached_property
def entitlements(self) -> AsyncEntitlementsResourceWithRawResponse:
"""Read and manage organization-level limits."""
return AsyncEntitlementsResourceWithRawResponse(self._organization.entitlements)

@cached_property
def limits(self) -> AsyncLimitsResourceWithRawResponse:
"""Read and manage organization-level limits."""
Expand All @@ -92,6 +120,11 @@ class OrganizationResourceWithStreamingResponse:
def __init__(self, organization: OrganizationResource) -> None:
self._organization = organization

@cached_property
def entitlements(self) -> EntitlementsResourceWithStreamingResponse:
"""Read and manage organization-level limits."""
return EntitlementsResourceWithStreamingResponse(self._organization.entitlements)

@cached_property
def limits(self) -> LimitsResourceWithStreamingResponse:
"""Read and manage organization-level limits."""
Expand All @@ -102,6 +135,11 @@ class AsyncOrganizationResourceWithStreamingResponse:
def __init__(self, organization: AsyncOrganizationResource) -> None:
self._organization = organization

@cached_property
def entitlements(self) -> AsyncEntitlementsResourceWithStreamingResponse:
"""Read and manage organization-level limits."""
return AsyncEntitlementsResourceWithStreamingResponse(self._organization.entitlements)

@cached_property
def limits(self) -> AsyncLimitsResourceWithStreamingResponse:
"""Read and manage organization-level limits."""
Expand Down
1 change: 1 addition & 0 deletions src/kernel/types/organization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
from __future__ import annotations

from .org_limits import OrgLimits as OrgLimits
from .org_entitlements import OrgEntitlements as OrgEntitlements
from .limit_update_params import LimitUpdateParams as LimitUpdateParams
Loading
Loading