Skip to content
Closed
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
12 changes: 8 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "5.6.0",
"cliVersion": "5.50.0",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.64.1",
"generatorVersion": "5.14.20",
"generatorConfig": {
"inline_request_params": true,
"client": {
Expand All @@ -23,6 +23,10 @@
}
]
},
"originGitCommit": "73dfd3abce414c6aab288b3bc0e265f30c14f821",
"sdkVersion": "1.2.8"
"originGitCommit": "ea3c4e4fae960ffc12f83f0a22a210732f454d33",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "1.2.9",
"ciProvider": "github",
"sdkVersion": "1.2.9"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

125 changes: 125 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Contributing

Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.

## Getting Started

### Prerequisites

- Python 3.9+
- pip
- poetry

### Installation

Install the project dependencies:

```bash
poetry install
```

### Building

Build the project:

```bash
poetry build
```

### Testing

Run the test suite:

```bash
poetry run pytest
```

### Linting and Formatting

Check code style:

```bash
poetry run ruff check .
poetry run ruff format .
```

### Type Checking

Run the type checker:

```bash
poetry run mypy .
```

## About Generated Code

**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.

### Generated Files

The following directories contain generated code:
- `src/` - API client classes and types
- Most Python files in the project

### How to Customize

If you need to customize the SDK, you have two options:

#### Option 1: Use `.fernignore`

For custom code that should persist across SDK regenerations:

1. Create a `.fernignore` file in the project root
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
3. Add your custom code to those files

Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.

For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).

#### Option 2: Contribute to the Generator

If you want to change how code is generated for all users of this SDK:

1. The Python SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
2. Generator code is located at `generators/python-v2/`
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
4. Submit a pull request with your changes to the generator

This approach is best for:
- Bug fixes in generated code
- New features that would benefit all users
- Improvements to code generation patterns

## Making Changes

### Workflow

1. Create a new branch for your changes
2. Make your modifications
3. Run tests to ensure nothing breaks: `poetry run pytest`
4. Run linting and formatting: `poetry run ruff check .` and `poetry run ruff format .`
5. Run type checking: `poetry run mypy .`
6. Build the project: `poetry build`
7. Commit your changes with a clear commit message
8. Push your branch and create a pull request

### Commit Messages

Write clear, descriptive commit messages that explain what changed and why.

### Code Style

This project uses automated code formatting and linting. Run `poetry run ruff format .` and `poetry run ruff check .` before committing to ensure your code meets the project's style guidelines.

## Questions or Issues?

If you have questions or run into issues:

1. Check the [Fern documentation](https://buildwithfern.com)
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
3. Open a new issue if your question hasn't been addressed

## License

By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "schematichq"
version = "1.2.8"
version = "1.2.9"
description = ""
readme = "README.md"
authors = []
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
httpx>=0.21.2
pydantic>= 1.9.2
pydantic-core>=2.18.2
pydantic-core>=2.18.2,<3.0.0
typing_extensions>= 4.0.0
5 changes: 5 additions & 0 deletions src/schematic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@
scheduledcheckout,
webhooks,
)
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
from .accesstokens import IssueTemporaryAccessTokenResponse
from .accounts import (
CountAccountMembersParams,
Expand Down Expand Up @@ -1038,6 +1039,8 @@
"DataExportStatus": ".types",
"DataExportType": ".types",
"DatastreamCompanyPlan": ".types",
"DefaultAioHttpClient": "._default_clients",
"DefaultAsyncHttpxClient": "._default_clients",
"DeleteApiKeyResponse": ".accounts",
"DeleteBillingCouponResponse": ".billing",
"DeleteBillingCustomerResponse": ".billing",
Expand Down Expand Up @@ -1815,6 +1818,8 @@ def __dir__():
"DataExportStatus",
"DataExportType",
"DatastreamCompanyPlan",
"DefaultAioHttpClient",
"DefaultAsyncHttpxClient",
"DeleteApiKeyResponse",
"DeleteBillingCouponResponse",
"DeleteBillingCustomerResponse",
Expand Down
30 changes: 30 additions & 0 deletions src/schematic/_default_clients.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import httpx

SDK_DEFAULT_TIMEOUT = 60

try:
import httpx_aiohttp # type: ignore[import-not-found]
except ImportError:

class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
def __init__(self, **kwargs: typing.Any) -> None:
raise RuntimeError("To use the aiohttp client, install the aiohttp extra: pip install schematichq[aiohttp]")

else:

class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
def __init__(self, **kwargs: typing.Any) -> None:
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
kwargs.setdefault("follow_redirects", True)
super().__init__(**kwargs)


class DefaultAsyncHttpxClient(httpx.AsyncClient):
def __init__(self, **kwargs: typing.Any) -> None:
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
kwargs.setdefault("follow_redirects", True)
super().__init__(**kwargs)
34 changes: 17 additions & 17 deletions src/schematic/accounts/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.datetime_utils import serialize_datetime
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
from ..core.jsonable_encoder import encode_path_param
from ..core.parse_error import ParsingError
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
Expand Down Expand Up @@ -187,7 +187,7 @@ def get_account_member(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"account-members/{jsonable_encoder(account_member_id)}",
f"account-members/{encode_path_param(account_member_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -636,7 +636,7 @@ def get_api_key(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"api-keys/{jsonable_encoder(api_key_id)}",
f"api-keys/{encode_path_param(api_key_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -734,7 +734,7 @@ def update_api_key(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"api-keys/{jsonable_encoder(api_key_id)}",
f"api-keys/{encode_path_param(api_key_id)}",
method="PUT",
json={
"description": description,
Expand Down Expand Up @@ -842,7 +842,7 @@ def delete_api_key(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"api-keys/{jsonable_encoder(api_key_id)}",
f"api-keys/{encode_path_param(api_key_id)}",
method="DELETE",
request_options=request_options,
)
Expand Down Expand Up @@ -1192,7 +1192,7 @@ def get_audit_log(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"audit-log/{jsonable_encoder(audit_log_id)}",
f"audit-log/{encode_path_param(audit_log_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -1636,7 +1636,7 @@ def get_environment(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"environments/{jsonable_encoder(environment_id)}",
f"environments/{encode_path_param(environment_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -1734,7 +1734,7 @@ def update_environment(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"environments/{jsonable_encoder(environment_id)}",
f"environments/{encode_path_param(environment_id)}",
method="PUT",
json={
"environment_type": environment_type,
Expand Down Expand Up @@ -1842,7 +1842,7 @@ def delete_environment(
OK
"""
_response = self._client_wrapper.httpx_client.request(
f"environments/{jsonable_encoder(environment_id)}",
f"environments/{encode_path_param(environment_id)}",
method="DELETE",
request_options=request_options,
)
Expand Down Expand Up @@ -2250,7 +2250,7 @@ async def get_account_member(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"account-members/{jsonable_encoder(account_member_id)}",
f"account-members/{encode_path_param(account_member_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -2699,7 +2699,7 @@ async def get_api_key(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"api-keys/{jsonable_encoder(api_key_id)}",
f"api-keys/{encode_path_param(api_key_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -2797,7 +2797,7 @@ async def update_api_key(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"api-keys/{jsonable_encoder(api_key_id)}",
f"api-keys/{encode_path_param(api_key_id)}",
method="PUT",
json={
"description": description,
Expand Down Expand Up @@ -2905,7 +2905,7 @@ async def delete_api_key(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"api-keys/{jsonable_encoder(api_key_id)}",
f"api-keys/{encode_path_param(api_key_id)}",
method="DELETE",
request_options=request_options,
)
Expand Down Expand Up @@ -3255,7 +3255,7 @@ async def get_audit_log(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"audit-log/{jsonable_encoder(audit_log_id)}",
f"audit-log/{encode_path_param(audit_log_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -3699,7 +3699,7 @@ async def get_environment(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"environments/{jsonable_encoder(environment_id)}",
f"environments/{encode_path_param(environment_id)}",
method="GET",
request_options=request_options,
)
Expand Down Expand Up @@ -3797,7 +3797,7 @@ async def update_environment(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"environments/{jsonable_encoder(environment_id)}",
f"environments/{encode_path_param(environment_id)}",
method="PUT",
json={
"environment_type": environment_type,
Expand Down Expand Up @@ -3905,7 +3905,7 @@ async def delete_environment(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
f"environments/{jsonable_encoder(environment_id)}",
f"environments/{encode_path_param(environment_id)}",
method="DELETE",
request_options=request_options,
)
Expand Down
Loading
Loading