diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..5ce2ae1
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @SchematicHQ/devtools
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..1c1f594
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,88 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Overview
+
+This repository contains the Schematic Python SDK, which provides a convenient interface to the Schematic API for Python applications. The library includes type definitions for all request and response fields, and offers both synchronous and asynchronous clients powered by httpx.
+
+## Environment Setup
+
+```bash
+# Install dependencies using Poetry
+poetry install
+
+# Or install via pip
+pip install schematichq
+```
+
+## Development Commands
+
+### Building and Testing
+
+```bash
+# Run all tests
+poetry run pytest
+
+# Run a specific test file
+poetry run pytest tests/custom/test_client.py
+
+# Run tests with specific markers (e.g. asyncio)
+poetry run pytest -m asyncio
+
+# Run tests with more verbose output
+poetry run pytest -v
+```
+
+### Code Quality
+
+```bash
+# Type checking
+poetry run mypy src
+
+# Run linter
+poetry run ruff check src
+```
+
+## Project Structure
+
+- `src/schematic/` - Main SDK code
+ - `client.py` - Main client entry point, provides Schematic and AsyncSchematic classes
+ - `base_client.py` - Base client implementation
+ - `event_buffer.py` - Buffer for events with retry logic
+ - `cache.py` - Local cache implementation for flag checks
+ - `core/` - Core functionality like HTTP client, API error handling
+ - `webhook_utils/` - Utilities for webhook verification
+ - Various services organized by API section (companies, events, features, etc.)
+
+## Key Components
+
+### Clients
+
+The SDK provides two main client classes:
+
+1. `Schematic` - Synchronous client
+2. `AsyncSchematic` - Asynchronous client
+
+Both clients have the same interface but the async client returns awaitable objects.
+
+### Event Buffer
+
+The SDK implements an event buffer for batching events before sending them to the API. Events are automatically flushed periodically or when the buffer is full. The event buffer includes retry logic with exponential backoff.
+
+### Configuration
+
+Clients can be configured with:
+
+- Custom HTTP clients
+- Flag defaults for offline/fallback mode
+- Cache settings
+- Timeout settings
+- Retry settings
+
+### Webhook Verification
+
+The SDK provides utilities for verifying webhook signatures from Schematic to ensure security:
+
+- `verify_webhook_signature` - For web request verification
+- `verify_signature` - For manual signature verification
diff --git a/poetry.lock b/poetry.lock
index 98ff907..c8e7e14 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -60,15 +60,18 @@ files = [
[[package]]
name = "exceptiongroup"
-version = "1.2.2"
+version = "1.3.0"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
files = [
- {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"},
- {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"},
+ {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"},
+ {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"},
]
+[package.dependencies]
+typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""}
+
[package.extras]
test = ["pytest (>=6)"]
diff --git a/pyproject.toml b/pyproject.toml
index 945db2a..6336db8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,7 +3,7 @@ name = "schematichq"
[tool.poetry]
name = "schematichq"
-version = "1.0.8"
+version = "1.0.9"
description = ""
readme = "README.md"
authors = []
diff --git a/reference.md b/reference.md
deleted file mode 100644
index ba9546c..0000000
--- a/reference.md
+++ /dev/null
@@ -1,12539 +0,0 @@
-# Reference
-## accounts
-client.accounts.list_api_keys(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.list_api_keys(require_environment=True, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**require_environment:** `bool`
-
-
-
-
-
--
-
-**environment_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.create_api_key(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.create_api_key(name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**description:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**environment_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.get_api_key(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.get_api_key(api_key_id='api_key_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**api_key_id:** `str` — api_key_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.update_api_key(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.update_api_key(api_key_id='api_key_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**api_key_id:** `str` — api_key_id
-
-
-
-
-
--
-
-**description:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.delete_api_key(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.delete_api_key(api_key_id='api_key_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**api_key_id:** `str` — api_key_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.count_api_keys(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.count_api_keys(require_environment=True, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**require_environment:** `bool`
-
-
-
-
-
--
-
-**environment_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.list_api_requests(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.list_api_requests()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_type:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**environment_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.get_api_request(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.get_api_request(api_request_id='api_request_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**api_request_id:** `str` — api_request_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.count_api_requests(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.count_api_requests()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_type:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**environment_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.list_environments(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.list_environments()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.create_environment(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.create_environment(environment_type="development", name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**environment_type:** `CreateEnvironmentRequestBodyEnvironmentType`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.get_environment(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.get_environment(environment_id='environment_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**environment_id:** `str` — environment_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.update_environment(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.update_environment(environment_id='environment_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**environment_id:** `str` — environment_id
-
-
-
-
-
--
-
-**environment_type:** `typing.Optional[UpdateEnvironmentRequestBodyEnvironmentType]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.accounts.delete_environment(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accounts.delete_environment(environment_id='environment_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**environment_id:** `str` — environment_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## features
-client.features.count_audience_companies(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateOrUpdateConditionGroupRequestBody
-from schematic import CreateOrUpdateConditionRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.count_audience_companies(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**condition_groups:** `typing.Sequence[CreateOrUpdateConditionGroupRequestBody]`
-
-
-
-
-
--
-
-**conditions:** `typing.Sequence[CreateOrUpdateConditionRequestBody]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.count_audience_users(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateOrUpdateConditionGroupRequestBody
-from schematic import CreateOrUpdateConditionRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.count_audience_users(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**condition_groups:** `typing.Sequence[CreateOrUpdateConditionGroupRequestBody]`
-
-
-
-
-
--
-
-**conditions:** `typing.Sequence[CreateOrUpdateConditionRequestBody]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.list_audience_companies(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateOrUpdateConditionGroupRequestBody
-from schematic import CreateOrUpdateConditionRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.list_audience_companies(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**condition_groups:** `typing.Sequence[CreateOrUpdateConditionGroupRequestBody]`
-
-
-
-
-
--
-
-**conditions:** `typing.Sequence[CreateOrUpdateConditionRequestBody]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.list_audience_users(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateOrUpdateConditionGroupRequestBody
-from schematic import CreateOrUpdateConditionRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.list_audience_users(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**condition_groups:** `typing.Sequence[CreateOrUpdateConditionGroupRequestBody]`
-
-
-
-
-
--
-
-**conditions:** `typing.Sequence[CreateOrUpdateConditionRequestBody]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.list_features(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.list_features()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**without_company_override_for:** `typing.Optional[str]` — Filter out features that already have a company override for the specified company ID
-
-
-
-
-
--
-
-**without_plan_entitlement_for:** `typing.Optional[str]` — Filter out features that already have a plan entitlement for the specified plan ID
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.create_feature(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.create_feature(description='description', feature_type="boolean", name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**description:** `str`
-
-
-
-
-
--
-
-**feature_type:** `CreateFeatureRequestBodyFeatureType`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**event_subtype:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**flag:** `typing.Optional[CreateOrUpdateFlagRequestBody]`
-
-
-
-
-
--
-
-**icon:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**lifecycle_phase:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**maintainer_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**plural_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**singular_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.get_feature(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.get_feature(feature_id='feature_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str` — feature_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.update_feature(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.update_feature(feature_id='feature_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str` — feature_id
-
-
-
-
-
--
-
-**description:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**event_subtype:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**feature_type:** `typing.Optional[UpdateFeatureRequestBodyFeatureType]`
-
-
-
-
-
--
-
-**flag:** `typing.Optional[CreateOrUpdateFlagRequestBody]`
-
-
-
-
-
--
-
-**icon:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**lifecycle_phase:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**maintainer_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**plural_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**singular_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.delete_feature(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.delete_feature(feature_id='feature_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str` — feature_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.count_features(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.count_features()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**without_company_override_for:** `typing.Optional[str]` — Filter out features that already have a company override for the specified company ID
-
-
-
-
-
--
-
-**without_plan_entitlement_for:** `typing.Optional[str]` — Filter out features that already have a plan entitlement for the specified plan ID
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.list_flags(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.list_flags()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.create_flag(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.create_flag(default_value=True, description='description', flag_type='flag_type', key='key', name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**default_value:** `bool`
-
-
-
-
-
--
-
-**description:** `str`
-
-
-
-
-
--
-
-**flag_type:** `str`
-
-
-
-
-
--
-
-**key:** `str`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**feature_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**maintainer_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.get_flag(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.get_flag(flag_id='flag_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**flag_id:** `str` — flag_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.update_flag(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.update_flag(flag_id='flag_id', default_value=True, description='description', flag_type='flag_type', key='key', name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**flag_id:** `str` — flag_id
-
-
-
-
-
--
-
-**default_value:** `bool`
-
-
-
-
-
--
-
-**description:** `str`
-
-
-
-
-
--
-
-**flag_type:** `str`
-
-
-
-
-
--
-
-**key:** `str`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**feature_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**maintainer_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.delete_flag(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.delete_flag(flag_id='flag_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**flag_id:** `str` — flag_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.update_flag_rules(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateOrUpdateRuleRequestBody
-from schematic import CreateOrUpdateConditionGroupRequestBody
-from schematic import CreateOrUpdateConditionRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.update_flag_rules(flag_id='flag_id', rules=[CreateOrUpdateRuleRequestBody(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], name='name', priority=1, value=True, )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**flag_id:** `str` — flag_id
-
-
-
-
-
--
-
-**rules:** `typing.Sequence[CreateOrUpdateRuleRequestBody]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.check_flag(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.check_flag(key='key', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**key:** `str` — key
-
-
-
-
-
--
-
-**company:** `typing.Optional[typing.Dict[str, str]]`
-
-
-
-
-
--
-
-**user:** `typing.Optional[typing.Dict[str, str]]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.check_flags(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.check_flags()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company:** `typing.Optional[typing.Dict[str, str]]`
-
-
-
-
-
--
-
-**user:** `typing.Optional[typing.Dict[str, str]]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.features.count_flags(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.features.count_flags()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## billing
-client.billing.list_coupons(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.list_coupons()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**is_active:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_billing_coupon(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_billing_coupon(amount_off=1, duration='duration', duration_in_months=1, external_id='external_id', max_redemptions=1, name='name', percent_off=1.1, times_redeemed=1, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**amount_off:** `int`
-
-
-
-
-
--
-
-**duration:** `str`
-
-
-
-
-
--
-
-**duration_in_months:** `int`
-
-
-
-
-
--
-
-**external_id:** `str`
-
-
-
-
-
--
-
-**max_redemptions:** `int`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**percent_off:** `float`
-
-
-
-
-
--
-
-**times_redeemed:** `int`
-
-
-
-
-
--
-
-**currency:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_billing_customer(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_billing_customer(email='email', external_id='external_id', failed_to_import=True, meta={'key': 'value'}, name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**email:** `str`
-
-
-
-
-
--
-
-**external_id:** `str`
-
-
-
-
-
--
-
-**failed_to_import:** `bool`
-
-
-
-
-
--
-
-**meta:** `typing.Dict[str, str]`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**default_payment_method_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.list_customers_with_subscriptions(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.list_customers_with_subscriptions()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**failed_to_import:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.count_customers(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.count_customers()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**failed_to_import:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.list_invoices(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.list_invoices(customer_external_id='customer_external_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**customer_external_id:** `str`
-
-
-
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**subscription_external_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_invoice(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_invoice(amount_due=1, amount_paid=1, amount_remaining=1, collection_method='collection_method', currency='currency', customer_external_id='customer_external_id', subtotal=1, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**amount_due:** `int`
-
-
-
-
-
--
-
-**amount_paid:** `int`
-
-
-
-
-
--
-
-**amount_remaining:** `int`
-
-
-
-
-
--
-
-**collection_method:** `str`
-
-
-
-
-
--
-
-**currency:** `str`
-
-
-
-
-
--
-
-**customer_external_id:** `str`
-
-
-
-
-
--
-
-**subtotal:** `int`
-
-
-
-
-
--
-
-**due_date:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**external_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**payment_method_external_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**subscription_external_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**url:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.list_meters(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.list_meters()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**display_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_billing_meter(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_billing_meter(display_name='display_name', event_name='event_name', event_payload_key='event_payload_key', external_id='external_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**display_name:** `str`
-
-
-
-
-
--
-
-**event_name:** `str`
-
-
-
-
-
--
-
-**event_payload_key:** `str`
-
-
-
-
-
--
-
-**external_id:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.list_payment_methods(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.list_payment_methods(customer_external_id='customer_external_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**customer_external_id:** `str`
-
-
-
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_payment_method(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_payment_method(customer_external_id='customer_external_id', external_id='external_id', payment_method_type='payment_method_type', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**customer_external_id:** `str`
-
-
-
-
-
--
-
-**external_id:** `str`
-
-
-
-
-
--
-
-**payment_method_type:** `str`
-
-
-
-
-
--
-
-**account_last_4:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**account_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**bank_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**billing_email:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**billing_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**card_brand:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**card_exp_month:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**card_exp_year:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**card_last_4:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.search_billing_prices(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.search_billing_prices()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**interval:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**usage_type:** `typing.Optional[SearchBillingPricesRequestUsageType]`
-
-
-
-
-
--
-
-**price:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_billing_price(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateBillingPriceTierRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_billing_price(billing_scheme="per_unit", currency='currency', external_account_id='external_account_id', interval='interval', is_active=True, price=1, price_external_id='price_external_id', price_tiers=[CreateBillingPriceTierRequestBody(price_external_id='price_external_id', )], product_external_id='product_external_id', usage_type="licensed", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**billing_scheme:** `CreateBillingPriceRequestBodyBillingScheme`
-
-
-
-
-
--
-
-**currency:** `str`
-
-
-
-
-
--
-
-**external_account_id:** `str`
-
-
-
-
-
--
-
-**interval:** `str`
-
-
-
-
-
--
-
-**is_active:** `bool`
-
-
-
-
-
--
-
-**price:** `int`
-
-
-
-
-
--
-
-**price_external_id:** `str`
-
-
-
-
-
--
-
-**price_tiers:** `typing.Sequence[CreateBillingPriceTierRequestBody]`
-
-
-
-
-
--
-
-**product_external_id:** `str`
-
-
-
-
-
--
-
-**usage_type:** `CreateBillingPriceRequestBodyUsageType`
-
-
-
-
-
--
-
-**meter_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**package_size:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**price_decimal:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**tier_mode:** `typing.Optional[CreateBillingPriceRequestBodyTierMode]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.delete_billing_product(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.delete_billing_product(billing_id='billing_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**billing_id:** `str` — billing_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.list_product_prices(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.list_product_prices()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**price_usage_type:** `typing.Optional[ListProductPricesRequestPriceUsageType]`
-
-
-
-
-
--
-
-**without_linked_to_plan:** `typing.Optional[bool]` — Filter products that are not linked to any plan
-
-
-
-
-
--
-
-**with_one_time_charges:** `typing.Optional[bool]` — Filter products that are one time charges
-
-
-
-
-
--
-
-**with_zero_price:** `typing.Optional[bool]` — Filter products that have zero price for free subscription type
-
-
-
-
-
--
-
-**with_prices_only:** `typing.Optional[bool]` — Filter products that have prices
-
-
-
-
-
--
-
-**is_active:** `typing.Optional[bool]` — Filter products that are active
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.delete_product_price(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.delete_product_price(billing_id='billing_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**billing_id:** `str` — billing_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_billing_product(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_billing_product(external_id='external_id', name='name', price=1.1, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**external_id:** `str`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**price:** `float`
-
-
-
-
-
--
-
-**is_active:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.list_billing_products(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.list_billing_products()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**price_usage_type:** `typing.Optional[ListBillingProductsRequestPriceUsageType]`
-
-
-
-
-
--
-
-**without_linked_to_plan:** `typing.Optional[bool]` — Filter products that are not linked to any plan
-
-
-
-
-
--
-
-**with_one_time_charges:** `typing.Optional[bool]` — Filter products that are one time charges
-
-
-
-
-
--
-
-**with_zero_price:** `typing.Optional[bool]` — Filter products that have zero price for free subscription type
-
-
-
-
-
--
-
-**with_prices_only:** `typing.Optional[bool]` — Filter products that have prices
-
-
-
-
-
--
-
-**is_active:** `typing.Optional[bool]` — Filter products that are active
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.count_billing_products(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.count_billing_products()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**price_usage_type:** `typing.Optional[CountBillingProductsRequestPriceUsageType]`
-
-
-
-
-
--
-
-**without_linked_to_plan:** `typing.Optional[bool]` — Filter products that are not linked to any plan
-
-
-
-
-
--
-
-**with_one_time_charges:** `typing.Optional[bool]` — Filter products that are one time charges
-
-
-
-
-
--
-
-**with_zero_price:** `typing.Optional[bool]` — Filter products that have zero price for free subscription type
-
-
-
-
-
--
-
-**with_prices_only:** `typing.Optional[bool]` — Filter products that have prices
-
-
-
-
-
--
-
-**is_active:** `typing.Optional[bool]` — Filter products that are active
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.billing.upsert_billing_subscription(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import BillingSubscriptionDiscount
-import datetime
-from schematic import BillingProductPricing
-client = Schematic(api_key="YOUR_API_KEY", )
-client.billing.upsert_billing_subscription(cancel_at_period_end=True, currency='currency', customer_external_id='customer_external_id', discounts=[BillingSubscriptionDiscount(coupon_external_id='coupon_external_id', external_id='external_id', is_active=True, started_at=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), )], expired_at=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), product_external_ids=[BillingProductPricing(currency='currency', interval='interval', price=1, price_external_id='price_external_id', product_external_id='product_external_id', quantity=1, usage_type="licensed", )], subscription_external_id='subscription_external_id', total_price=1, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**cancel_at_period_end:** `bool`
-
-
-
-
-
--
-
-**currency:** `str`
-
-
-
-
-
--
-
-**customer_external_id:** `str`
-
-
-
-
-
--
-
-**discounts:** `typing.Sequence[BillingSubscriptionDiscount]`
-
-
-
-
-
--
-
-**expired_at:** `dt.datetime`
-
-
-
-
-
--
-
-**product_external_ids:** `typing.Sequence[BillingProductPricing]`
-
-
-
-
-
--
-
-**subscription_external_id:** `str`
-
-
-
-
-
--
-
-**total_price:** `int`
-
-
-
-
-
--
-
-**cancel_at:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**default_payment_method_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**interval:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]`
-
-
-
-
-
--
-
-**period_end:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**period_start:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**status:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trial_end:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**trial_end_setting:** `typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## checkout
-client.checkout.internal(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import UpdateAddOnRequestBody
-from schematic import UpdatePayInAdvanceRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.checkout.internal(add_on_ids=[UpdateAddOnRequestBody(add_on_id='add_on_id', price_id='price_id', )], company_id='company_id', new_plan_id='new_plan_id', new_price_id='new_price_id', pay_in_advance=[UpdatePayInAdvanceRequestBody(price_id='price_id', quantity=1, )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**add_on_ids:** `typing.Sequence[UpdateAddOnRequestBody]`
-
-
-
-
-
--
-
-**company_id:** `str`
-
-
-
-
-
--
-
-**new_plan_id:** `str`
-
-
-
-
-
--
-
-**new_price_id:** `str`
-
-
-
-
-
--
-
-**pay_in_advance:** `typing.Sequence[UpdatePayInAdvanceRequestBody]`
-
-
-
-
-
--
-
-**coupon_external_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**payment_method_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**promo_code:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.checkout.get_checkout_data(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.checkout.get_checkout_data(company_id='company_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `str`
-
-
-
-
-
--
-
-**selected_plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.checkout.preview_checkout_internal(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import UpdateAddOnRequestBody
-from schematic import UpdatePayInAdvanceRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.checkout.preview_checkout_internal(add_on_ids=[UpdateAddOnRequestBody(add_on_id='add_on_id', price_id='price_id', )], company_id='company_id', new_plan_id='new_plan_id', new_price_id='new_price_id', pay_in_advance=[UpdatePayInAdvanceRequestBody(price_id='price_id', quantity=1, )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**add_on_ids:** `typing.Sequence[UpdateAddOnRequestBody]`
-
-
-
-
-
--
-
-**company_id:** `str`
-
-
-
-
-
--
-
-**new_plan_id:** `str`
-
-
-
-
-
--
-
-**new_price_id:** `str`
-
-
-
-
-
--
-
-**pay_in_advance:** `typing.Sequence[UpdatePayInAdvanceRequestBody]`
-
-
-
-
-
--
-
-**coupon_external_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**payment_method_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**promo_code:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.checkout.update_customer_subscription_trial_end(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.checkout.update_customer_subscription_trial_end(subscription_id='subscription_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**subscription_id:** `str` — subscription_id
-
-
-
-
-
--
-
-**trial_end:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## companies
-client.companies.list_companies(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.list_companies()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_)
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits
-
-
-
-
-
--
-
-**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID
-
-
-
-
-
--
-
-**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan
-
-
-
-
-
--
-
-**with_subscription:** `typing.Optional[bool]` — Filter companies that have a subscription
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.upsert_company(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.upsert_company(keys={'key': 'value'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]` — See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
-
-
-
-
--
-
-**id:** `typing.Optional[str]` — If you know the Schematic ID, you can use that here instead of keys
-
-
-
-
-
--
-
-**last_seen_at:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**traits:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A map of trait names to trait values
-
-
-
-
-
--
-
-**update_only:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_company(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_company(company_id='company_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `str` — company_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.delete_company(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.delete_company(company_id='company_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `str` — company_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.count_companies(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.count_companies()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_)
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits
-
-
-
-
-
--
-
-**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID
-
-
-
-
-
--
-
-**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan
-
-
-
-
-
--
-
-**with_subscription:** `typing.Optional[bool]` — Filter companies that have a subscription
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.create_company(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.create_company(keys={'key': 'value'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]` — See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
-
-
-
-
--
-
-**id:** `typing.Optional[str]` — If you know the Schematic ID, you can use that here instead of keys
-
-
-
-
-
--
-
-**last_seen_at:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**traits:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A map of trait names to trait values
-
-
-
-
-
--
-
-**update_only:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.delete_company_by_keys(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.delete_company_by_keys(keys={'key': 'value'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.lookup_company(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.lookup_company(keys={'keys': 'keys'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]` — Key/value pairs
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_active_deals(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_active_deals(company_id='company_id', deal_stage='deal_stage', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `str`
-
-
-
-
-
--
-
-**deal_stage:** `str`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.list_company_memberships(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.list_company_memberships()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**user_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_or_create_company_membership(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_or_create_company_membership(company_id='company_id', user_id='user_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `str`
-
-
-
-
-
--
-
-**user_id:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.delete_company_membership(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.delete_company_membership(company_membership_id='company_membership_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_membership_id:** `str` — company_membership_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_active_company_subscription(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_active_company_subscription()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.upsert_company_trait(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.upsert_company_trait(keys={'key': 'value'}, trait='trait', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]` — Key/value pairs to identify a company or user
-
-
-
-
-
--
-
-**trait:** `str` — Name of the trait to update
-
-
-
-
-
--
-
-**incr:** `typing.Optional[int]` — Amount to increment the trait by (positive or negative)
-
-
-
-
-
--
-
-**set_:** `typing.Optional[str]` — Value to set the trait to
-
-
-
-
-
--
-
-**update_only:** `typing.Optional[bool]` — Unless this is set, the company or user will be created if it does not already exist
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.list_entity_key_definitions(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.list_entity_key_definitions()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_type:** `typing.Optional[ListEntityKeyDefinitionsRequestEntityType]`
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.count_entity_key_definitions(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.count_entity_key_definitions()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_type:** `typing.Optional[CountEntityKeyDefinitionsRequestEntityType]`
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.list_entity_trait_definitions(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.list_entity_trait_definitions()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_type:** `typing.Optional[ListEntityTraitDefinitionsRequestEntityType]`
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trait_type:** `typing.Optional[ListEntityTraitDefinitionsRequestTraitType]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_or_create_entity_trait_definition(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_or_create_entity_trait_definition(entity_type="company", hierarchy=['hierarchy'], trait_type="boolean", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_type:** `CreateEntityTraitDefinitionRequestBodyEntityType`
-
-
-
-
-
--
-
-**hierarchy:** `typing.Sequence[str]`
-
-
-
-
-
--
-
-**trait_type:** `CreateEntityTraitDefinitionRequestBodyTraitType`
-
-
-
-
-
--
-
-**display_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_entity_trait_definition(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_entity_trait_definition(entity_trait_definition_id='entity_trait_definition_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_trait_definition_id:** `str` — entity_trait_definition_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.update_entity_trait_definition(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.update_entity_trait_definition(entity_trait_definition_id='entity_trait_definition_id', trait_type="boolean", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_trait_definition_id:** `str` — entity_trait_definition_id
-
-
-
-
-
--
-
-**trait_type:** `UpdateEntityTraitDefinitionRequestBodyTraitType`
-
-
-
-
-
--
-
-**display_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.count_entity_trait_definitions(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.count_entity_trait_definitions()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_type:** `typing.Optional[CountEntityTraitDefinitionsRequestEntityType]`
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trait_type:** `typing.Optional[CountEntityTraitDefinitionsRequestTraitType]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_entity_trait_values(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_entity_trait_values(definition_id='definition_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**definition_id:** `str`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.upsert_user_trait(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.upsert_user_trait(keys={'key': 'value'}, trait='trait', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]` — Key/value pairs to identify a company or user
-
-
-
-
-
--
-
-**trait:** `str` — Name of the trait to update
-
-
-
-
-
--
-
-**incr:** `typing.Optional[int]` — Amount to increment the trait by (positive or negative)
-
-
-
-
-
--
-
-**set_:** `typing.Optional[str]` — Value to set the trait to
-
-
-
-
-
--
-
-**update_only:** `typing.Optional[bool]` — Unless this is set, the company or user will be created if it does not already exist
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.list_users(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.list_users()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]` — Filter users by company ID (starts with comp_)
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter users by multiple user IDs (starts with user_)
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]` — Filter users by plan ID (starts with plan_)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for users by name, keys or string traits
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.upsert_user(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.upsert_user(companies=[{'key': 'value'}], company={'key': 'value'}, keys={'key': 'value'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**companies:** `typing.Sequence[typing.Dict[str, str]]` — Optionally specify companies using array of key/value pairs
-
-
-
-
-
--
-
-**company:** `typing.Dict[str, str]` — Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
-
-
-
-
-
--
-
-**keys:** `typing.Dict[str, str]` — See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
-
-
-
-
--
-
-**company_id:** `typing.Optional[str]` — Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
-
-
-
-
-
--
-
-**company_ids:** `typing.Optional[typing.Sequence[str]]` — Optionally specify companies using Schematic company ID
-
-
-
-
-
--
-
-**id:** `typing.Optional[str]` — If you know the Schematic ID, you can use that here instead of keys
-
-
-
-
-
--
-
-**last_seen_at:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**traits:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A map of trait names to trait values
-
-
-
-
-
--
-
-**update_only:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.get_user(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.get_user(user_id='user_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**user_id:** `str` — user_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.delete_user(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.delete_user(user_id='user_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**user_id:** `str` — user_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.count_users(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.count_users()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]` — Filter users by company ID (starts with comp_)
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter users by multiple user IDs (starts with user_)
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]` — Filter users by plan ID (starts with plan_)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for users by name, keys or string traits
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.create_user(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.create_user(companies=[{'key': 'value'}], company={'key': 'value'}, keys={'key': 'value'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**companies:** `typing.Sequence[typing.Dict[str, str]]` — Optionally specify companies using array of key/value pairs
-
-
-
-
-
--
-
-**company:** `typing.Dict[str, str]` — Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
-
-
-
-
-
--
-
-**keys:** `typing.Dict[str, str]` — See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
-
-
-
-
--
-
-**company_id:** `typing.Optional[str]` — Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
-
-
-
-
-
--
-
-**company_ids:** `typing.Optional[typing.Sequence[str]]` — Optionally specify companies using Schematic company ID
-
-
-
-
-
--
-
-**id:** `typing.Optional[str]` — If you know the Schematic ID, you can use that here instead of keys
-
-
-
-
-
--
-
-**last_seen_at:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**traits:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A map of trait names to trait values
-
-
-
-
-
--
-
-**update_only:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.delete_user_by_keys(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.delete_user_by_keys(keys={'key': 'value'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.companies.lookup_user(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.companies.lookup_user(keys={'keys': 'keys'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]` — Key/value pairs
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## entitlements
-client.entitlements.list_company_overrides(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.list_company_overrides()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]` — Filter company overrides by a single company ID (starting with comp_)
-
-
-
-
-
--
-
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company IDs (starting with comp_)
-
-
-
-
-
--
-
-**feature_id:** `typing.Optional[str]` — Filter company overrides by a single feature ID (starting with feat_)
-
-
-
-
-
--
-
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple feature IDs (starting with feat_)
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company override IDs (starting with cmov_)
-
-
-
-
-
--
-
-**without_expired:** `typing.Optional[bool]` — Filter company overrides by whether they have not expired
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for company overrides by feature or company name
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.create_company_override(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.create_company_override(company_id='company_id', feature_id='feature_id', value_type="boolean", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `str`
-
-
-
-
-
--
-
-**feature_id:** `str`
-
-
-
-
-
--
-
-**value_type:** `CreateCompanyOverrideRequestBodyValueType`
-
-
-
-
-
--
-
-**expiration_date:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**metric_period:** `typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod]`
-
-
-
-
-
--
-
-**metric_period_month_reset:** `typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset]`
-
-
-
-
-
--
-
-**value_bool:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**value_numeric:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**value_trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.get_company_override(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.get_company_override(company_override_id='company_override_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_override_id:** `str` — company_override_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.update_company_override(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.update_company_override(company_override_id='company_override_id', value_type="boolean", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_override_id:** `str` — company_override_id
-
-
-
-
-
--
-
-**value_type:** `UpdateCompanyOverrideRequestBodyValueType`
-
-
-
-
-
--
-
-**expiration_date:** `typing.Optional[dt.datetime]`
-
-
-
-
-
--
-
-**metric_period:** `typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod]`
-
-
-
-
-
--
-
-**metric_period_month_reset:** `typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset]`
-
-
-
-
-
--
-
-**value_bool:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**value_numeric:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**value_trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.delete_company_override(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.delete_company_override(company_override_id='company_override_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_override_id:** `str` — company_override_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.count_company_overrides(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.count_company_overrides()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]` — Filter company overrides by a single company ID (starting with comp_)
-
-
-
-
-
--
-
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company IDs (starting with comp_)
-
-
-
-
-
--
-
-**feature_id:** `typing.Optional[str]` — Filter company overrides by a single feature ID (starting with feat_)
-
-
-
-
-
--
-
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple feature IDs (starting with feat_)
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company override IDs (starting with cmov_)
-
-
-
-
-
--
-
-**without_expired:** `typing.Optional[bool]` — Filter company overrides by whether they have not expired
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for company overrides by feature or company name
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.list_feature_companies(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.list_feature_companies(feature_id='feature_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.count_feature_companies(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.count_feature_companies(feature_id='feature_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.list_feature_usage(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.list_feature_usage()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**company_keys:** `typing.Optional[typing.Dict[str, str]]`
-
-
-
-
-
--
-
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**without_negative_entitlements:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.count_feature_usage(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.count_feature_usage()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**company_keys:** `typing.Optional[typing.Dict[str, str]]`
-
-
-
-
-
--
-
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**without_negative_entitlements:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.list_feature_users(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.list_feature_users(feature_id='feature_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.count_feature_users(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.count_feature_users(feature_id='feature_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.list_plan_entitlements(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.list_plan_entitlements()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `typing.Optional[str]` — Filter plan entitlements by a single feature ID (starting with feat_)
-
-
-
-
-
--
-
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple feature IDs (starting with feat_)
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan ID (starting with plan_)
-
-
-
-
-
--
-
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan IDs (starting with plan_)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for plan entitlements by feature or company name
-
-
-
-
-
--
-
-**with_metered_products:** `typing.Optional[bool]` — Filter plan entitlements only with metered products
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.create_plan_entitlement(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.create_plan_entitlement(feature_id='feature_id', plan_id='plan_id', value_type="boolean", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `str`
-
-
-
-
-
--
-
-**plan_id:** `str`
-
-
-
-
-
--
-
-**value_type:** `CreatePlanEntitlementRequestBodyValueType`
-
-
-
-
-
--
-
-**currency:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**metric_period:** `typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod]`
-
-
-
-
-
--
-
-**metric_period_month_reset:** `typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset]`
-
-
-
-
-
--
-
-**monthly_metered_price_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**monthly_unit_price:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**monthly_unit_price_decimal:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**overage_billing_product_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**price_behavior:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**soft_limit:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**value_bool:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**value_numeric:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**value_trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**yearly_metered_price_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**yearly_unit_price:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**yearly_unit_price_decimal:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.get_plan_entitlement(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.get_plan_entitlement(plan_entitlement_id='plan_entitlement_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_entitlement_id:** `str` — plan_entitlement_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.update_plan_entitlement(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.update_plan_entitlement(plan_entitlement_id='plan_entitlement_id', value_type="boolean", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_entitlement_id:** `str` — plan_entitlement_id
-
-
-
-
-
--
-
-**value_type:** `UpdatePlanEntitlementRequestBodyValueType`
-
-
-
-
-
--
-
-**currency:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**metric_period:** `typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod]`
-
-
-
-
-
--
-
-**metric_period_month_reset:** `typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset]`
-
-
-
-
-
--
-
-**monthly_metered_price_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**monthly_unit_price:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**monthly_unit_price_decimal:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**overage_billing_product_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**price_behavior:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**soft_limit:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**value_bool:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**value_numeric:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**value_trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**yearly_metered_price_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**yearly_unit_price:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**yearly_unit_price_decimal:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.delete_plan_entitlement(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.delete_plan_entitlement(plan_entitlement_id='plan_entitlement_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_entitlement_id:** `str` — plan_entitlement_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.count_plan_entitlements(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.count_plan_entitlements()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**feature_id:** `typing.Optional[str]` — Filter plan entitlements by a single feature ID (starting with feat_)
-
-
-
-
-
--
-
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple feature IDs (starting with feat_)
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan ID (starting with plan_)
-
-
-
-
-
--
-
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan IDs (starting with plan_)
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]` — Search for plan entitlements by feature or company name
-
-
-
-
-
--
-
-**with_metered_products:** `typing.Optional[bool]` — Filter plan entitlements only with metered products
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.entitlements.get_feature_usage_by_company(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.entitlements.get_feature_usage_by_company(keys={'keys': 'keys'}, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**keys:** `typing.Dict[str, str]` — Key/value pairs
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## plans
-client.plans.update_company_plans(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.update_company_plans(company_plan_id='company_plan_id', add_on_ids=['add_on_ids'], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_plan_id:** `str` — company_plan_id
-
-
-
-
-
--
-
-**add_on_ids:** `typing.Sequence[str]`
-
-
-
-
-
--
-
-**base_plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.get_audience(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.get_audience(plan_audience_id='plan_audience_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_audience_id:** `str` — plan_audience_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.update_audience(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateOrUpdateConditionGroupRequestBody
-from schematic import CreateOrUpdateConditionRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.update_audience(plan_audience_id='plan_audience_id', condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_audience_id:** `str` — plan_audience_id
-
-
-
-
-
--
-
-**condition_groups:** `typing.Sequence[CreateOrUpdateConditionGroupRequestBody]`
-
-
-
-
-
--
-
-**conditions:** `typing.Sequence[CreateOrUpdateConditionRequestBody]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.delete_audience(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.delete_audience(plan_audience_id='plan_audience_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_audience_id:** `str` — plan_audience_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.list_plan_traits(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.list_plan_traits()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.create_plan_trait(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.create_plan_trait(plan_id='plan_id', trait_id='trait_id', trait_value='trait_value', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_id:** `str`
-
-
-
-
-
--
-
-**trait_id:** `str`
-
-
-
-
-
--
-
-**trait_value:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.get_plan_trait(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.get_plan_trait(plan_trait_id='plan_trait_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_trait_id:** `str` — plan_trait_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.update_plan_trait(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.update_plan_trait(plan_trait_id='plan_trait_id', plan_id='plan_id', trait_value='trait_value', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_trait_id:** `str` — plan_trait_id
-
-
-
-
-
--
-
-**plan_id:** `str`
-
-
-
-
-
--
-
-**trait_value:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.delete_plan_trait(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.delete_plan_trait(plan_trait_id='plan_trait_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_trait_id:** `str` — plan_trait_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.count_plan_traits(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.count_plan_traits()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trait_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.list_plans(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.list_plans()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**has_product_id:** `typing.Optional[bool]` — Filter out plans that do not have a billing product ID
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**plan_type:** `typing.Optional[ListPlansRequestPlanType]` — Filter by plan type
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**without_entitlement_for:** `typing.Optional[str]` — Filter out plans that already have a plan entitlement for the specified feature ID
-
-
-
-
-
--
-
-**without_product_id:** `typing.Optional[bool]` — Filter out plans that have a billing product ID
-
-
-
-
-
--
-
-**without_paid_product_id:** `typing.Optional[bool]` — Filter out plans that have a paid billing product ID
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.create_plan(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.create_plan(description='description', name='name', plan_type="plan", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**description:** `str`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**plan_type:** `CreatePlanRequestBodyPlanType`
-
-
-
-
-
--
-
-**icon:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.get_plan(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.get_plan(plan_id='plan_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_id:** `str` — plan_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.update_plan(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.update_plan(plan_id='plan_id', name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_id:** `str` — plan_id
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**description:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**icon:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.delete_plan(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.delete_plan(plan_id='plan_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_id:** `str` — plan_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.upsert_billing_product_plan(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.upsert_billing_product_plan(plan_id='plan_id', is_free_plan=True, is_trialable=True, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_id:** `str` — plan_id
-
-
-
-
-
--
-
-**is_free_plan:** `bool`
-
-
-
-
-
--
-
-**is_trialable:** `bool`
-
-
-
-
-
--
-
-**billing_product_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**charge_type:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**monthly_price_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**one_time_price_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trial_days:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**yearly_price_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plans.count_plans(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plans.count_plans()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**has_product_id:** `typing.Optional[bool]` — Filter out plans that do not have a billing product ID
-
-
-
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**plan_type:** `typing.Optional[CountPlansRequestPlanType]` — Filter by plan type
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**without_entitlement_for:** `typing.Optional[str]` — Filter out plans that already have a plan entitlement for the specified feature ID
-
-
-
-
-
--
-
-**without_product_id:** `typing.Optional[bool]` — Filter out plans that have a billing product ID
-
-
-
-
-
--
-
-**without_paid_product_id:** `typing.Optional[bool]` — Filter out plans that have a paid billing product ID
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## components
-client.components.list_components(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.components.list_components()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.components.create_component(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.components.create_component(entity_type="entitlement", name='name', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**entity_type:** `CreateComponentRequestBodyEntityType`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**ast:** `typing.Optional[typing.Dict[str, float]]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.components.get_component(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.components.get_component(component_id='component_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**component_id:** `str` — component_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.components.update_component(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.components.update_component(component_id='component_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**component_id:** `str` — component_id
-
-
-
-
-
--
-
-**ast:** `typing.Optional[typing.Dict[str, float]]`
-
-
-
-
-
--
-
-**entity_type:** `typing.Optional[UpdateComponentRequestBodyEntityType]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**state:** `typing.Optional[UpdateComponentRequestBodyState]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.components.delete_component(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.components.delete_component(component_id='component_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**component_id:** `str` — component_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.components.count_components(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.components.count_components()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.components.preview_component_data(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.components.preview_component_data()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**component_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## crm
-client.crm.upsert_deal_line_item_association(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.crm.upsert_deal_line_item_association(deal_external_id='deal_external_id', line_item_external_id='line_item_external_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**deal_external_id:** `str`
-
-
-
-
-
--
-
-**line_item_external_id:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.crm.upsert_line_item(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.crm.upsert_line_item(amount='amount', interval='interval', line_item_external_id='line_item_external_id', product_external_id='product_external_id', quantity=1, )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**amount:** `str`
-
-
-
-
-
--
-
-**interval:** `str`
-
-
-
-
-
--
-
-**line_item_external_id:** `str`
-
-
-
-
-
--
-
-**product_external_id:** `str`
-
-
-
-
-
--
-
-**quantity:** `int`
-
-
-
-
-
--
-
-**discount_percentage:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**term_month:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**total_discount:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.crm.upsert_crm_deal(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.crm.upsert_crm_deal(crm_company_key='crm_company_key', crm_type='crm_type', deal_external_id='deal_external_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**crm_company_key:** `str`
-
-
-
-
-
--
-
-**crm_type:** `str`
-
-
-
-
-
--
-
-**deal_external_id:** `str`
-
-
-
-
-
--
-
-**arr:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**crm_company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**crm_product_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**deal_name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**deal_stage:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**mrr:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.crm.list_crm_products(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.crm.list_crm_products()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.crm.upsert_crm_product(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.crm.upsert_crm_product(currency='currency', description='description', external_id='external_id', interval='interval', name='name', price='price', quantity=1, sku='sku', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**currency:** `str`
-
-
-
-
-
--
-
-**description:** `str`
-
-
-
-
-
--
-
-**external_id:** `str`
-
-
-
-
-
--
-
-**interval:** `str`
-
-
-
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**price:** `str`
-
-
-
-
-
--
-
-**quantity:** `int`
-
-
-
-
-
--
-
-**sku:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## dataexports
-client.dataexports.create_data_export(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.dataexports.create_data_export(metadata='metadata', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**metadata:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## events
-client.events.create_event_batch(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import CreateEventRequestBody
-client = Schematic(api_key="YOUR_API_KEY", )
-client.events.create_event_batch(events=[CreateEventRequestBody(event_type="identify", )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**events:** `typing.Sequence[CreateEventRequestBody]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.events.get_event_summaries(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.events.get_event_summaries()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**event_subtypes:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.events.list_events(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.events.list_events()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**company_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**event_subtype:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**event_types:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**flag_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**user_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.events.create_event(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.events.create_event(event_type="identify", )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**event_type:** `CreateEventRequestBodyEventType` — Either 'identify' or 'track'
-
-
-
-
-
--
-
-**body:** `typing.Optional[EventBody]`
-
-
-
-
-
--
-
-**sent_at:** `typing.Optional[dt.datetime]` — Optionally provide a timestamp at which the event was sent to Schematic
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.events.get_event(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.events.get_event(event_id='event_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**event_id:** `str` — event_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.events.get_segment_integration_status()
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.events.get_segment_integration_status()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## plangroups
-client.plangroups.get_plan_group()
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plangroups.get_plan_group()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plangroups.create_plan_group(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import OrderedPlansInGroup
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plangroups.create_plan_group(add_on_ids=['add_on_ids'], ordered_plans=[OrderedPlansInGroup(plan_id='plan_id', )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**add_on_ids:** `typing.Sequence[str]`
-
-
-
-
-
--
-
-**ordered_plans:** `typing.Sequence[OrderedPlansInGroup]`
-
-
-
-
-
--
-
-**custom_plan_config:** `typing.Optional[CustomPlanConfig]`
-
-
-
-
-
--
-
-**custom_plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**default_plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trial_days:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**trial_payment_method_required:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.plangroups.update_plan_group(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-from schematic import OrderedPlansInGroup
-client = Schematic(api_key="YOUR_API_KEY", )
-client.plangroups.update_plan_group(plan_group_id='plan_group_id', add_on_ids=['add_on_ids'], ordered_plans=[OrderedPlansInGroup(plan_id='plan_id', )], )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**plan_group_id:** `str` — plan_group_id
-
-
-
-
-
--
-
-**add_on_ids:** `typing.Sequence[str]`
-
-
-
-
-
--
-
-**ordered_plans:** `typing.Sequence[OrderedPlansInGroup]`
-
-
-
-
-
--
-
-**custom_plan_config:** `typing.Optional[CustomPlanConfig]`
-
-
-
-
-
--
-
-**custom_plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**default_plan_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**trial_days:** `typing.Optional[int]`
-
-
-
-
-
--
-
-**trial_payment_method_required:** `typing.Optional[bool]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## accesstokens
-client.accesstokens.issue_temporary_access_token(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.accesstokens.issue_temporary_access_token(lookup={'key': 'value'}, resource_type='resource_type', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**lookup:** `typing.Dict[str, str]`
-
-
-
-
-
--
-
-**resource_type:** `str`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-## webhooks
-client.webhooks.list_webhook_events(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.list_webhook_events()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**webhook_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.get_webhook_event(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.get_webhook_event(webhook_event_id='webhook_event_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**webhook_event_id:** `str` — webhook_event_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.count_webhook_events(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.count_webhook_events()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**webhook_id:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.list_webhooks(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.list_webhooks()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.create_webhook(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.create_webhook(name='name', request_types=["company.updated"], url='url', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**name:** `str`
-
-
-
-
-
--
-
-**request_types:** `typing.Sequence[CreateWebhookRequestBodyRequestTypesItem]`
-
-
-
-
-
--
-
-**url:** `str`
-
-
-
-
-
--
-
-**entitlement_trigger_configs:** `typing.Optional[typing.Sequence[EntitlementTriggerConfig]]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.get_webhook(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.get_webhook(webhook_id='webhook_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**webhook_id:** `str` — webhook_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.update_webhook(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.update_webhook(webhook_id='webhook_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**webhook_id:** `str` — webhook_id
-
-
-
-
-
--
-
-**entitlement_trigger_configs:** `typing.Optional[typing.Sequence[EntitlementTriggerConfig]]`
-
-
-
-
-
--
-
-**name:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_types:** `typing.Optional[typing.Sequence[UpdateWebhookRequestBodyRequestTypesItem]]`
-
-
-
-
-
--
-
-**status:** `typing.Optional[UpdateWebhookRequestBodyStatus]`
-
-
-
-
-
--
-
-**url:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.delete_webhook(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.delete_webhook(webhook_id='webhook_id', )
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**webhook_id:** `str` — webhook_id
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
-client.webhooks.count_webhooks(...)
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```python
-from schematic import Schematic
-client = Schematic(api_key="YOUR_API_KEY", )
-client.webhooks.count_webhooks()
-
-```
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-
--
-
-**q:** `typing.Optional[str]`
-
-
-
-
-
--
-
-**limit:** `typing.Optional[int]` — Page limit (default 100)
-
-
-
-
-
--
-
-**offset:** `typing.Optional[int]` — Page offset (default 0)
-
-
-
-
-
--
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/requirements.txt b/requirements.txt
index f502f1b..170f512 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
httpx>=0.21.2
pydantic>= 1.9.2
-pydantic-core==^2.18.2
+pydantic-core==2.18.2
typing_extensions>= 4.0.0
diff --git a/src/schematic/__init__.py b/src/schematic/__init__.py
index 2152a9e..d78c917 100644
--- a/src/schematic/__init__.py
+++ b/src/schematic/__init__.py
@@ -132,6 +132,7 @@
PreviewSubscriptionChangeResponseData,
PreviewSubscriptionFinanceResponseData,
PreviewSubscriptionUpcomingInvoiceLineItems,
+ QuickstartResp,
RawEventBatchResponseData,
RawEventResponseData,
RuleConditionDetailResponseData,
@@ -200,6 +201,7 @@
ListApiRequestsResponse,
ListEnvironmentsParams,
ListEnvironmentsResponse,
+ QuickstartResponse,
UpdateApiKeyResponse,
UpdateEnvironmentRequestBodyEnvironmentType,
UpdateEnvironmentResponse,
@@ -394,7 +396,9 @@
GetEventSummariesResponse,
GetSegmentIntegrationStatusResponse,
ListEventsParams,
+ ListEventsRequestEventTypesItem,
ListEventsResponse,
+ ListEventsResponseParamsEventTypesItem,
)
from .features import (
CheckFlagResponse,
@@ -406,6 +410,7 @@
CountFlagsParams,
CountFlagsResponse,
CreateFeatureRequestBodyFeatureType,
+ CreateFeatureRequestBodyLifecyclePhase,
CreateFeatureResponse,
CreateFlagResponse,
DeleteFeatureResponse,
@@ -419,6 +424,7 @@
ListFlagsParams,
ListFlagsResponse,
UpdateFeatureRequestBodyFeatureType,
+ UpdateFeatureRequestBodyLifecyclePhase,
UpdateFeatureResponse,
UpdateFlagResponse,
UpdateFlagRulesResponse,
@@ -451,6 +457,7 @@
UpdatePlanResponse,
UpdatePlanTraitResponse,
UpsertBillingProductPlanResponse,
+ UpsertBillingProductRequestBodyChargeType,
)
from .version import __version__
from .webhooks import (
@@ -605,6 +612,7 @@
"CreateEventRequestBodyEventType",
"CreateEventResponse",
"CreateFeatureRequestBodyFeatureType",
+ "CreateFeatureRequestBodyLifecyclePhase",
"CreateFeatureResponse",
"CreateFlagRequestBody",
"CreateFlagResponse",
@@ -762,7 +770,9 @@
"ListEnvironmentsParams",
"ListEnvironmentsResponse",
"ListEventsParams",
+ "ListEventsRequestEventTypesItem",
"ListEventsResponse",
+ "ListEventsResponseParamsEventTypesItem",
"ListFeatureCompaniesParams",
"ListFeatureCompaniesResponse",
"ListFeatureUsageParams",
@@ -827,6 +837,8 @@
"PreviewSubscriptionChangeResponseData",
"PreviewSubscriptionFinanceResponseData",
"PreviewSubscriptionUpcomingInvoiceLineItems",
+ "QuickstartResp",
+ "QuickstartResponse",
"RawEventBatchResponseData",
"RawEventResponseData",
"RuleConditionDetailResponseData",
@@ -868,6 +880,7 @@
"UpdateEnvironmentRequestBodyEnvironmentType",
"UpdateEnvironmentResponse",
"UpdateFeatureRequestBodyFeatureType",
+ "UpdateFeatureRequestBodyLifecyclePhase",
"UpdateFeatureResponse",
"UpdateFlagResponse",
"UpdateFlagRulesResponse",
@@ -888,6 +901,7 @@
"UpsertBillingMeterResponse",
"UpsertBillingPriceResponse",
"UpsertBillingProductPlanResponse",
+ "UpsertBillingProductRequestBodyChargeType",
"UpsertBillingProductResponse",
"UpsertBillingSubscriptionResponse",
"UpsertCompanyRequestBody",
diff --git a/src/schematic/accesstokens/client.py b/src/schematic/accesstokens/client.py
index f9bfacd..a76bce6 100644
--- a/src/schematic/accesstokens/client.py
+++ b/src/schematic/accesstokens/client.py
@@ -27,19 +27,13 @@ def with_raw_response(self) -> RawAccesstokensClient:
return self._raw_client
def issue_temporary_access_token(
- self,
- *,
- lookup: typing.Dict[str, str],
- resource_type: str,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, lookup: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
) -> IssueTemporaryAccessTokenResponse:
"""
Parameters
----------
lookup : typing.Dict[str, str]
- resource_type : str
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -51,12 +45,15 @@ def issue_temporary_access_token(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accesstokens.issue_temporary_access_token(lookup={'key': 'value'}, resource_type='resource_type', )
- """
- _response = self._raw_client.issue_temporary_access_token(
- lookup=lookup, resource_type=resource_type, request_options=request_options
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accesstokens.issue_temporary_access_token(
+ lookup={"key": "value"},
)
+ """
+ _response = self._raw_client.issue_temporary_access_token(lookup=lookup, request_options=request_options)
return _response.data
@@ -76,19 +73,13 @@ def with_raw_response(self) -> AsyncRawAccesstokensClient:
return self._raw_client
async def issue_temporary_access_token(
- self,
- *,
- lookup: typing.Dict[str, str],
- resource_type: str,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, lookup: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
) -> IssueTemporaryAccessTokenResponse:
"""
Parameters
----------
lookup : typing.Dict[str, str]
- resource_type : str
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -99,14 +90,22 @@ async def issue_temporary_access_token(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accesstokens.issue_temporary_access_token(lookup={'key': 'value'}, resource_type='resource_type', )
+ await client.accesstokens.issue_temporary_access_token(
+ lookup={"key": "value"},
+ )
+
+
asyncio.run(main())
"""
- _response = await self._raw_client.issue_temporary_access_token(
- lookup=lookup, resource_type=resource_type, request_options=request_options
- )
+ _response = await self._raw_client.issue_temporary_access_token(lookup=lookup, request_options=request_options)
return _response.data
diff --git a/src/schematic/accesstokens/raw_client.py b/src/schematic/accesstokens/raw_client.py
index 785d7cd..f7540d8 100644
--- a/src/schematic/accesstokens/raw_client.py
+++ b/src/schematic/accesstokens/raw_client.py
@@ -11,6 +11,7 @@
from ..errors.bad_request_error import BadRequestError
from ..errors.forbidden_error import ForbiddenError
from ..errors.internal_server_error import InternalServerError
+from ..errors.not_found_error import NotFoundError
from ..errors.unauthorized_error import UnauthorizedError
from ..types.api_error import ApiError as types_api_error_ApiError
from .types.issue_temporary_access_token_response import IssueTemporaryAccessTokenResponse
@@ -24,19 +25,13 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper
def issue_temporary_access_token(
- self,
- *,
- lookup: typing.Dict[str, str],
- resource_type: str,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, lookup: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[IssueTemporaryAccessTokenResponse]:
"""
Parameters
----------
lookup : typing.Dict[str, str]
- resource_type : str
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -50,7 +45,7 @@ def issue_temporary_access_token(
method="POST",
json={
"lookup": lookup,
- "resource_type": resource_type,
+ "resource_type": "company",
},
headers={
"content-type": "application/json",
@@ -70,51 +65,66 @@ def issue_temporary_access_token(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -123,19 +133,13 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper
async def issue_temporary_access_token(
- self,
- *,
- lookup: typing.Dict[str, str],
- resource_type: str,
- request_options: typing.Optional[RequestOptions] = None,
+ self, *, lookup: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[IssueTemporaryAccessTokenResponse]:
"""
Parameters
----------
lookup : typing.Dict[str, str]
- resource_type : str
-
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -149,7 +153,7 @@ async def issue_temporary_access_token(
method="POST",
json={
"lookup": lookup,
- "resource_type": resource_type,
+ "resource_type": "company",
},
headers={
"content-type": "application/json",
@@ -169,49 +173,64 @@ async def issue_temporary_access_token(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/accounts/__init__.py b/src/schematic/accounts/__init__.py
index e46b4c8..4a19039 100644
--- a/src/schematic/accounts/__init__.py
+++ b/src/schematic/accounts/__init__.py
@@ -21,6 +21,7 @@
ListApiRequestsResponse,
ListEnvironmentsParams,
ListEnvironmentsResponse,
+ QuickstartResponse,
UpdateApiKeyResponse,
UpdateEnvironmentRequestBodyEnvironmentType,
UpdateEnvironmentResponse,
@@ -45,6 +46,7 @@
"ListApiRequestsResponse",
"ListEnvironmentsParams",
"ListEnvironmentsResponse",
+ "QuickstartResponse",
"UpdateApiKeyResponse",
"UpdateEnvironmentRequestBodyEnvironmentType",
"UpdateEnvironmentResponse",
diff --git a/src/schematic/accounts/client.py b/src/schematic/accounts/client.py
index 19166b2..cc5dd43 100644
--- a/src/schematic/accounts/client.py
+++ b/src/schematic/accounts/client.py
@@ -18,6 +18,7 @@
from .types.list_api_keys_response import ListApiKeysResponse
from .types.list_api_requests_response import ListApiRequestsResponse
from .types.list_environments_response import ListEnvironmentsResponse
+from .types.quickstart_response import QuickstartResponse
from .types.update_api_key_response import UpdateApiKeyResponse
from .types.update_environment_request_body_environment_type import UpdateEnvironmentRequestBodyEnvironmentType
from .types.update_environment_response import UpdateEnvironmentResponse
@@ -74,8 +75,13 @@ def list_api_keys(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.list_api_keys(require_environment=True, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.list_api_keys(
+ require_environment=True,
+ )
"""
_response = self._raw_client.list_api_keys(
require_environment=require_environment,
@@ -114,8 +120,13 @@ def create_api_key(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.create_api_key(name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.create_api_key(
+ name="name",
+ )
"""
_response = self._raw_client.create_api_key(
name=name, description=description, environment_id=environment_id, request_options=request_options
@@ -142,8 +153,13 @@ def get_api_key(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.get_api_key(api_key_id='api_key_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.get_api_key(
+ api_key_id="api_key_id",
+ )
"""
_response = self._raw_client.get_api_key(api_key_id, request_options=request_options)
return _response.data
@@ -177,8 +193,13 @@ def update_api_key(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.update_api_key(api_key_id='api_key_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.update_api_key(
+ api_key_id="api_key_id",
+ )
"""
_response = self._raw_client.update_api_key(
api_key_id, description=description, name=name, request_options=request_options
@@ -205,8 +226,13 @@ def delete_api_key(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.delete_api_key(api_key_id='api_key_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.delete_api_key(
+ api_key_id="api_key_id",
+ )
"""
_response = self._raw_client.delete_api_key(api_key_id, request_options=request_options)
return _response.data
@@ -244,8 +270,13 @@ def count_api_keys(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.count_api_keys(require_environment=True, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.count_api_keys(
+ require_environment=True,
+ )
"""
_response = self._raw_client.count_api_keys(
require_environment=require_environment,
@@ -292,7 +323,10 @@ def list_api_requests(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.accounts.list_api_requests()
"""
_response = self._raw_client.list_api_requests(
@@ -325,8 +359,13 @@ def get_api_request(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.get_api_request(api_request_id='api_request_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.get_api_request(
+ api_request_id="api_request_id",
+ )
"""
_response = self._raw_client.get_api_request(api_request_id, request_options=request_options)
return _response.data
@@ -367,7 +406,10 @@ def count_api_requests(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.accounts.count_api_requests()
"""
_response = self._raw_client.count_api_requests(
@@ -410,7 +452,10 @@ def list_environments(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.accounts.list_environments()
"""
_response = self._raw_client.list_environments(
@@ -443,8 +488,14 @@ def create_environment(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.create_environment(environment_type="development", name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.create_environment(
+ environment_type="development",
+ name="name",
+ )
"""
_response = self._raw_client.create_environment(
environment_type=environment_type, name=name, request_options=request_options
@@ -471,8 +522,13 @@ def get_environment(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.get_environment(environment_id='environment_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.get_environment(
+ environment_id="environment_id",
+ )
"""
_response = self._raw_client.get_environment(environment_id, request_options=request_options)
return _response.data
@@ -506,8 +562,13 @@ def update_environment(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.update_environment(environment_id='environment_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.update_environment(
+ environment_id="environment_id",
+ )
"""
_response = self._raw_client.update_environment(
environment_id, environment_type=environment_type, name=name, request_options=request_options
@@ -534,12 +595,41 @@ def delete_environment(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.accounts.delete_environment(environment_id='environment_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.delete_environment(
+ environment_id="environment_id",
+ )
"""
_response = self._raw_client.delete_environment(environment_id, request_options=request_options)
return _response.data
+ def quickstart(self, *, request_options: typing.Optional[RequestOptions] = None) -> QuickstartResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ QuickstartResponse
+ Created
+
+ Examples
+ --------
+ from schematic import Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.quickstart()
+ """
+ _response = self._raw_client.quickstart(request_options=request_options)
+ return _response.data
+
class AsyncAccountsClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -588,11 +678,21 @@ async def list_api_keys(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.list_api_keys(require_environment=True, )
+ await client.accounts.list_api_keys(
+ require_environment=True,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_api_keys(
@@ -631,11 +731,21 @@ async def create_api_key(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.create_api_key(name='name', )
+ await client.accounts.create_api_key(
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_api_key(
@@ -662,11 +772,21 @@ async def get_api_key(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.get_api_key(api_key_id='api_key_id', )
+ await client.accounts.get_api_key(
+ api_key_id="api_key_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_api_key(api_key_id, request_options=request_options)
@@ -700,11 +820,21 @@ async def update_api_key(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.update_api_key(api_key_id='api_key_id', )
+ await client.accounts.update_api_key(
+ api_key_id="api_key_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_api_key(
@@ -731,11 +861,21 @@ async def delete_api_key(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.delete_api_key(api_key_id='api_key_id', )
+ await client.accounts.delete_api_key(
+ api_key_id="api_key_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_api_key(api_key_id, request_options=request_options)
@@ -773,11 +913,21 @@ async def count_api_keys(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.count_api_keys(require_environment=True, )
+ await client.accounts.count_api_keys(
+ require_environment=True,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_api_keys(
@@ -824,11 +974,19 @@ async def list_api_requests(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.accounts.list_api_requests()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_api_requests(
@@ -860,11 +1018,21 @@ async def get_api_request(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.get_api_request(api_request_id='api_request_id', )
+ await client.accounts.get_api_request(
+ api_request_id="api_request_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_api_request(api_request_id, request_options=request_options)
@@ -905,11 +1073,19 @@ async def count_api_requests(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.accounts.count_api_requests()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_api_requests(
@@ -951,11 +1127,19 @@ async def list_environments(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.accounts.list_environments()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_environments(
@@ -987,11 +1171,22 @@ async def create_environment(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.create_environment(environment_type="development", name='name', )
+ await client.accounts.create_environment(
+ environment_type="development",
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_environment(
@@ -1018,11 +1213,21 @@ async def get_environment(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.get_environment(environment_id='environment_id', )
+ await client.accounts.get_environment(
+ environment_id="environment_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_environment(environment_id, request_options=request_options)
@@ -1056,11 +1261,21 @@ async def update_environment(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.update_environment(environment_id='environment_id', )
+ await client.accounts.update_environment(
+ environment_id="environment_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_environment(
@@ -1087,12 +1302,54 @@ async def delete_environment(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.accounts.delete_environment(environment_id='environment_id', )
+ await client.accounts.delete_environment(
+ environment_id="environment_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_environment(environment_id, request_options=request_options)
return _response.data
+
+ async def quickstart(self, *, request_options: typing.Optional[RequestOptions] = None) -> QuickstartResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ QuickstartResponse
+ Created
+
+ Examples
+ --------
+ import asyncio
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.accounts.quickstart()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.quickstart(request_options=request_options)
+ return _response.data
diff --git a/src/schematic/accounts/raw_client.py b/src/schematic/accounts/raw_client.py
index 5772984..40455a7 100644
--- a/src/schematic/accounts/raw_client.py
+++ b/src/schematic/accounts/raw_client.py
@@ -28,6 +28,7 @@
from .types.list_api_keys_response import ListApiKeysResponse
from .types.list_api_requests_response import ListApiRequestsResponse
from .types.list_environments_response import ListEnvironmentsResponse
+from .types.quickstart_response import QuickstartResponse
from .types.update_api_key_response import UpdateApiKeyResponse
from .types.update_environment_request_body_environment_type import UpdateEnvironmentRequestBodyEnvironmentType
from .types.update_environment_response import UpdateEnvironmentResponse
@@ -93,51 +94,66 @@ def list_api_keys(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_api_key(
@@ -191,51 +207,66 @@ def create_api_key(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_api_key(
@@ -272,51 +303,55 @@ def get_api_key(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_api_key(
@@ -370,61 +405,66 @@ def update_api_key(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_api_key(
@@ -461,51 +501,66 @@ def delete_api_key(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_api_keys(
@@ -561,51 +616,66 @@ def count_api_keys(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_api_requests(
@@ -665,51 +735,66 @@ def list_api_requests(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_api_request(
@@ -746,51 +831,55 @@ def get_api_request(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_api_requests(
@@ -850,51 +939,66 @@ def count_api_requests(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_environments(
@@ -946,51 +1050,66 @@ def list_environments(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_environment(
@@ -1040,51 +1159,66 @@ def create_environment(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_environment(
@@ -1121,51 +1255,55 @@ def get_environment(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_environment(
@@ -1219,61 +1357,66 @@ def update_environment(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_environment(
@@ -1310,51 +1453,159 @@ def delete_environment(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ def quickstart(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[QuickstartResponse]:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[QuickstartResponse]
+ Created
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "quickstart",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ QuickstartResponse,
+ parse_obj_as(
+ type_=QuickstartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -1415,51 +1666,66 @@ async def list_api_keys(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_api_key(
@@ -1513,51 +1779,66 @@ async def create_api_key(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_api_key(
@@ -1594,51 +1875,55 @@ async def get_api_key(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_api_key(
@@ -1692,61 +1977,66 @@ async def update_api_key(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_api_key(
@@ -1783,51 +2073,66 @@ async def delete_api_key(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_api_keys(
@@ -1883,51 +2188,66 @@ async def count_api_keys(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_api_requests(
@@ -1987,51 +2307,66 @@ async def list_api_requests(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_api_request(
@@ -2068,51 +2403,55 @@ async def get_api_request(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_api_requests(
@@ -2172,51 +2511,66 @@ async def count_api_requests(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_environments(
@@ -2268,51 +2622,66 @@ async def list_environments(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_environment(
@@ -2362,51 +2731,66 @@ async def create_environment(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_environment(
@@ -2443,51 +2827,55 @@ async def get_environment(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_environment(
@@ -2541,61 +2929,66 @@ async def update_environment(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_environment(
@@ -2632,49 +3025,157 @@ async def delete_environment(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ async def quickstart(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[QuickstartResponse]:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[QuickstartResponse]
+ Created
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "quickstart",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ QuickstartResponse,
+ parse_obj_as(
+ type_=QuickstartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/accounts/types/__init__.py b/src/schematic/accounts/types/__init__.py
index 26ef497..69313b3 100644
--- a/src/schematic/accounts/types/__init__.py
+++ b/src/schematic/accounts/types/__init__.py
@@ -20,6 +20,7 @@
from .list_api_requests_response import ListApiRequestsResponse
from .list_environments_params import ListEnvironmentsParams
from .list_environments_response import ListEnvironmentsResponse
+from .quickstart_response import QuickstartResponse
from .update_api_key_response import UpdateApiKeyResponse
from .update_environment_request_body_environment_type import UpdateEnvironmentRequestBodyEnvironmentType
from .update_environment_response import UpdateEnvironmentResponse
@@ -43,6 +44,7 @@
"ListApiRequestsResponse",
"ListEnvironmentsParams",
"ListEnvironmentsResponse",
+ "QuickstartResponse",
"UpdateApiKeyResponse",
"UpdateEnvironmentRequestBodyEnvironmentType",
"UpdateEnvironmentResponse",
diff --git a/src/schematic/accounts/types/quickstart_response.py b/src/schematic/accounts/types/quickstart_response.py
new file mode 100644
index 0000000..cf8554d
--- /dev/null
+++ b/src/schematic/accounts/types/quickstart_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ...types.quickstart_resp import QuickstartResp
+
+
+class QuickstartResponse(UniversalBaseModel):
+ data: QuickstartResp
+ params: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ """
+ Input parameters
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/base_client.py b/src/schematic/base_client.py
index 39960eb..be97605 100644
--- a/src/schematic/base_client.py
+++ b/src/schematic/base_client.py
@@ -33,6 +33,8 @@ class BaseSchematic:
environment : SchematicEnvironment
The environment to use for requests from the client. from .environment import SchematicEnvironment
+
+
Defaults to SchematicEnvironment.DEFAULT
@@ -50,7 +52,10 @@ class BaseSchematic:
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
"""
def __init__(
@@ -104,6 +109,8 @@ class AsyncBaseSchematic:
environment : SchematicEnvironment
The environment to use for requests from the client. from .environment import SchematicEnvironment
+
+
Defaults to SchematicEnvironment.DEFAULT
@@ -121,7 +128,10 @@ class AsyncBaseSchematic:
Examples
--------
from schematic import AsyncSchematic
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
"""
def __init__(
diff --git a/src/schematic/billing/client.py b/src/schematic/billing/client.py
index b33c4f8..dece3ee 100644
--- a/src/schematic/billing/client.py
+++ b/src/schematic/billing/client.py
@@ -92,7 +92,10 @@ def list_coupons(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.list_coupons()
"""
_response = self._raw_client.list_coupons(
@@ -146,8 +149,20 @@ def upsert_billing_coupon(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_billing_coupon(amount_off=1, duration='duration', duration_in_months=1, external_id='external_id', max_redemptions=1, name='name', percent_off=1.1, times_redeemed=1, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_billing_coupon(
+ amount_off=1,
+ duration="duration",
+ duration_in_months=1,
+ external_id="external_id",
+ max_redemptions=1,
+ name="name",
+ percent_off=1.1,
+ times_redeemed=1,
+ )
"""
_response = self._raw_client.upsert_billing_coupon(
amount_off=amount_off,
@@ -203,8 +218,17 @@ def upsert_billing_customer(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_billing_customer(email='email', external_id='external_id', failed_to_import=True, meta={'key': 'value'}, name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_billing_customer(
+ email="email",
+ external_id="external_id",
+ failed_to_import=True,
+ meta={"key": "value"},
+ name="name",
+ )
"""
_response = self._raw_client.upsert_billing_customer(
email=email,
@@ -257,7 +281,10 @@ def list_customers_with_subscriptions(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.list_customers_with_subscriptions()
"""
_response = self._raw_client.list_customers_with_subscriptions(
@@ -310,7 +337,10 @@ def count_customers(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.count_customers()
"""
_response = self._raw_client.count_customers(
@@ -360,8 +390,13 @@ def list_invoices(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.list_invoices(customer_external_id='customer_external_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.list_invoices(
+ customer_external_id="customer_external_id",
+ )
"""
_response = self._raw_client.list_invoices(
customer_external_id=customer_external_id,
@@ -428,8 +463,19 @@ def upsert_invoice(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_invoice(amount_due=1, amount_paid=1, amount_remaining=1, collection_method='collection_method', currency='currency', customer_external_id='customer_external_id', subtotal=1, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_invoice(
+ amount_due=1,
+ amount_paid=1,
+ amount_remaining=1,
+ collection_method="collection_method",
+ currency="currency",
+ customer_external_id="customer_external_id",
+ subtotal=1,
+ )
"""
_response = self._raw_client.upsert_invoice(
amount_due=amount_due,
@@ -478,7 +524,10 @@ def list_meters(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.list_meters()
"""
_response = self._raw_client.list_meters(
@@ -517,8 +566,16 @@ def upsert_billing_meter(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_billing_meter(display_name='display_name', event_name='event_name', event_payload_key='event_payload_key', external_id='external_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_billing_meter(
+ display_name="display_name",
+ event_name="event_name",
+ event_payload_key="event_payload_key",
+ external_id="external_id",
+ )
"""
_response = self._raw_client.upsert_billing_meter(
display_name=display_name,
@@ -562,8 +619,13 @@ def list_payment_methods(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.list_payment_methods(customer_external_id='customer_external_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.list_payment_methods(
+ customer_external_id="customer_external_id",
+ )
"""
_response = self._raw_client.list_payment_methods(
customer_external_id=customer_external_id,
@@ -629,8 +691,15 @@ def upsert_payment_method(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_payment_method(customer_external_id='customer_external_id', external_id='external_id', payment_method_type='payment_method_type', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_payment_method(
+ customer_external_id="customer_external_id",
+ external_id="external_id",
+ payment_method_type="payment_method_type",
+ )
"""
_response = self._raw_client.upsert_payment_method(
customer_external_id=customer_external_id,
@@ -691,7 +760,10 @@ def search_billing_prices(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.search_billing_prices()
"""
_response = self._raw_client.search_billing_prices(
@@ -766,10 +838,27 @@ def upsert_billing_price(
Examples
--------
- from schematic import Schematic
- from schematic import CreateBillingPriceTierRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_billing_price(billing_scheme="per_unit", currency='currency', external_account_id='external_account_id', interval='interval', is_active=True, price=1, price_external_id='price_external_id', price_tiers=[CreateBillingPriceTierRequestBody(price_external_id='price_external_id', )], product_external_id='product_external_id', usage_type="licensed", )
+ from schematic import CreateBillingPriceTierRequestBody, Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_billing_price(
+ billing_scheme="per_unit",
+ currency="currency",
+ external_account_id="external_account_id",
+ interval="interval",
+ is_active=True,
+ price=1,
+ price_external_id="price_external_id",
+ price_tiers=[
+ CreateBillingPriceTierRequestBody(
+ price_external_id="price_external_id",
+ )
+ ],
+ product_external_id="product_external_id",
+ usage_type="licensed",
+ )
"""
_response = self._raw_client.upsert_billing_price(
billing_scheme=billing_scheme,
@@ -810,8 +899,13 @@ def delete_billing_product(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.delete_billing_product(billing_id='billing_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.delete_billing_product(
+ billing_id="billing_id",
+ )
"""
_response = self._raw_client.delete_billing_product(billing_id, request_options=request_options)
return _response.data
@@ -875,7 +969,10 @@ def list_product_prices(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.list_product_prices()
"""
_response = self._raw_client.list_product_prices(
@@ -914,8 +1011,13 @@ def delete_product_price(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.delete_product_price(billing_id='billing_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.delete_product_price(
+ billing_id="billing_id",
+ )
"""
_response = self._raw_client.delete_product_price(billing_id, request_options=request_options)
return _response.data
@@ -951,8 +1053,15 @@ def upsert_billing_product(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_billing_product(external_id='external_id', name='name', price=1.1, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_billing_product(
+ external_id="external_id",
+ name="name",
+ price=1.1,
+ )
"""
_response = self._raw_client.upsert_billing_product(
external_id=external_id, name=name, price=price, is_active=is_active, request_options=request_options
@@ -1018,7 +1127,10 @@ def list_billing_products(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.list_billing_products()
"""
_response = self._raw_client.list_billing_products(
@@ -1096,7 +1208,10 @@ def count_billing_products(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.billing.count_billing_products()
"""
_response = self._raw_client.count_billing_products(
@@ -1184,12 +1299,48 @@ def upsert_billing_subscription(
Examples
--------
- from schematic import Schematic
- from schematic import BillingSubscriptionDiscount
import datetime
- from schematic import BillingProductPricing
- client = Schematic(api_key="YOUR_API_KEY", )
- client.billing.upsert_billing_subscription(cancel_at_period_end=True, currency='currency', customer_external_id='customer_external_id', discounts=[BillingSubscriptionDiscount(coupon_external_id='coupon_external_id', external_id='external_id', is_active=True, started_at=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), )], expired_at=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), product_external_ids=[BillingProductPricing(currency='currency', interval='interval', price=1, price_external_id='price_external_id', product_external_id='product_external_id', quantity=1, usage_type="licensed", )], subscription_external_id='subscription_external_id', total_price=1, )
+
+ from schematic import (
+ BillingProductPricing,
+ BillingSubscriptionDiscount,
+ Schematic,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.billing.upsert_billing_subscription(
+ cancel_at_period_end=True,
+ currency="currency",
+ customer_external_id="customer_external_id",
+ discounts=[
+ BillingSubscriptionDiscount(
+ coupon_external_id="coupon_external_id",
+ external_id="external_id",
+ is_active=True,
+ started_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ )
+ ],
+ expired_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ product_external_ids=[
+ BillingProductPricing(
+ currency="currency",
+ interval="interval",
+ price=1,
+ price_external_id="price_external_id",
+ product_external_id="product_external_id",
+ quantity=1,
+ usage_type="licensed",
+ )
+ ],
+ subscription_external_id="subscription_external_id",
+ total_price=1,
+ )
"""
_response = self._raw_client.upsert_billing_subscription(
cancel_at_period_end=cancel_at_period_end,
@@ -1261,11 +1412,19 @@ async def list_coupons(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.list_coupons()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_coupons(
@@ -1318,11 +1477,28 @@ async def upsert_billing_coupon(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_billing_coupon(amount_off=1, duration='duration', duration_in_months=1, external_id='external_id', max_redemptions=1, name='name', percent_off=1.1, times_redeemed=1, )
+ await client.billing.upsert_billing_coupon(
+ amount_off=1,
+ duration="duration",
+ duration_in_months=1,
+ external_id="external_id",
+ max_redemptions=1,
+ name="name",
+ percent_off=1.1,
+ times_redeemed=1,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_billing_coupon(
@@ -1378,11 +1554,25 @@ async def upsert_billing_customer(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_billing_customer(email='email', external_id='external_id', failed_to_import=True, meta={'key': 'value'}, name='name', )
+ await client.billing.upsert_billing_customer(
+ email="email",
+ external_id="external_id",
+ failed_to_import=True,
+ meta={"key": "value"},
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_billing_customer(
@@ -1435,11 +1625,19 @@ async def list_customers_with_subscriptions(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.list_customers_with_subscriptions()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_customers_with_subscriptions(
@@ -1491,11 +1689,19 @@ async def count_customers(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.count_customers()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_customers(
@@ -1544,11 +1750,21 @@ async def list_invoices(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.list_invoices(customer_external_id='customer_external_id', )
+ await client.billing.list_invoices(
+ customer_external_id="customer_external_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_invoices(
@@ -1615,11 +1831,27 @@ async def upsert_invoice(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_invoice(amount_due=1, amount_paid=1, amount_remaining=1, collection_method='collection_method', currency='currency', customer_external_id='customer_external_id', subtotal=1, )
+ await client.billing.upsert_invoice(
+ amount_due=1,
+ amount_paid=1,
+ amount_remaining=1,
+ collection_method="collection_method",
+ currency="currency",
+ customer_external_id="customer_external_id",
+ subtotal=1,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_invoice(
@@ -1668,11 +1900,19 @@ async def list_meters(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.list_meters()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_meters(
@@ -1710,11 +1950,24 @@ async def upsert_billing_meter(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_billing_meter(display_name='display_name', event_name='event_name', event_payload_key='event_payload_key', external_id='external_id', )
+ await client.billing.upsert_billing_meter(
+ display_name="display_name",
+ event_name="event_name",
+ event_payload_key="event_payload_key",
+ external_id="external_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_billing_meter(
@@ -1758,11 +2011,21 @@ async def list_payment_methods(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.list_payment_methods(customer_external_id='customer_external_id', )
+ await client.billing.list_payment_methods(
+ customer_external_id="customer_external_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_payment_methods(
@@ -1828,11 +2091,23 @@ async def upsert_payment_method(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_payment_method(customer_external_id='customer_external_id', external_id='external_id', payment_method_type='payment_method_type', )
+ await client.billing.upsert_payment_method(
+ customer_external_id="customer_external_id",
+ external_id="external_id",
+ payment_method_type="payment_method_type",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_payment_method(
@@ -1893,11 +2168,19 @@ async def search_billing_prices(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.search_billing_prices()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.search_billing_prices(
@@ -1972,12 +2255,34 @@ async def upsert_billing_price(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateBillingPriceTierRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic, CreateBillingPriceTierRequestBody
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_billing_price(billing_scheme="per_unit", currency='currency', external_account_id='external_account_id', interval='interval', is_active=True, price=1, price_external_id='price_external_id', price_tiers=[CreateBillingPriceTierRequestBody(price_external_id='price_external_id', )], product_external_id='product_external_id', usage_type="licensed", )
+ await client.billing.upsert_billing_price(
+ billing_scheme="per_unit",
+ currency="currency",
+ external_account_id="external_account_id",
+ interval="interval",
+ is_active=True,
+ price=1,
+ price_external_id="price_external_id",
+ price_tiers=[
+ CreateBillingPriceTierRequestBody(
+ price_external_id="price_external_id",
+ )
+ ],
+ product_external_id="product_external_id",
+ usage_type="licensed",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_billing_price(
@@ -2018,11 +2323,21 @@ async def delete_billing_product(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.delete_billing_product(billing_id='billing_id', )
+ await client.billing.delete_billing_product(
+ billing_id="billing_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_billing_product(billing_id, request_options=request_options)
@@ -2086,11 +2401,19 @@ async def list_product_prices(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.list_product_prices()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_product_prices(
@@ -2128,11 +2451,21 @@ async def delete_product_price(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.delete_product_price(billing_id='billing_id', )
+ await client.billing.delete_product_price(
+ billing_id="billing_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_product_price(billing_id, request_options=request_options)
@@ -2168,11 +2501,23 @@ async def upsert_billing_product(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_billing_product(external_id='external_id', name='name', price=1.1, )
+ await client.billing.upsert_billing_product(
+ external_id="external_id",
+ name="name",
+ price=1.1,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_billing_product(
@@ -2238,11 +2583,19 @@ async def list_billing_products(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.list_billing_products()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_billing_products(
@@ -2319,11 +2672,19 @@ async def count_billing_products(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.billing.count_billing_products()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_billing_products(
@@ -2411,14 +2772,54 @@ async def upsert_billing_subscription(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import BillingSubscriptionDiscount
- import datetime
- from schematic import BillingProductPricing
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+ import datetime
+
+ from schematic import (
+ AsyncSchematic,
+ BillingProductPricing,
+ BillingSubscriptionDiscount,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.billing.upsert_billing_subscription(cancel_at_period_end=True, currency='currency', customer_external_id='customer_external_id', discounts=[BillingSubscriptionDiscount(coupon_external_id='coupon_external_id', external_id='external_id', is_active=True, started_at=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), )], expired_at=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), product_external_ids=[BillingProductPricing(currency='currency', interval='interval', price=1, price_external_id='price_external_id', product_external_id='product_external_id', quantity=1, usage_type="licensed", )], subscription_external_id='subscription_external_id', total_price=1, )
+ await client.billing.upsert_billing_subscription(
+ cancel_at_period_end=True,
+ currency="currency",
+ customer_external_id="customer_external_id",
+ discounts=[
+ BillingSubscriptionDiscount(
+ coupon_external_id="coupon_external_id",
+ external_id="external_id",
+ is_active=True,
+ started_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ )
+ ],
+ expired_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ product_external_ids=[
+ BillingProductPricing(
+ currency="currency",
+ interval="interval",
+ price=1,
+ price_external_id="price_external_id",
+ product_external_id="product_external_id",
+ quantity=1,
+ usage_type="licensed",
+ )
+ ],
+ subscription_external_id="subscription_external_id",
+ total_price=1,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_billing_subscription(
diff --git a/src/schematic/billing/raw_client.py b/src/schematic/billing/raw_client.py
index 0608bba..73663af 100644
--- a/src/schematic/billing/raw_client.py
+++ b/src/schematic/billing/raw_client.py
@@ -14,6 +14,7 @@
from ..errors.bad_request_error import BadRequestError
from ..errors.forbidden_error import ForbiddenError
from ..errors.internal_server_error import InternalServerError
+from ..errors.not_found_error import NotFoundError
from ..errors.unauthorized_error import UnauthorizedError
from ..types.api_error import ApiError as types_api_error_ApiError
from ..types.billing_product_pricing import BillingProductPricing
@@ -111,51 +112,66 @@ def list_coupons(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_billing_coupon(
@@ -233,51 +249,66 @@ def upsert_billing_coupon(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_billing_customer(
@@ -347,51 +378,66 @@ def upsert_billing_customer(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_customers_with_subscriptions(
@@ -455,51 +501,66 @@ def list_customers_with_subscriptions(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_customers(
@@ -563,51 +624,66 @@ def count_customers(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_invoices(
@@ -667,51 +743,66 @@ def list_invoices(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_invoice(
@@ -801,51 +892,66 @@ def upsert_invoice(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_meters(
@@ -897,51 +1003,66 @@ def list_meters(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_billing_meter(
@@ -999,51 +1120,66 @@ def upsert_billing_meter(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_payment_methods(
@@ -1099,51 +1235,66 @@ def list_payment_methods(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_payment_method(
@@ -1233,51 +1384,66 @@ def upsert_payment_method(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def search_billing_prices(
@@ -1345,51 +1511,66 @@ def search_billing_prices(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_billing_price(
@@ -1491,51 +1672,66 @@ def upsert_billing_price(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_billing_product(
@@ -1572,51 +1768,66 @@ def delete_billing_product(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_product_prices(
@@ -1705,51 +1916,66 @@ def list_product_prices(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_product_price(
@@ -1786,51 +2012,66 @@ def delete_product_price(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_billing_product(
@@ -1888,51 +2129,66 @@ def upsert_billing_product(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_billing_products(
@@ -2021,51 +2277,66 @@ def list_billing_products(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_billing_products(
@@ -2154,51 +2425,66 @@ def count_billing_products(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_billing_subscription(
@@ -2312,51 +2598,66 @@ def upsert_billing_subscription(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -2417,51 +2718,66 @@ async def list_coupons(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_billing_coupon(
@@ -2539,51 +2855,66 @@ async def upsert_billing_coupon(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_billing_customer(
@@ -2653,51 +2984,66 @@ async def upsert_billing_customer(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_customers_with_subscriptions(
@@ -2761,51 +3107,66 @@ async def list_customers_with_subscriptions(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_customers(
@@ -2869,51 +3230,66 @@ async def count_customers(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_invoices(
@@ -2973,51 +3349,66 @@ async def list_invoices(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_invoice(
@@ -3107,51 +3498,66 @@ async def upsert_invoice(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_meters(
@@ -3203,51 +3609,66 @@ async def list_meters(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_billing_meter(
@@ -3305,51 +3726,66 @@ async def upsert_billing_meter(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_payment_methods(
@@ -3405,51 +3841,66 @@ async def list_payment_methods(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_payment_method(
@@ -3539,51 +3990,66 @@ async def upsert_payment_method(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def search_billing_prices(
@@ -3651,51 +4117,66 @@ async def search_billing_prices(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_billing_price(
@@ -3797,51 +4278,66 @@ async def upsert_billing_price(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_billing_product(
@@ -3878,51 +4374,66 @@ async def delete_billing_product(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_product_prices(
@@ -4011,51 +4522,66 @@ async def list_product_prices(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_product_price(
@@ -4092,51 +4618,66 @@ async def delete_product_price(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_billing_product(
@@ -4194,51 +4735,66 @@ async def upsert_billing_product(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_billing_products(
@@ -4327,51 +4883,66 @@ async def list_billing_products(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_billing_products(
@@ -4460,51 +5031,66 @@ async def count_billing_products(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_billing_subscription(
@@ -4618,49 +5204,64 @@ async def upsert_billing_subscription(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/checkout/client.py b/src/schematic/checkout/client.py
index 0a96b48..1eecfaa 100644
--- a/src/schematic/checkout/client.py
+++ b/src/schematic/checkout/client.py
@@ -74,11 +74,32 @@ def internal(
Examples
--------
- from schematic import Schematic
- from schematic import UpdateAddOnRequestBody
- from schematic import UpdatePayInAdvanceRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.checkout.internal(add_on_ids=[UpdateAddOnRequestBody(add_on_id='add_on_id', price_id='price_id', )], company_id='company_id', new_plan_id='new_plan_id', new_price_id='new_price_id', pay_in_advance=[UpdatePayInAdvanceRequestBody(price_id='price_id', quantity=1, )], )
+ from schematic import (
+ Schematic,
+ UpdateAddOnRequestBody,
+ UpdatePayInAdvanceRequestBody,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.checkout.internal(
+ add_on_ids=[
+ UpdateAddOnRequestBody(
+ add_on_id="add_on_id",
+ price_id="price_id",
+ )
+ ],
+ company_id="company_id",
+ new_plan_id="new_plan_id",
+ new_price_id="new_price_id",
+ pay_in_advance=[
+ UpdatePayInAdvanceRequestBody(
+ price_id="price_id",
+ quantity=1,
+ )
+ ],
+ )
"""
_response = self._raw_client.internal(
add_on_ids=add_on_ids,
@@ -118,8 +139,13 @@ def get_checkout_data(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.checkout.get_checkout_data(company_id='company_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.checkout.get_checkout_data(
+ company_id="company_id",
+ )
"""
_response = self._raw_client.get_checkout_data(
company_id=company_id, selected_plan_id=selected_plan_id, request_options=request_options
@@ -168,11 +194,32 @@ def preview_checkout_internal(
Examples
--------
- from schematic import Schematic
- from schematic import UpdateAddOnRequestBody
- from schematic import UpdatePayInAdvanceRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.checkout.preview_checkout_internal(add_on_ids=[UpdateAddOnRequestBody(add_on_id='add_on_id', price_id='price_id', )], company_id='company_id', new_plan_id='new_plan_id', new_price_id='new_price_id', pay_in_advance=[UpdatePayInAdvanceRequestBody(price_id='price_id', quantity=1, )], )
+ from schematic import (
+ Schematic,
+ UpdateAddOnRequestBody,
+ UpdatePayInAdvanceRequestBody,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.checkout.preview_checkout_internal(
+ add_on_ids=[
+ UpdateAddOnRequestBody(
+ add_on_id="add_on_id",
+ price_id="price_id",
+ )
+ ],
+ company_id="company_id",
+ new_plan_id="new_plan_id",
+ new_price_id="new_price_id",
+ pay_in_advance=[
+ UpdatePayInAdvanceRequestBody(
+ price_id="price_id",
+ quantity=1,
+ )
+ ],
+ )
"""
_response = self._raw_client.preview_checkout_internal(
add_on_ids=add_on_ids,
@@ -213,8 +260,13 @@ def update_customer_subscription_trial_end(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.checkout.update_customer_subscription_trial_end(subscription_id='subscription_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.checkout.update_customer_subscription_trial_end(
+ subscription_id="subscription_id",
+ )
"""
_response = self._raw_client.update_customer_subscription_trial_end(
subscription_id, trial_end=trial_end, request_options=request_options
@@ -279,13 +331,39 @@ async def internal(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import UpdateAddOnRequestBody
- from schematic import UpdatePayInAdvanceRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ UpdateAddOnRequestBody,
+ UpdatePayInAdvanceRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.checkout.internal(add_on_ids=[UpdateAddOnRequestBody(add_on_id='add_on_id', price_id='price_id', )], company_id='company_id', new_plan_id='new_plan_id', new_price_id='new_price_id', pay_in_advance=[UpdatePayInAdvanceRequestBody(price_id='price_id', quantity=1, )], )
+ await client.checkout.internal(
+ add_on_ids=[
+ UpdateAddOnRequestBody(
+ add_on_id="add_on_id",
+ price_id="price_id",
+ )
+ ],
+ company_id="company_id",
+ new_plan_id="new_plan_id",
+ new_price_id="new_price_id",
+ pay_in_advance=[
+ UpdatePayInAdvanceRequestBody(
+ price_id="price_id",
+ quantity=1,
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.internal(
@@ -325,11 +403,21 @@ async def get_checkout_data(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.checkout.get_checkout_data(company_id='company_id', )
+ await client.checkout.get_checkout_data(
+ company_id="company_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_checkout_data(
@@ -379,13 +467,39 @@ async def preview_checkout_internal(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import UpdateAddOnRequestBody
- from schematic import UpdatePayInAdvanceRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ UpdateAddOnRequestBody,
+ UpdatePayInAdvanceRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.checkout.preview_checkout_internal(add_on_ids=[UpdateAddOnRequestBody(add_on_id='add_on_id', price_id='price_id', )], company_id='company_id', new_plan_id='new_plan_id', new_price_id='new_price_id', pay_in_advance=[UpdatePayInAdvanceRequestBody(price_id='price_id', quantity=1, )], )
+ await client.checkout.preview_checkout_internal(
+ add_on_ids=[
+ UpdateAddOnRequestBody(
+ add_on_id="add_on_id",
+ price_id="price_id",
+ )
+ ],
+ company_id="company_id",
+ new_plan_id="new_plan_id",
+ new_price_id="new_price_id",
+ pay_in_advance=[
+ UpdatePayInAdvanceRequestBody(
+ price_id="price_id",
+ quantity=1,
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.preview_checkout_internal(
@@ -426,11 +540,21 @@ async def update_customer_subscription_trial_end(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.checkout.update_customer_subscription_trial_end(subscription_id='subscription_id', )
+ await client.checkout.update_customer_subscription_trial_end(
+ subscription_id="subscription_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_customer_subscription_trial_end(
diff --git a/src/schematic/checkout/raw_client.py b/src/schematic/checkout/raw_client.py
index c44bf2a..916797f 100644
--- a/src/schematic/checkout/raw_client.py
+++ b/src/schematic/checkout/raw_client.py
@@ -107,51 +107,66 @@ def internal(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_checkout_data(
@@ -201,51 +216,66 @@ def get_checkout_data(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def preview_checkout_internal(
@@ -323,51 +353,66 @@ def preview_checkout_internal(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_customer_subscription_trial_end(
@@ -417,61 +462,66 @@ def update_customer_subscription_trial_end(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -554,51 +604,66 @@ async def internal(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_checkout_data(
@@ -648,51 +713,66 @@ async def get_checkout_data(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def preview_checkout_internal(
@@ -770,51 +850,66 @@ async def preview_checkout_internal(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_customer_subscription_trial_end(
@@ -864,59 +959,64 @@ async def update_customer_subscription_trial_end(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/companies/client.py b/src/schematic/companies/client.py
index 8a2ce48..87bccc2 100644
--- a/src/schematic/companies/client.py
+++ b/src/schematic/companies/client.py
@@ -123,7 +123,10 @@ def list_companies(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.list_companies()
"""
_response = self._raw_client.list_companies(
@@ -179,8 +182,13 @@ def upsert_company(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.upsert_company(keys={'key': 'value'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.upsert_company(
+ keys={"key": "value"},
+ )
"""
_response = self._raw_client.upsert_company(
keys=keys,
@@ -213,8 +221,13 @@ def get_company(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.get_company(company_id='company_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_company(
+ company_id="company_id",
+ )
"""
_response = self._raw_client.get_company(company_id, request_options=request_options)
return _response.data
@@ -239,8 +252,13 @@ def delete_company(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.delete_company(company_id='company_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.delete_company(
+ company_id="company_id",
+ )
"""
_response = self._raw_client.delete_company(company_id, request_options=request_options)
return _response.data
@@ -296,7 +314,10 @@ def count_companies(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.count_companies()
"""
_response = self._raw_client.count_companies(
@@ -352,8 +373,13 @@ def create_company(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.create_company(keys={'key': 'value'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.create_company(
+ keys={"key": "value"},
+ )
"""
_response = self._raw_client.create_company(
keys=keys,
@@ -385,8 +411,13 @@ def delete_company_by_keys(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.delete_company_by_keys(keys={'key': 'value'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.delete_company_by_keys(
+ keys={"key": "value"},
+ )
"""
_response = self._raw_client.delete_company_by_keys(keys=keys, request_options=request_options)
return _response.data
@@ -411,8 +442,13 @@ def lookup_company(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.lookup_company(keys={'keys': 'keys'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.lookup_company(
+ keys={"keys": "keys"},
+ )
"""
_response = self._raw_client.lookup_company(keys=keys, request_options=request_options)
return _response.data
@@ -450,8 +486,14 @@ def get_active_deals(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.get_active_deals(company_id='company_id', deal_stage='deal_stage', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_active_deals(
+ company_id="company_id",
+ deal_stage="deal_stage",
+ )
"""
_response = self._raw_client.get_active_deals(
company_id=company_id, deal_stage=deal_stage, limit=limit, offset=offset, request_options=request_options
@@ -491,7 +533,10 @@ def list_company_memberships(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.list_company_memberships()
"""
_response = self._raw_client.list_company_memberships(
@@ -520,8 +565,14 @@ def get_or_create_company_membership(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.get_or_create_company_membership(company_id='company_id', user_id='user_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_or_create_company_membership(
+ company_id="company_id",
+ user_id="user_id",
+ )
"""
_response = self._raw_client.get_or_create_company_membership(
company_id=company_id, user_id=user_id, request_options=request_options
@@ -548,8 +599,13 @@ def delete_company_membership(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.delete_company_membership(company_membership_id='company_membership_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.delete_company_membership(
+ company_membership_id="company_membership_id",
+ )
"""
_response = self._raw_client.delete_company_membership(company_membership_id, request_options=request_options)
return _response.data
@@ -587,7 +643,10 @@ def get_active_company_subscription(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.get_active_company_subscription()
"""
_response = self._raw_client.get_active_company_subscription(
@@ -634,8 +693,14 @@ def upsert_company_trait(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.upsert_company_trait(keys={'key': 'value'}, trait='trait', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.upsert_company_trait(
+ keys={"key": "value"},
+ trait="trait",
+ )
"""
_response = self._raw_client.upsert_company_trait(
keys=keys, trait=trait, incr=incr, set_=set_, update_only=update_only, request_options=request_options
@@ -678,7 +743,10 @@ def list_entity_key_definitions(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.list_entity_key_definitions()
"""
_response = self._raw_client.list_entity_key_definitions(
@@ -722,7 +790,10 @@ def count_entity_key_definitions(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.count_entity_key_definitions()
"""
_response = self._raw_client.count_entity_key_definitions(
@@ -769,7 +840,10 @@ def list_entity_trait_definitions(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.list_entity_trait_definitions()
"""
_response = self._raw_client.list_entity_trait_definitions(
@@ -814,8 +888,15 @@ def get_or_create_entity_trait_definition(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.get_or_create_entity_trait_definition(entity_type="company", hierarchy=['hierarchy'], trait_type="boolean", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_or_create_entity_trait_definition(
+ entity_type="company",
+ hierarchy=["hierarchy"],
+ trait_type="boolean",
+ )
"""
_response = self._raw_client.get_or_create_entity_trait_definition(
entity_type=entity_type,
@@ -846,8 +927,13 @@ def get_entity_trait_definition(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.get_entity_trait_definition(entity_trait_definition_id='entity_trait_definition_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_entity_trait_definition(
+ entity_trait_definition_id="entity_trait_definition_id",
+ )
"""
_response = self._raw_client.get_entity_trait_definition(
entity_trait_definition_id, request_options=request_options
@@ -883,8 +969,14 @@ def update_entity_trait_definition(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.update_entity_trait_definition(entity_trait_definition_id='entity_trait_definition_id', trait_type="boolean", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.update_entity_trait_definition(
+ entity_trait_definition_id="entity_trait_definition_id",
+ trait_type="boolean",
+ )
"""
_response = self._raw_client.update_entity_trait_definition(
entity_trait_definition_id,
@@ -933,7 +1025,10 @@ def count_entity_trait_definitions(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.count_entity_trait_definitions()
"""
_response = self._raw_client.count_entity_trait_definitions(
@@ -980,8 +1075,13 @@ def get_entity_trait_values(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.get_entity_trait_values(definition_id='definition_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_entity_trait_values(
+ definition_id="definition_id",
+ )
"""
_response = self._raw_client.get_entity_trait_values(
definition_id=definition_id, q=q, limit=limit, offset=offset, request_options=request_options
@@ -1027,8 +1127,14 @@ def upsert_user_trait(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.upsert_user_trait(keys={'key': 'value'}, trait='trait', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.upsert_user_trait(
+ keys={"key": "value"},
+ trait="trait",
+ )
"""
_response = self._raw_client.upsert_user_trait(
keys=keys, trait=trait, incr=incr, set_=set_, update_only=update_only, request_options=request_options
@@ -1078,7 +1184,10 @@ def list_users(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.list_users()
"""
_response = self._raw_client.list_users(
@@ -1095,9 +1204,9 @@ def list_users(
def upsert_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -1110,15 +1219,15 @@ def upsert_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -1148,13 +1257,18 @@ def upsert_user(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.upsert_user(companies=[{'key': 'value'}], company={'key': 'value'}, keys={'key': 'value'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.upsert_user(
+ keys={"key": "value"},
+ )
"""
_response = self._raw_client.upsert_user(
+ keys=keys,
companies=companies,
company=company,
- keys=keys,
company_id=company_id,
company_ids=company_ids,
id=id,
@@ -1184,8 +1298,13 @@ def get_user(self, user_id: str, *, request_options: typing.Optional[RequestOpti
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.get_user(user_id='user_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_user(
+ user_id="user_id",
+ )
"""
_response = self._raw_client.get_user(user_id, request_options=request_options)
return _response.data
@@ -1210,8 +1329,13 @@ def delete_user(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.delete_user(user_id='user_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.delete_user(
+ user_id="user_id",
+ )
"""
_response = self._raw_client.delete_user(user_id, request_options=request_options)
return _response.data
@@ -1259,7 +1383,10 @@ def count_users(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.companies.count_users()
"""
_response = self._raw_client.count_users(
@@ -1276,9 +1403,9 @@ def count_users(
def create_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -1291,15 +1418,15 @@ def create_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -1329,13 +1456,18 @@ def create_user(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.create_user(companies=[{'key': 'value'}], company={'key': 'value'}, keys={'key': 'value'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.create_user(
+ keys={"key": "value"},
+ )
"""
_response = self._raw_client.create_user(
+ keys=keys,
companies=companies,
company=company,
- keys=keys,
company_id=company_id,
company_ids=company_ids,
id=id,
@@ -1366,8 +1498,13 @@ def delete_user_by_keys(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.delete_user_by_keys(keys={'key': 'value'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.delete_user_by_keys(
+ keys={"key": "value"},
+ )
"""
_response = self._raw_client.delete_user_by_keys(keys=keys, request_options=request_options)
return _response.data
@@ -1392,8 +1529,13 @@ def lookup_user(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.companies.lookup_user(keys={'keys': 'keys'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.lookup_user(
+ keys={"keys": "keys"},
+ )
"""
_response = self._raw_client.lookup_user(keys=keys, request_options=request_options)
return _response.data
@@ -1464,11 +1606,19 @@ async def list_companies(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.list_companies()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_companies(
@@ -1523,11 +1673,21 @@ async def upsert_company(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.upsert_company(keys={'key': 'value'}, )
+ await client.companies.upsert_company(
+ keys={"key": "value"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_company(
@@ -1560,11 +1720,21 @@ async def get_company(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.get_company(company_id='company_id', )
+ await client.companies.get_company(
+ company_id="company_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_company(company_id, request_options=request_options)
@@ -1589,11 +1759,21 @@ async def delete_company(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.delete_company(company_id='company_id', )
+ await client.companies.delete_company(
+ company_id="company_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_company(company_id, request_options=request_options)
@@ -1649,11 +1829,19 @@ async def count_companies(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.count_companies()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_companies(
@@ -1708,11 +1896,21 @@ async def create_company(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.create_company(keys={'key': 'value'}, )
+ await client.companies.create_company(
+ keys={"key": "value"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_company(
@@ -1744,11 +1942,21 @@ async def delete_company_by_keys(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.delete_company_by_keys(keys={'key': 'value'}, )
+ await client.companies.delete_company_by_keys(
+ keys={"key": "value"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_company_by_keys(keys=keys, request_options=request_options)
@@ -1773,11 +1981,21 @@ async def lookup_company(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.lookup_company(keys={'keys': 'keys'}, )
+ await client.companies.lookup_company(
+ keys={"keys": "keys"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.lookup_company(keys=keys, request_options=request_options)
@@ -1815,11 +2033,22 @@ async def get_active_deals(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.get_active_deals(company_id='company_id', deal_stage='deal_stage', )
+ await client.companies.get_active_deals(
+ company_id="company_id",
+ deal_stage="deal_stage",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_active_deals(
@@ -1859,11 +2088,19 @@ async def list_company_memberships(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.list_company_memberships()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_company_memberships(
@@ -1891,11 +2128,22 @@ async def get_or_create_company_membership(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.get_or_create_company_membership(company_id='company_id', user_id='user_id', )
+ await client.companies.get_or_create_company_membership(
+ company_id="company_id",
+ user_id="user_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_or_create_company_membership(
@@ -1922,11 +2170,21 @@ async def delete_company_membership(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.delete_company_membership(company_membership_id='company_membership_id', )
+ await client.companies.delete_company_membership(
+ company_membership_id="company_membership_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_company_membership(
@@ -1966,11 +2224,19 @@ async def get_active_company_subscription(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.get_active_company_subscription()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_active_company_subscription(
@@ -2016,11 +2282,22 @@ async def upsert_company_trait(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.upsert_company_trait(keys={'key': 'value'}, trait='trait', )
+ await client.companies.upsert_company_trait(
+ keys={"key": "value"},
+ trait="trait",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_company_trait(
@@ -2063,11 +2340,19 @@ async def list_entity_key_definitions(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.list_entity_key_definitions()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_entity_key_definitions(
@@ -2110,11 +2395,19 @@ async def count_entity_key_definitions(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.count_entity_key_definitions()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_entity_key_definitions(
@@ -2160,11 +2453,19 @@ async def list_entity_trait_definitions(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.list_entity_trait_definitions()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_entity_trait_definitions(
@@ -2208,11 +2509,23 @@ async def get_or_create_entity_trait_definition(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.get_or_create_entity_trait_definition(entity_type="company", hierarchy=['hierarchy'], trait_type="boolean", )
+ await client.companies.get_or_create_entity_trait_definition(
+ entity_type="company",
+ hierarchy=["hierarchy"],
+ trait_type="boolean",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_or_create_entity_trait_definition(
@@ -2243,11 +2556,21 @@ async def get_entity_trait_definition(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.get_entity_trait_definition(entity_trait_definition_id='entity_trait_definition_id', )
+ await client.companies.get_entity_trait_definition(
+ entity_trait_definition_id="entity_trait_definition_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_entity_trait_definition(
@@ -2283,11 +2606,22 @@ async def update_entity_trait_definition(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.update_entity_trait_definition(entity_trait_definition_id='entity_trait_definition_id', trait_type="boolean", )
+ await client.companies.update_entity_trait_definition(
+ entity_trait_definition_id="entity_trait_definition_id",
+ trait_type="boolean",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_entity_trait_definition(
@@ -2336,11 +2670,19 @@ async def count_entity_trait_definitions(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.count_entity_trait_definitions()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_entity_trait_definitions(
@@ -2386,11 +2728,21 @@ async def get_entity_trait_values(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.get_entity_trait_values(definition_id='definition_id', )
+ await client.companies.get_entity_trait_values(
+ definition_id="definition_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_entity_trait_values(
@@ -2436,11 +2788,22 @@ async def upsert_user_trait(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.upsert_user_trait(keys={'key': 'value'}, trait='trait', )
+ await client.companies.upsert_user_trait(
+ keys={"key": "value"},
+ trait="trait",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_user_trait(
@@ -2490,11 +2853,19 @@ async def list_users(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.list_users()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_users(
@@ -2511,9 +2882,9 @@ async def main() -> None:
async def upsert_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -2526,15 +2897,15 @@ async def upsert_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -2563,17 +2934,27 @@ async def upsert_user(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.upsert_user(companies=[{'key': 'value'}], company={'key': 'value'}, keys={'key': 'value'}, )
+ await client.companies.upsert_user(
+ keys={"key": "value"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_user(
+ keys=keys,
companies=companies,
company=company,
- keys=keys,
company_id=company_id,
company_ids=company_ids,
id=id,
@@ -2604,11 +2985,21 @@ async def get_user(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.get_user(user_id='user_id', )
+ await client.companies.get_user(
+ user_id="user_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_user(user_id, request_options=request_options)
@@ -2633,11 +3024,21 @@ async def delete_user(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.delete_user(user_id='user_id', )
+ await client.companies.delete_user(
+ user_id="user_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_user(user_id, request_options=request_options)
@@ -2685,11 +3086,19 @@ async def count_users(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.companies.count_users()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_users(
@@ -2706,9 +3115,9 @@ async def main() -> None:
async def create_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -2721,15 +3130,15 @@ async def create_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -2758,17 +3167,27 @@ async def create_user(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.create_user(companies=[{'key': 'value'}], company={'key': 'value'}, keys={'key': 'value'}, )
+ await client.companies.create_user(
+ keys={"key": "value"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_user(
+ keys=keys,
companies=companies,
company=company,
- keys=keys,
company_id=company_id,
company_ids=company_ids,
id=id,
@@ -2798,11 +3217,21 @@ async def delete_user_by_keys(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.delete_user_by_keys(keys={'key': 'value'}, )
+ await client.companies.delete_user_by_keys(
+ keys={"key": "value"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_user_by_keys(keys=keys, request_options=request_options)
@@ -2827,11 +3256,21 @@ async def lookup_user(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.companies.lookup_user(keys={'keys': 'keys'}, )
+ await client.companies.lookup_user(
+ keys={"keys": "keys"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.lookup_user(keys=keys, request_options=request_options)
diff --git a/src/schematic/companies/raw_client.py b/src/schematic/companies/raw_client.py
index 797a813..e2445b5 100644
--- a/src/schematic/companies/raw_client.py
+++ b/src/schematic/companies/raw_client.py
@@ -146,51 +146,66 @@ def list_companies(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_company(
@@ -259,51 +274,66 @@ def upsert_company(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_company(
@@ -340,51 +370,55 @@ def get_company(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_company(
@@ -421,51 +455,66 @@ def delete_company(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_companies(
@@ -543,51 +592,66 @@ def count_companies(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_company(
@@ -656,51 +720,66 @@ def create_company(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_company_by_keys(
@@ -743,51 +822,66 @@ def delete_company_by_keys(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def lookup_company(
@@ -827,51 +921,55 @@ def lookup_company(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_active_deals(
@@ -927,51 +1025,66 @@ def get_active_deals(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_company_memberships(
@@ -1027,51 +1140,66 @@ def list_company_memberships(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_or_create_company_membership(
@@ -1117,51 +1245,66 @@ def get_or_create_company_membership(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_company_membership(
@@ -1198,51 +1341,66 @@ def delete_company_membership(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_active_company_subscription(
@@ -1298,51 +1456,66 @@ def get_active_company_subscription(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_company_trait(
@@ -1409,51 +1582,66 @@ def upsert_company_trait(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_entity_key_definitions(
@@ -1513,51 +1701,66 @@ def list_entity_key_definitions(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_entity_key_definitions(
@@ -1617,51 +1820,66 @@ def count_entity_key_definitions(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_entity_trait_definitions(
@@ -1725,51 +1943,66 @@ def list_entity_trait_definitions(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_or_create_entity_trait_definition(
@@ -1827,51 +2060,66 @@ def get_or_create_entity_trait_definition(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_entity_trait_definition(
@@ -1908,51 +2156,55 @@ def get_entity_trait_definition(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_entity_trait_definition(
@@ -2006,61 +2258,66 @@ def update_entity_trait_definition(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_entity_trait_definitions(
@@ -2124,51 +2381,66 @@ def count_entity_trait_definitions(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_entity_trait_values(
@@ -2224,51 +2496,66 @@ def get_entity_trait_values(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_user_trait(
@@ -2335,51 +2622,66 @@ def upsert_user_trait(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
- if _response.status_code == 500:
- raise InternalServerError(
- typing.cast(
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_users(
@@ -2447,59 +2749,74 @@ def list_users(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -2512,15 +2829,15 @@ def upsert_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -2580,51 +2897,66 @@ def upsert_user(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_user(
@@ -2661,51 +2993,55 @@ def get_user(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_user(
@@ -2742,51 +3078,66 @@ def delete_user(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_users(
@@ -2854,59 +3205,74 @@ def count_users(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -2919,15 +3285,15 @@ def create_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -2987,51 +3353,66 @@ def create_user(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_user_by_keys(
@@ -3074,51 +3455,66 @@ def delete_user_by_keys(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def lookup_user(
@@ -3158,51 +3554,55 @@ def lookup_user(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -3285,51 +3685,66 @@ async def list_companies(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_company(
@@ -3398,51 +3813,66 @@ async def upsert_company(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_company(
@@ -3479,51 +3909,55 @@ async def get_company(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_company(
@@ -3560,51 +3994,66 @@ async def delete_company(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_companies(
@@ -3682,51 +4131,66 @@ async def count_companies(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_company(
@@ -3795,51 +4259,66 @@ async def create_company(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_company_by_keys(
@@ -3882,51 +4361,66 @@ async def delete_company_by_keys(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def lookup_company(
@@ -3966,51 +4460,55 @@ async def lookup_company(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_active_deals(
@@ -4066,51 +4564,66 @@ async def get_active_deals(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_company_memberships(
@@ -4166,51 +4679,66 @@ async def list_company_memberships(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_or_create_company_membership(
@@ -4256,51 +4784,66 @@ async def get_or_create_company_membership(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_company_membership(
@@ -4337,51 +4880,66 @@ async def delete_company_membership(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_active_company_subscription(
@@ -4437,51 +4995,66 @@ async def get_active_company_subscription(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_company_trait(
@@ -4548,51 +5121,66 @@ async def upsert_company_trait(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_entity_key_definitions(
@@ -4652,51 +5240,66 @@ async def list_entity_key_definitions(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_entity_key_definitions(
@@ -4756,51 +5359,66 @@ async def count_entity_key_definitions(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_entity_trait_definitions(
@@ -4864,51 +5482,66 @@ async def list_entity_trait_definitions(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_or_create_entity_trait_definition(
@@ -4966,51 +5599,66 @@ async def get_or_create_entity_trait_definition(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_entity_trait_definition(
@@ -5047,51 +5695,55 @@ async def get_entity_trait_definition(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_entity_trait_definition(
@@ -5145,61 +5797,66 @@ async def update_entity_trait_definition(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_entity_trait_definitions(
@@ -5263,51 +5920,66 @@ async def count_entity_trait_definitions(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_entity_trait_values(
@@ -5363,51 +6035,66 @@ async def get_entity_trait_values(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_user_trait(
@@ -5474,51 +6161,66 @@ async def upsert_user_trait(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_users(
@@ -5586,59 +6288,74 @@ async def list_users(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -5651,15 +6368,15 @@ async def upsert_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -5719,51 +6436,66 @@ async def upsert_user(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_user(
@@ -5800,51 +6532,55 @@ async def get_user(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_user(
@@ -5881,51 +6617,66 @@ async def delete_user(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_users(
@@ -5993,59 +6744,74 @@ async def count_users(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_user(
self,
*,
- companies: typing.Sequence[typing.Dict[str, str]],
- company: typing.Dict[str, str],
keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
company_id: typing.Optional[str] = OMIT,
company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
id: typing.Optional[str] = OMIT,
@@ -6058,15 +6824,15 @@ async def create_user(
"""
Parameters
----------
- companies : typing.Sequence[typing.Dict[str, str]]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
Optionally specify companies using array of key/value pairs
- company : typing.Dict[str, str]
+ company : typing.Optional[typing.Dict[str, str]]
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
company_id : typing.Optional[str]
Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
@@ -6126,51 +6892,66 @@ async def create_user(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_user_by_keys(
@@ -6213,51 +6994,66 @@ async def delete_user_by_keys(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def lookup_user(
@@ -6297,49 +7093,53 @@ async def lookup_user(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/components/client.py b/src/schematic/components/client.py
index c55be94..0b6db4a 100644
--- a/src/schematic/components/client.py
+++ b/src/schematic/components/client.py
@@ -65,7 +65,10 @@ def list_components(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.components.list_components()
"""
_response = self._raw_client.list_components(q=q, limit=limit, offset=offset, request_options=request_options)
@@ -99,8 +102,14 @@ def create_component(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.components.create_component(entity_type="entitlement", name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.components.create_component(
+ entity_type="entitlement",
+ name="name",
+ )
"""
_response = self._raw_client.create_component(
entity_type=entity_type, name=name, ast=ast, request_options=request_options
@@ -127,8 +136,13 @@ def get_component(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.components.get_component(component_id='component_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.components.get_component(
+ component_id="component_id",
+ )
"""
_response = self._raw_client.get_component(component_id, request_options=request_options)
return _response.data
@@ -168,8 +182,13 @@ def update_component(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.components.update_component(component_id='component_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.components.update_component(
+ component_id="component_id",
+ )
"""
_response = self._raw_client.update_component(
component_id, ast=ast, entity_type=entity_type, name=name, state=state, request_options=request_options
@@ -196,8 +215,13 @@ def delete_component(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.components.delete_component(component_id='component_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.components.delete_component(
+ component_id="component_id",
+ )
"""
_response = self._raw_client.delete_component(component_id, request_options=request_options)
return _response.data
@@ -232,7 +256,10 @@ def count_components(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.components.count_components()
"""
_response = self._raw_client.count_components(q=q, limit=limit, offset=offset, request_options=request_options)
@@ -263,7 +290,10 @@ def preview_component_data(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.components.preview_component_data()
"""
_response = self._raw_client.preview_component_data(
@@ -316,11 +346,19 @@ async def list_components(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.components.list_components()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_components(
@@ -355,11 +393,22 @@ async def create_component(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.components.create_component(entity_type="entitlement", name='name', )
+ await client.components.create_component(
+ entity_type="entitlement",
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_component(
@@ -386,11 +435,21 @@ async def get_component(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.components.get_component(component_id='component_id', )
+ await client.components.get_component(
+ component_id="component_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_component(component_id, request_options=request_options)
@@ -430,11 +489,21 @@ async def update_component(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.components.update_component(component_id='component_id', )
+ await client.components.update_component(
+ component_id="component_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_component(
@@ -461,11 +530,21 @@ async def delete_component(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.components.delete_component(component_id='component_id', )
+ await client.components.delete_component(
+ component_id="component_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_component(component_id, request_options=request_options)
@@ -500,11 +579,19 @@ async def count_components(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.components.count_components()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_components(
@@ -536,11 +623,19 @@ async def preview_component_data(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.components.preview_component_data()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.preview_component_data(
diff --git a/src/schematic/components/raw_client.py b/src/schematic/components/raw_client.py
index d19e005..c705c46 100644
--- a/src/schematic/components/raw_client.py
+++ b/src/schematic/components/raw_client.py
@@ -83,51 +83,66 @@ def list_components(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_component(
@@ -181,51 +196,66 @@ def create_component(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_component(
@@ -262,51 +292,55 @@ def get_component(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_component(
@@ -368,61 +402,66 @@ def update_component(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_component(
@@ -459,51 +498,66 @@ def delete_component(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_components(
@@ -555,51 +609,66 @@ def count_components(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def preview_component_data(
@@ -645,51 +714,55 @@ def preview_component_data(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -746,51 +819,66 @@ async def list_components(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_component(
@@ -844,51 +932,66 @@ async def create_component(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_component(
@@ -925,51 +1028,55 @@ async def get_component(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_component(
@@ -1031,61 +1138,66 @@ async def update_component(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_component(
@@ -1122,51 +1234,66 @@ async def delete_component(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_components(
@@ -1218,51 +1345,66 @@ async def count_components(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def preview_component_data(
@@ -1308,49 +1450,53 @@ async def preview_component_data(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/core/client_wrapper.py b/src/schematic/core/client_wrapper.py
index 52d0ce2..cc0c6f4 100644
--- a/src/schematic/core/client_wrapper.py
+++ b/src/schematic/core/client_wrapper.py
@@ -14,10 +14,10 @@ def __init__(self, *, api_key: str, base_url: str, timeout: typing.Optional[floa
def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
- "User-Agent": "schematichq/1.0.8",
+ "User-Agent": "schematichq/1.0.9",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "schematichq",
- "X-Fern-SDK-Version": "1.0.8",
+ "X-Fern-SDK-Version": "1.0.9",
}
headers["X-Schematic-Api-Key"] = self.api_key
return headers
diff --git a/src/schematic/core/force_multipart.py b/src/schematic/core/force_multipart.py
new file mode 100644
index 0000000..ae24ccf
--- /dev/null
+++ b/src/schematic/core/force_multipart.py
@@ -0,0 +1,16 @@
+# This file was auto-generated by Fern from our API Definition.
+
+
+class ForceMultipartDict(dict):
+ """
+ A dictionary subclass that always evaluates to True in boolean contexts.
+
+ This is used to force multipart/form-data encoding in HTTP requests even when
+ the dictionary is empty, which would normally evaluate to False.
+ """
+
+ def __bool__(self):
+ return True
+
+
+FORCE_MULTIPART = ForceMultipartDict()
diff --git a/src/schematic/core/http_client.py b/src/schematic/core/http_client.py
index e7bd4f7..e4173f9 100644
--- a/src/schematic/core/http_client.py
+++ b/src/schematic/core/http_client.py
@@ -11,10 +11,12 @@
import httpx
from .file import File, convert_file_dict_to_httpx_tuples
+from .force_multipart import FORCE_MULTIPART
from .jsonable_encoder import jsonable_encoder
from .query_encoder import encode_query
from .remove_none_from_dict import remove_none_from_dict
from .request_options import RequestOptions
+from httpx._types import RequestFiles
INITIAL_RETRY_DELAY_SECONDS = 0.5
MAX_RETRY_DELAY_SECONDS = 10
@@ -178,11 +180,17 @@ def request(
json: typing.Optional[typing.Any] = None,
data: typing.Optional[typing.Any] = None,
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
- files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ files: typing.Optional[
+ typing.Union[
+ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
+ typing.List[typing.Tuple[str, File]],
+ ]
+ ] = None,
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
request_options: typing.Optional[RequestOptions] = None,
retries: int = 2,
omit: typing.Optional[typing.Any] = None,
+ force_multipart: typing.Optional[bool] = None,
) -> httpx.Response:
base_url = self.get_base_url(base_url)
timeout = (
@@ -193,6 +201,15 @@ def request(
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+ request_files: typing.Optional[RequestFiles] = (
+ convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
+ if (files is not None and files is not omit and isinstance(files, dict))
+ else None
+ )
+
+ if (request_files is None or len(request_files) == 0) and force_multipart:
+ request_files = FORCE_MULTIPART
+
response = self.httpx_client.request(
method=method,
url=urllib.parse.urljoin(f"{base_url}/", path),
@@ -225,11 +242,7 @@ def request(
json=json_body,
data=data_body,
content=content,
- files=(
- convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
- if (files is not None and files is not omit)
- else None
- ),
+ files=request_files,
timeout=timeout,
)
@@ -264,11 +277,17 @@ def stream(
json: typing.Optional[typing.Any] = None,
data: typing.Optional[typing.Any] = None,
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
- files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ files: typing.Optional[
+ typing.Union[
+ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
+ typing.List[typing.Tuple[str, File]],
+ ]
+ ] = None,
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
request_options: typing.Optional[RequestOptions] = None,
retries: int = 2,
omit: typing.Optional[typing.Any] = None,
+ force_multipart: typing.Optional[bool] = None,
) -> typing.Iterator[httpx.Response]:
base_url = self.get_base_url(base_url)
timeout = (
@@ -277,6 +296,15 @@ def stream(
else self.base_timeout()
)
+ request_files: typing.Optional[RequestFiles] = (
+ convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
+ if (files is not None and files is not omit and isinstance(files, dict))
+ else None
+ )
+
+ if (request_files is None or len(request_files) == 0) and force_multipart:
+ request_files = FORCE_MULTIPART
+
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
with self.httpx_client.stream(
@@ -311,11 +339,7 @@ def stream(
json=json_body,
data=data_body,
content=content,
- files=(
- convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
- if (files is not None and files is not omit)
- else None
- ),
+ files=request_files,
timeout=timeout,
) as stream:
yield stream
@@ -354,11 +378,17 @@ async def request(
json: typing.Optional[typing.Any] = None,
data: typing.Optional[typing.Any] = None,
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
- files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ files: typing.Optional[
+ typing.Union[
+ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
+ typing.List[typing.Tuple[str, File]],
+ ]
+ ] = None,
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
request_options: typing.Optional[RequestOptions] = None,
retries: int = 2,
omit: typing.Optional[typing.Any] = None,
+ force_multipart: typing.Optional[bool] = None,
) -> httpx.Response:
base_url = self.get_base_url(base_url)
timeout = (
@@ -367,6 +397,15 @@ async def request(
else self.base_timeout()
)
+ request_files: typing.Optional[RequestFiles] = (
+ convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
+ if (files is not None and files is not omit and isinstance(files, dict))
+ else None
+ )
+
+ if (request_files is None or len(request_files) == 0) and force_multipart:
+ request_files = FORCE_MULTIPART
+
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
# Add the input to each of these and do None-safety checks
@@ -402,11 +441,7 @@ async def request(
json=json_body,
data=data_body,
content=content,
- files=(
- convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
- if files is not None
- else None
- ),
+ files=request_files,
timeout=timeout,
)
@@ -440,11 +475,17 @@ async def stream(
json: typing.Optional[typing.Any] = None,
data: typing.Optional[typing.Any] = None,
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
- files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ files: typing.Optional[
+ typing.Union[
+ typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
+ typing.List[typing.Tuple[str, File]],
+ ]
+ ] = None,
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
request_options: typing.Optional[RequestOptions] = None,
retries: int = 2,
omit: typing.Optional[typing.Any] = None,
+ force_multipart: typing.Optional[bool] = None,
) -> typing.AsyncIterator[httpx.Response]:
base_url = self.get_base_url(base_url)
timeout = (
@@ -453,6 +494,15 @@ async def stream(
else self.base_timeout()
)
+ request_files: typing.Optional[RequestFiles] = (
+ convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
+ if (files is not None and files is not omit and isinstance(files, dict))
+ else None
+ )
+
+ if (request_files is None or len(request_files) == 0) and force_multipart:
+ request_files = FORCE_MULTIPART
+
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
async with self.httpx_client.stream(
@@ -487,11 +537,7 @@ async def stream(
json=json_body,
data=data_body,
content=content,
- files=(
- convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
- if files is not None
- else None
- ),
+ files=request_files,
timeout=timeout,
) as stream:
yield stream
diff --git a/src/schematic/core/http_response.py b/src/schematic/core/http_response.py
index c72a913..48a1798 100644
--- a/src/schematic/core/http_response.py
+++ b/src/schematic/core/http_response.py
@@ -5,20 +5,31 @@
import httpx
T = TypeVar("T")
+"""Generic to represent the underlying type of the data wrapped by the HTTP response."""
-class HttpResponse(Generic[T]):
+class BaseHttpResponse:
+ """Minimalist HTTP response wrapper that exposes response headers."""
+
_response: httpx.Response
- _data: T
- def __init__(self, response: httpx.Response, data: T):
+ def __init__(self, response: httpx.Response):
self._response = response
- self._data = data
@property
def headers(self) -> Dict[str, str]:
return dict(self._response.headers)
+
+class HttpResponse(Generic[T], BaseHttpResponse):
+ """HTTP response wrapper that exposes response headers and data."""
+
+ _data: T
+
+ def __init__(self, response: httpx.Response, data: T):
+ super().__init__(response)
+ self._data = data
+
@property
def data(self) -> T:
return self._data
@@ -27,18 +38,15 @@ def close(self) -> None:
self._response.close()
-class AsyncHttpResponse(Generic[T]):
- _response: httpx.Response
+class AsyncHttpResponse(Generic[T], BaseHttpResponse):
+ """HTTP response wrapper that exposes response headers and data."""
+
_data: T
def __init__(self, response: httpx.Response, data: T):
- self._response = response
+ super().__init__(response)
self._data = data
- @property
- def headers(self) -> Dict[str, str]:
- return dict(self._response.headers)
-
@property
def data(self) -> T:
return self._data
diff --git a/src/schematic/core/pydantic_utilities.py b/src/schematic/core/pydantic_utilities.py
index 60a2c71..0360ef4 100644
--- a/src/schematic/core/pydantic_utilities.py
+++ b/src/schematic/core/pydantic_utilities.py
@@ -181,7 +181,7 @@ def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any
if IS_PYDANTIC_V2:
- class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[name-defined, type-arg]
+ class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg]
pass
UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc]
diff --git a/src/schematic/crm/client.py b/src/schematic/crm/client.py
index 86effa1..13a037a 100644
--- a/src/schematic/crm/client.py
+++ b/src/schematic/crm/client.py
@@ -55,8 +55,14 @@ def upsert_deal_line_item_association(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.crm.upsert_deal_line_item_association(deal_external_id='deal_external_id', line_item_external_id='line_item_external_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.crm.upsert_deal_line_item_association(
+ deal_external_id="deal_external_id",
+ line_item_external_id="line_item_external_id",
+ )
"""
_response = self._raw_client.upsert_deal_line_item_association(
deal_external_id=deal_external_id,
@@ -108,8 +114,17 @@ def upsert_line_item(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.crm.upsert_line_item(amount='amount', interval='interval', line_item_external_id='line_item_external_id', product_external_id='product_external_id', quantity=1, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.crm.upsert_line_item(
+ amount="amount",
+ interval="interval",
+ line_item_external_id="line_item_external_id",
+ product_external_id="product_external_id",
+ quantity=1,
+ )
"""
_response = self._raw_client.upsert_line_item(
amount=amount,
@@ -170,8 +185,15 @@ def upsert_crm_deal(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.crm.upsert_crm_deal(crm_company_key='crm_company_key', crm_type='crm_type', deal_external_id='deal_external_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.crm.upsert_crm_deal(
+ crm_company_key="crm_company_key",
+ crm_type="crm_type",
+ deal_external_id="deal_external_id",
+ )
"""
_response = self._raw_client.upsert_crm_deal(
crm_company_key=crm_company_key,
@@ -220,7 +242,10 @@ def list_crm_products(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.crm.list_crm_products()
"""
_response = self._raw_client.list_crm_products(
@@ -271,8 +296,20 @@ def upsert_crm_product(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.crm.upsert_crm_product(currency='currency', description='description', external_id='external_id', interval='interval', name='name', price='price', quantity=1, sku='sku', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.crm.upsert_crm_product(
+ currency="currency",
+ description="description",
+ external_id="external_id",
+ interval="interval",
+ name="name",
+ price="price",
+ quantity=1,
+ sku="sku",
+ )
"""
_response = self._raw_client.upsert_crm_product(
currency=currency,
@@ -327,11 +364,22 @@ async def upsert_deal_line_item_association(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.crm.upsert_deal_line_item_association(deal_external_id='deal_external_id', line_item_external_id='line_item_external_id', )
+ await client.crm.upsert_deal_line_item_association(
+ deal_external_id="deal_external_id",
+ line_item_external_id="line_item_external_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_deal_line_item_association(
@@ -383,11 +431,25 @@ async def upsert_line_item(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.crm.upsert_line_item(amount='amount', interval='interval', line_item_external_id='line_item_external_id', product_external_id='product_external_id', quantity=1, )
+ await client.crm.upsert_line_item(
+ amount="amount",
+ interval="interval",
+ line_item_external_id="line_item_external_id",
+ product_external_id="product_external_id",
+ quantity=1,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_line_item(
@@ -448,11 +510,23 @@ async def upsert_crm_deal(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.crm.upsert_crm_deal(crm_company_key='crm_company_key', crm_type='crm_type', deal_external_id='deal_external_id', )
+ await client.crm.upsert_crm_deal(
+ crm_company_key="crm_company_key",
+ crm_type="crm_type",
+ deal_external_id="deal_external_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_crm_deal(
@@ -501,11 +575,19 @@ async def list_crm_products(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.crm.list_crm_products()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_crm_products(
@@ -555,11 +637,28 @@ async def upsert_crm_product(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.crm.upsert_crm_product(currency='currency', description='description', external_id='external_id', interval='interval', name='name', price='price', quantity=1, sku='sku', )
+ await client.crm.upsert_crm_product(
+ currency="currency",
+ description="description",
+ external_id="external_id",
+ interval="interval",
+ name="name",
+ price="price",
+ quantity=1,
+ sku="sku",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_crm_product(
diff --git a/src/schematic/crm/raw_client.py b/src/schematic/crm/raw_client.py
index 49e5eb3..2448c07 100644
--- a/src/schematic/crm/raw_client.py
+++ b/src/schematic/crm/raw_client.py
@@ -11,6 +11,7 @@
from ..errors.bad_request_error import BadRequestError
from ..errors.forbidden_error import ForbiddenError
from ..errors.internal_server_error import InternalServerError
+from ..errors.not_found_error import NotFoundError
from ..errors.unauthorized_error import UnauthorizedError
from ..types.api_error import ApiError as types_api_error_ApiError
from .types.list_crm_products_response import ListCrmProductsResponse
@@ -74,51 +75,66 @@ def upsert_deal_line_item_association(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_line_item(
@@ -192,51 +208,66 @@ def upsert_line_item(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_crm_deal(
@@ -314,51 +345,66 @@ def upsert_crm_deal(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_crm_products(
@@ -414,51 +460,66 @@ def list_crm_products(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_crm_product(
@@ -532,51 +593,66 @@ def upsert_crm_product(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -631,51 +707,66 @@ async def upsert_deal_line_item_association(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_line_item(
@@ -749,51 +840,66 @@ async def upsert_line_item(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_crm_deal(
@@ -871,51 +977,66 @@ async def upsert_crm_deal(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_crm_products(
@@ -971,51 +1092,66 @@ async def list_crm_products(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_crm_product(
@@ -1089,49 +1225,64 @@ async def upsert_crm_product(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/dataexports/client.py b/src/schematic/dataexports/client.py
index b542414..d933c2c 100644
--- a/src/schematic/dataexports/client.py
+++ b/src/schematic/dataexports/client.py
@@ -45,8 +45,13 @@ def create_data_export(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.dataexports.create_data_export(metadata='metadata', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.dataexports.create_data_export(
+ metadata="metadata",
+ )
"""
_response = self._raw_client.create_data_export(metadata=metadata, request_options=request_options)
return _response.data
@@ -105,11 +110,21 @@ async def create_data_export(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.dataexports.create_data_export(metadata='metadata', )
+ await client.dataexports.create_data_export(
+ metadata="metadata",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_data_export(metadata=metadata, request_options=request_options)
@@ -133,5 +148,5 @@ async def get_data_export_artifact(
OK
"""
async with self._raw_client.get_data_export_artifact(data_export_id, request_options=request_options) as r:
- async for data in r.data:
- yield data
+ async for _chunk in r.data:
+ yield _chunk
diff --git a/src/schematic/dataexports/raw_client.py b/src/schematic/dataexports/raw_client.py
index af6e1c6..a450ec0 100644
--- a/src/schematic/dataexports/raw_client.py
+++ b/src/schematic/dataexports/raw_client.py
@@ -68,51 +68,66 @@ def create_data_export(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@contextlib.contextmanager
@@ -139,7 +154,7 @@ def get_data_export_artifact(
request_options=request_options,
) as _response:
- def stream() -> HttpResponse[typing.Iterator[bytes]]:
+ def _stream() -> HttpResponse[typing.Iterator[bytes]]:
try:
if 200 <= _response.status_code < 300:
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
@@ -149,54 +164,58 @@ def stream() -> HttpResponse[typing.Iterator[bytes]]:
_response.read()
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- yield stream()
+ yield _stream()
class AsyncRawDataexportsClient:
@@ -245,51 +264,66 @@ async def create_data_export(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@contextlib.asynccontextmanager
@@ -316,7 +350,7 @@ async def get_data_export_artifact(
request_options=request_options,
) as _response:
- async def stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]:
+ async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]:
try:
if 200 <= _response.status_code < 300:
_chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
@@ -327,51 +361,55 @@ async def stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]:
await _response.aread()
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- yield await stream()
+ yield await _stream()
diff --git a/src/schematic/entitlements/client.py b/src/schematic/entitlements/client.py
index a97e847..93fddcc 100644
--- a/src/schematic/entitlements/client.py
+++ b/src/schematic/entitlements/client.py
@@ -120,7 +120,10 @@ def list_company_overrides(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.entitlements.list_company_overrides()
"""
_response = self._raw_client.list_company_overrides(
@@ -183,8 +186,15 @@ def create_company_override(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.create_company_override(company_id='company_id', feature_id='feature_id', value_type="boolean", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.create_company_override(
+ company_id="company_id",
+ feature_id="feature_id",
+ value_type="boolean",
+ )
"""
_response = self._raw_client.create_company_override(
company_id=company_id,
@@ -220,8 +230,13 @@ def get_company_override(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.get_company_override(company_override_id='company_override_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.get_company_override(
+ company_override_id="company_override_id",
+ )
"""
_response = self._raw_client.get_company_override(company_override_id, request_options=request_options)
return _response.data
@@ -270,8 +285,14 @@ def update_company_override(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.update_company_override(company_override_id='company_override_id', value_type="boolean", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.update_company_override(
+ company_override_id="company_override_id",
+ value_type="boolean",
+ )
"""
_response = self._raw_client.update_company_override(
company_override_id,
@@ -306,8 +327,13 @@ def delete_company_override(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.delete_company_override(company_override_id='company_override_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.delete_company_override(
+ company_override_id="company_override_id",
+ )
"""
_response = self._raw_client.delete_company_override(company_override_id, request_options=request_options)
return _response.data
@@ -367,7 +393,10 @@ def count_company_overrides(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.entitlements.count_company_overrides()
"""
_response = self._raw_client.count_company_overrides(
@@ -417,8 +446,13 @@ def list_feature_companies(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.list_feature_companies(feature_id='feature_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.list_feature_companies(
+ feature_id="feature_id",
+ )
"""
_response = self._raw_client.list_feature_companies(
feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
@@ -458,8 +492,13 @@ def count_feature_companies(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.count_feature_companies(feature_id='feature_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.count_feature_companies(
+ feature_id="feature_id",
+ )
"""
_response = self._raw_client.count_feature_companies(
feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
@@ -508,7 +547,10 @@ def list_feature_usage(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.entitlements.list_feature_usage()
"""
_response = self._raw_client.list_feature_usage(
@@ -565,7 +607,10 @@ def count_feature_usage(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.entitlements.count_feature_usage()
"""
_response = self._raw_client.count_feature_usage(
@@ -613,8 +658,13 @@ def list_feature_users(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.list_feature_users(feature_id='feature_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.list_feature_users(
+ feature_id="feature_id",
+ )
"""
_response = self._raw_client.list_feature_users(
feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
@@ -654,8 +704,13 @@ def count_feature_users(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.count_feature_users(feature_id='feature_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.count_feature_users(
+ feature_id="feature_id",
+ )
"""
_response = self._raw_client.count_feature_users(
feature_id=feature_id, q=q, limit=limit, offset=offset, request_options=request_options
@@ -717,7 +772,10 @@ def list_plan_entitlements(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.entitlements.list_plan_entitlements()
"""
_response = self._raw_client.list_plan_entitlements(
@@ -807,8 +865,15 @@ def create_plan_entitlement(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.create_plan_entitlement(feature_id='feature_id', plan_id='plan_id', value_type="boolean", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.create_plan_entitlement(
+ feature_id="feature_id",
+ plan_id="plan_id",
+ value_type="boolean",
+ )
"""
_response = self._raw_client.create_plan_entitlement(
feature_id=feature_id,
@@ -853,8 +918,13 @@ def get_plan_entitlement(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.get_plan_entitlement(plan_entitlement_id='plan_entitlement_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.get_plan_entitlement(
+ plan_entitlement_id="plan_entitlement_id",
+ )
"""
_response = self._raw_client.get_plan_entitlement(plan_entitlement_id, request_options=request_options)
return _response.data
@@ -930,8 +1000,14 @@ def update_plan_entitlement(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.update_plan_entitlement(plan_entitlement_id='plan_entitlement_id', value_type="boolean", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.update_plan_entitlement(
+ plan_entitlement_id="plan_entitlement_id",
+ value_type="boolean",
+ )
"""
_response = self._raw_client.update_plan_entitlement(
plan_entitlement_id,
@@ -975,8 +1051,13 @@ def delete_plan_entitlement(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.delete_plan_entitlement(plan_entitlement_id='plan_entitlement_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.delete_plan_entitlement(
+ plan_entitlement_id="plan_entitlement_id",
+ )
"""
_response = self._raw_client.delete_plan_entitlement(plan_entitlement_id, request_options=request_options)
return _response.data
@@ -1036,7 +1117,10 @@ def count_plan_entitlements(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.entitlements.count_plan_entitlements()
"""
_response = self._raw_client.count_plan_entitlements(
@@ -1073,8 +1157,13 @@ def get_feature_usage_by_company(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.entitlements.get_feature_usage_by_company(keys={'keys': 'keys'}, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.entitlements.get_feature_usage_by_company(
+ keys={"keys": "keys"},
+ )
"""
_response = self._raw_client.get_feature_usage_by_company(keys=keys, request_options=request_options)
return _response.data
@@ -1149,11 +1238,19 @@ async def list_company_overrides(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.entitlements.list_company_overrides()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_company_overrides(
@@ -1215,11 +1312,23 @@ async def create_company_override(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.create_company_override(company_id='company_id', feature_id='feature_id', value_type="boolean", )
+ await client.entitlements.create_company_override(
+ company_id="company_id",
+ feature_id="feature_id",
+ value_type="boolean",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_company_override(
@@ -1255,11 +1364,21 @@ async def get_company_override(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.get_company_override(company_override_id='company_override_id', )
+ await client.entitlements.get_company_override(
+ company_override_id="company_override_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_company_override(company_override_id, request_options=request_options)
@@ -1308,11 +1427,22 @@ async def update_company_override(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.update_company_override(company_override_id='company_override_id', value_type="boolean", )
+ await client.entitlements.update_company_override(
+ company_override_id="company_override_id",
+ value_type="boolean",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_company_override(
@@ -1347,11 +1477,21 @@ async def delete_company_override(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.delete_company_override(company_override_id='company_override_id', )
+ await client.entitlements.delete_company_override(
+ company_override_id="company_override_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_company_override(company_override_id, request_options=request_options)
@@ -1411,11 +1551,19 @@ async def count_company_overrides(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.entitlements.count_company_overrides()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_company_overrides(
@@ -1464,11 +1612,21 @@ async def list_feature_companies(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.list_feature_companies(feature_id='feature_id', )
+ await client.entitlements.list_feature_companies(
+ feature_id="feature_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_feature_companies(
@@ -1508,11 +1666,21 @@ async def count_feature_companies(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.count_feature_companies(feature_id='feature_id', )
+ await client.entitlements.count_feature_companies(
+ feature_id="feature_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_feature_companies(
@@ -1561,11 +1729,19 @@ async def list_feature_usage(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.entitlements.list_feature_usage()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_feature_usage(
@@ -1621,11 +1797,19 @@ async def count_feature_usage(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.entitlements.count_feature_usage()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_feature_usage(
@@ -1672,11 +1856,21 @@ async def list_feature_users(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.list_feature_users(feature_id='feature_id', )
+ await client.entitlements.list_feature_users(
+ feature_id="feature_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_feature_users(
@@ -1716,11 +1910,21 @@ async def count_feature_users(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.count_feature_users(feature_id='feature_id', )
+ await client.entitlements.count_feature_users(
+ feature_id="feature_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_feature_users(
@@ -1782,11 +1986,19 @@ async def list_plan_entitlements(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.entitlements.list_plan_entitlements()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_plan_entitlements(
@@ -1875,11 +2087,23 @@ async def create_plan_entitlement(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.create_plan_entitlement(feature_id='feature_id', plan_id='plan_id', value_type="boolean", )
+ await client.entitlements.create_plan_entitlement(
+ feature_id="feature_id",
+ plan_id="plan_id",
+ value_type="boolean",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_plan_entitlement(
@@ -1924,11 +2148,21 @@ async def get_plan_entitlement(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.get_plan_entitlement(plan_entitlement_id='plan_entitlement_id', )
+ await client.entitlements.get_plan_entitlement(
+ plan_entitlement_id="plan_entitlement_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_plan_entitlement(plan_entitlement_id, request_options=request_options)
@@ -2004,11 +2238,22 @@ async def update_plan_entitlement(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.update_plan_entitlement(plan_entitlement_id='plan_entitlement_id', value_type="boolean", )
+ await client.entitlements.update_plan_entitlement(
+ plan_entitlement_id="plan_entitlement_id",
+ value_type="boolean",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_plan_entitlement(
@@ -2052,11 +2297,21 @@ async def delete_plan_entitlement(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.delete_plan_entitlement(plan_entitlement_id='plan_entitlement_id', )
+ await client.entitlements.delete_plan_entitlement(
+ plan_entitlement_id="plan_entitlement_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_plan_entitlement(plan_entitlement_id, request_options=request_options)
@@ -2116,11 +2371,19 @@ async def count_plan_entitlements(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.entitlements.count_plan_entitlements()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_plan_entitlements(
@@ -2156,11 +2419,21 @@ async def get_feature_usage_by_company(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.entitlements.get_feature_usage_by_company(keys={'keys': 'keys'}, )
+ await client.entitlements.get_feature_usage_by_company(
+ keys={"keys": "keys"},
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_feature_usage_by_company(keys=keys, request_options=request_options)
diff --git a/src/schematic/entitlements/raw_client.py b/src/schematic/entitlements/raw_client.py
index 7291844..d27441d 100644
--- a/src/schematic/entitlements/raw_client.py
+++ b/src/schematic/entitlements/raw_client.py
@@ -144,51 +144,66 @@ def list_company_overrides(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_company_override(
@@ -266,51 +281,66 @@ def create_company_override(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_company_override(
@@ -347,51 +377,55 @@ def get_company_override(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_company_override(
@@ -465,61 +499,66 @@ def update_company_override(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_company_override(
@@ -556,51 +595,66 @@ def delete_company_override(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_company_overrides(
@@ -683,51 +737,66 @@ def count_company_overrides(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_feature_companies(
@@ -783,51 +852,66 @@ def list_feature_companies(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_feature_companies(
@@ -883,51 +967,66 @@ def count_feature_companies(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_feature_usage(
@@ -995,51 +1094,66 @@ def list_feature_usage(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_feature_usage(
@@ -1107,51 +1221,66 @@ def count_feature_usage(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_feature_users(
@@ -1207,51 +1336,66 @@ def list_feature_users(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_feature_users(
@@ -1307,51 +1451,66 @@ def count_feature_users(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_plan_entitlements(
@@ -1434,51 +1593,66 @@ def list_plan_entitlements(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_plan_entitlement(
@@ -1592,51 +1766,66 @@ def create_plan_entitlement(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_plan_entitlement(
@@ -1673,51 +1862,55 @@ def get_plan_entitlement(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_plan_entitlement(
@@ -1827,61 +2020,66 @@ def update_plan_entitlement(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_plan_entitlement(
@@ -1918,51 +2116,66 @@ def delete_plan_entitlement(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_plan_entitlements(
@@ -2045,51 +2258,66 @@ def count_plan_entitlements(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_feature_usage_by_company(
@@ -2129,51 +2357,55 @@ def get_feature_usage_by_company(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -2261,51 +2493,66 @@ async def list_company_overrides(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_company_override(
@@ -2383,51 +2630,66 @@ async def create_company_override(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_company_override(
@@ -2464,51 +2726,55 @@ async def get_company_override(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_company_override(
@@ -2582,61 +2848,66 @@ async def update_company_override(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_company_override(
@@ -2673,51 +2944,66 @@ async def delete_company_override(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_company_overrides(
@@ -2800,51 +3086,66 @@ async def count_company_overrides(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_feature_companies(
@@ -2900,51 +3201,66 @@ async def list_feature_companies(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_feature_companies(
@@ -3000,51 +3316,66 @@ async def count_feature_companies(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_feature_usage(
@@ -3112,51 +3443,66 @@ async def list_feature_usage(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_feature_usage(
@@ -3224,51 +3570,66 @@ async def count_feature_usage(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_feature_users(
@@ -3324,51 +3685,66 @@ async def list_feature_users(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_feature_users(
@@ -3424,51 +3800,66 @@ async def count_feature_users(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_plan_entitlements(
@@ -3551,51 +3942,66 @@ async def list_plan_entitlements(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_plan_entitlement(
@@ -3709,51 +4115,66 @@ async def create_plan_entitlement(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_plan_entitlement(
@@ -3790,51 +4211,55 @@ async def get_plan_entitlement(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_plan_entitlement(
@@ -3944,61 +4369,66 @@ async def update_plan_entitlement(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_plan_entitlement(
@@ -4035,51 +4465,66 @@ async def delete_plan_entitlement(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_plan_entitlements(
@@ -4162,51 +4607,66 @@ async def count_plan_entitlements(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_feature_usage_by_company(
@@ -4246,49 +4706,53 @@ async def get_feature_usage_by_company(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/errors/bad_request_error.py b/src/schematic/errors/bad_request_error.py
index 1510c59..3cf1d9c 100644
--- a/src/schematic/errors/bad_request_error.py
+++ b/src/schematic/errors/bad_request_error.py
@@ -1,9 +1,11 @@
# This file was auto-generated by Fern from our API Definition.
+import typing
+
from ..core.api_error import ApiError as core_api_error_ApiError
from ..types.api_error import ApiError as types_api_error_ApiError
class BadRequestError(core_api_error_ApiError):
- def __init__(self, body: types_api_error_ApiError):
- super().__init__(status_code=400, body=body)
+ def __init__(self, body: types_api_error_ApiError, headers: typing.Optional[typing.Dict[str, str]] = None):
+ super().__init__(status_code=400, headers=headers, body=body)
diff --git a/src/schematic/errors/forbidden_error.py b/src/schematic/errors/forbidden_error.py
index 76acfcb..80e15e0 100644
--- a/src/schematic/errors/forbidden_error.py
+++ b/src/schematic/errors/forbidden_error.py
@@ -1,9 +1,11 @@
# This file was auto-generated by Fern from our API Definition.
+import typing
+
from ..core.api_error import ApiError as core_api_error_ApiError
from ..types.api_error import ApiError as types_api_error_ApiError
class ForbiddenError(core_api_error_ApiError):
- def __init__(self, body: types_api_error_ApiError):
- super().__init__(status_code=403, body=body)
+ def __init__(self, body: types_api_error_ApiError, headers: typing.Optional[typing.Dict[str, str]] = None):
+ super().__init__(status_code=403, headers=headers, body=body)
diff --git a/src/schematic/errors/internal_server_error.py b/src/schematic/errors/internal_server_error.py
index 2e45ae3..42082d1 100644
--- a/src/schematic/errors/internal_server_error.py
+++ b/src/schematic/errors/internal_server_error.py
@@ -1,9 +1,11 @@
# This file was auto-generated by Fern from our API Definition.
+import typing
+
from ..core.api_error import ApiError as core_api_error_ApiError
from ..types.api_error import ApiError as types_api_error_ApiError
class InternalServerError(core_api_error_ApiError):
- def __init__(self, body: types_api_error_ApiError):
- super().__init__(status_code=500, body=body)
+ def __init__(self, body: types_api_error_ApiError, headers: typing.Optional[typing.Dict[str, str]] = None):
+ super().__init__(status_code=500, headers=headers, body=body)
diff --git a/src/schematic/errors/not_found_error.py b/src/schematic/errors/not_found_error.py
index e6ba82e..b453b65 100644
--- a/src/schematic/errors/not_found_error.py
+++ b/src/schematic/errors/not_found_error.py
@@ -1,9 +1,11 @@
# This file was auto-generated by Fern from our API Definition.
+import typing
+
from ..core.api_error import ApiError as core_api_error_ApiError
from ..types.api_error import ApiError as types_api_error_ApiError
class NotFoundError(core_api_error_ApiError):
- def __init__(self, body: types_api_error_ApiError):
- super().__init__(status_code=404, body=body)
+ def __init__(self, body: types_api_error_ApiError, headers: typing.Optional[typing.Dict[str, str]] = None):
+ super().__init__(status_code=404, headers=headers, body=body)
diff --git a/src/schematic/errors/unauthorized_error.py b/src/schematic/errors/unauthorized_error.py
index 23e5bed..da573a2 100644
--- a/src/schematic/errors/unauthorized_error.py
+++ b/src/schematic/errors/unauthorized_error.py
@@ -1,9 +1,11 @@
# This file was auto-generated by Fern from our API Definition.
+import typing
+
from ..core.api_error import ApiError as core_api_error_ApiError
from ..types.api_error import ApiError as types_api_error_ApiError
class UnauthorizedError(core_api_error_ApiError):
- def __init__(self, body: types_api_error_ApiError):
- super().__init__(status_code=401, body=body)
+ def __init__(self, body: types_api_error_ApiError, headers: typing.Optional[typing.Dict[str, str]] = None):
+ super().__init__(status_code=401, headers=headers, body=body)
diff --git a/src/schematic/events/__init__.py b/src/schematic/events/__init__.py
index df73c22..7ec28c8 100644
--- a/src/schematic/events/__init__.py
+++ b/src/schematic/events/__init__.py
@@ -10,7 +10,9 @@
GetEventSummariesResponse,
GetSegmentIntegrationStatusResponse,
ListEventsParams,
+ ListEventsRequestEventTypesItem,
ListEventsResponse,
+ ListEventsResponseParamsEventTypesItem,
)
__all__ = [
@@ -21,5 +23,7 @@
"GetEventSummariesResponse",
"GetSegmentIntegrationStatusResponse",
"ListEventsParams",
+ "ListEventsRequestEventTypesItem",
"ListEventsResponse",
+ "ListEventsResponseParamsEventTypesItem",
]
diff --git a/src/schematic/events/client.py b/src/schematic/events/client.py
index c08cbcb..3431424 100644
--- a/src/schematic/events/client.py
+++ b/src/schematic/events/client.py
@@ -14,6 +14,7 @@
from .types.get_event_response import GetEventResponse
from .types.get_event_summaries_response import GetEventSummariesResponse
from .types.get_segment_integration_status_response import GetSegmentIntegrationStatusResponse
+from .types.list_events_request_event_types_item import ListEventsRequestEventTypesItem
from .types.list_events_response import ListEventsResponse
# this is used as the default value for optional parameters
@@ -56,10 +57,18 @@ def create_event_batch(
Examples
--------
- from schematic import Schematic
- from schematic import CreateEventRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.events.create_event_batch(events=[CreateEventRequestBody(event_type="identify", )], )
+ from schematic import CreateEventRequestBody, Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.events.create_event_batch(
+ events=[
+ CreateEventRequestBody(
+ event_type="identify",
+ )
+ ],
+ )
"""
_response = self._raw_client.create_event_batch(events=events, request_options=request_options)
return _response.data
@@ -97,7 +106,10 @@ def get_event_summaries(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.events.get_event_summaries()
"""
_response = self._raw_client.get_event_summaries(
@@ -110,7 +122,9 @@ def list_events(
*,
company_id: typing.Optional[str] = None,
event_subtype: typing.Optional[str] = None,
- event_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ event_types: typing.Optional[
+ typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]
+ ] = None,
flag_id: typing.Optional[str] = None,
user_id: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
@@ -124,7 +138,7 @@ def list_events(
event_subtype : typing.Optional[str]
- event_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ event_types : typing.Optional[typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]]
flag_id : typing.Optional[str]
@@ -147,7 +161,10 @@ def list_events(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.events.list_events()
"""
_response = self._raw_client.list_events(
@@ -192,8 +209,13 @@ def create_event(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.events.create_event(event_type="identify", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.events.create_event(
+ event_type="identify",
+ )
"""
_response = self._raw_client.create_event(
event_type=event_type, body=body, sent_at=sent_at, request_options=request_options
@@ -218,8 +240,13 @@ def get_event(self, event_id: str, *, request_options: typing.Optional[RequestOp
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.events.get_event(event_id='event_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.events.get_event(
+ event_id="event_id",
+ )
"""
_response = self._raw_client.get_event(event_id, request_options=request_options)
return _response.data
@@ -241,7 +268,10 @@ def get_segment_integration_status(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.events.get_segment_integration_status()
"""
_response = self._raw_client.get_segment_integration_status(request_options=request_options)
@@ -284,12 +314,25 @@ async def create_event_batch(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateEventRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic, CreateEventRequestBody
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.events.create_event_batch(events=[CreateEventRequestBody(event_type="identify", )], )
+ await client.events.create_event_batch(
+ events=[
+ CreateEventRequestBody(
+ event_type="identify",
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_event_batch(events=events, request_options=request_options)
@@ -327,11 +370,19 @@ async def get_event_summaries(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.events.get_event_summaries()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_event_summaries(
@@ -344,7 +395,9 @@ async def list_events(
*,
company_id: typing.Optional[str] = None,
event_subtype: typing.Optional[str] = None,
- event_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ event_types: typing.Optional[
+ typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]
+ ] = None,
flag_id: typing.Optional[str] = None,
user_id: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
@@ -358,7 +411,7 @@ async def list_events(
event_subtype : typing.Optional[str]
- event_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ event_types : typing.Optional[typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]]
flag_id : typing.Optional[str]
@@ -380,11 +433,19 @@ async def list_events(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.events.list_events()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_events(
@@ -428,11 +489,21 @@ async def create_event(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.events.create_event(event_type="identify", )
+ await client.events.create_event(
+ event_type="identify",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_event(
@@ -459,11 +530,21 @@ async def get_event(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.events.get_event(event_id='event_id', )
+ await client.events.get_event(
+ event_id="event_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_event(event_id, request_options=request_options)
@@ -485,11 +566,19 @@ async def get_segment_integration_status(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.events.get_segment_integration_status()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_segment_integration_status(request_options=request_options)
diff --git a/src/schematic/events/raw_client.py b/src/schematic/events/raw_client.py
index 57599ca..d790d57 100644
--- a/src/schematic/events/raw_client.py
+++ b/src/schematic/events/raw_client.py
@@ -25,6 +25,7 @@
from .types.get_event_response import GetEventResponse
from .types.get_event_summaries_response import GetEventSummariesResponse
from .types.get_segment_integration_status_response import GetSegmentIntegrationStatusResponse
+from .types.list_events_request_event_types_item import ListEventsRequestEventTypesItem
from .types.list_events_response import ListEventsResponse
# this is used as the default value for optional parameters
@@ -80,51 +81,66 @@ def create_event_batch(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_event_summaries(
@@ -180,51 +196,66 @@ def get_event_summaries(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_events(
@@ -232,7 +263,9 @@ def list_events(
*,
company_id: typing.Optional[str] = None,
event_subtype: typing.Optional[str] = None,
- event_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ event_types: typing.Optional[
+ typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]
+ ] = None,
flag_id: typing.Optional[str] = None,
user_id: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
@@ -246,7 +279,7 @@ def list_events(
event_subtype : typing.Optional[str]
- event_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ event_types : typing.Optional[typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]]
flag_id : typing.Optional[str]
@@ -292,51 +325,66 @@ def list_events(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_event(
@@ -392,51 +440,66 @@ def create_event(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_event(
@@ -473,51 +536,55 @@ def get_event(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_segment_integration_status(
@@ -551,51 +618,55 @@ def get_segment_integration_status(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -648,51 +719,66 @@ async def create_event_batch(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_event_summaries(
@@ -748,51 +834,66 @@ async def get_event_summaries(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_events(
@@ -800,7 +901,9 @@ async def list_events(
*,
company_id: typing.Optional[str] = None,
event_subtype: typing.Optional[str] = None,
- event_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ event_types: typing.Optional[
+ typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]
+ ] = None,
flag_id: typing.Optional[str] = None,
user_id: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
@@ -814,7 +917,7 @@ async def list_events(
event_subtype : typing.Optional[str]
- event_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ event_types : typing.Optional[typing.Union[ListEventsRequestEventTypesItem, typing.Sequence[ListEventsRequestEventTypesItem]]]
flag_id : typing.Optional[str]
@@ -860,51 +963,66 @@ async def list_events(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_event(
@@ -960,51 +1078,66 @@ async def create_event(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_event(
@@ -1041,51 +1174,55 @@ async def get_event(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_segment_integration_status(
@@ -1119,49 +1256,53 @@ async def get_segment_integration_status(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/events/types/__init__.py b/src/schematic/events/types/__init__.py
index 60ba65c..6d21f25 100644
--- a/src/schematic/events/types/__init__.py
+++ b/src/schematic/events/types/__init__.py
@@ -9,7 +9,9 @@
from .get_event_summaries_response import GetEventSummariesResponse
from .get_segment_integration_status_response import GetSegmentIntegrationStatusResponse
from .list_events_params import ListEventsParams
+from .list_events_request_event_types_item import ListEventsRequestEventTypesItem
from .list_events_response import ListEventsResponse
+from .list_events_response_params_event_types_item import ListEventsResponseParamsEventTypesItem
__all__ = [
"CreateEventBatchResponse",
@@ -19,5 +21,7 @@
"GetEventSummariesResponse",
"GetSegmentIntegrationStatusResponse",
"ListEventsParams",
+ "ListEventsRequestEventTypesItem",
"ListEventsResponse",
+ "ListEventsResponseParamsEventTypesItem",
]
diff --git a/src/schematic/events/types/list_events_params.py b/src/schematic/events/types/list_events_params.py
index 421fe0d..75fa716 100644
--- a/src/schematic/events/types/list_events_params.py
+++ b/src/schematic/events/types/list_events_params.py
@@ -4,6 +4,7 @@
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .list_events_response_params_event_types_item import ListEventsResponseParamsEventTypesItem
class ListEventsParams(UniversalBaseModel):
@@ -13,7 +14,7 @@ class ListEventsParams(UniversalBaseModel):
company_id: typing.Optional[str] = None
event_subtype: typing.Optional[str] = None
- event_types: typing.Optional[typing.List[str]] = None
+ event_types: typing.Optional[typing.List[ListEventsResponseParamsEventTypesItem]] = None
flag_id: typing.Optional[str] = None
limit: typing.Optional[int] = pydantic.Field(default=None)
"""
diff --git a/src/schematic/events/types/list_events_request_event_types_item.py b/src/schematic/events/types/list_events_request_event_types_item.py
new file mode 100644
index 0000000..bba5a92
--- /dev/null
+++ b/src/schematic/events/types/list_events_request_event_types_item.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ListEventsRequestEventTypesItem = typing.Union[typing.Literal["identify", "track", "flag_check"], typing.Any]
diff --git a/src/schematic/events/types/list_events_response_params_event_types_item.py b/src/schematic/events/types/list_events_response_params_event_types_item.py
new file mode 100644
index 0000000..d93a87c
--- /dev/null
+++ b/src/schematic/events/types/list_events_response_params_event_types_item.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ListEventsResponseParamsEventTypesItem = typing.Union[typing.Literal["identify", "track", "flag_check"], typing.Any]
diff --git a/src/schematic/features/__init__.py b/src/schematic/features/__init__.py
index 8d63c2a..91dcf28 100644
--- a/src/schematic/features/__init__.py
+++ b/src/schematic/features/__init__.py
@@ -12,6 +12,7 @@
CountFlagsParams,
CountFlagsResponse,
CreateFeatureRequestBodyFeatureType,
+ CreateFeatureRequestBodyLifecyclePhase,
CreateFeatureResponse,
CreateFlagResponse,
DeleteFeatureResponse,
@@ -25,6 +26,7 @@
ListFlagsParams,
ListFlagsResponse,
UpdateFeatureRequestBodyFeatureType,
+ UpdateFeatureRequestBodyLifecyclePhase,
UpdateFeatureResponse,
UpdateFlagResponse,
UpdateFlagRulesResponse,
@@ -40,6 +42,7 @@
"CountFlagsParams",
"CountFlagsResponse",
"CreateFeatureRequestBodyFeatureType",
+ "CreateFeatureRequestBodyLifecyclePhase",
"CreateFeatureResponse",
"CreateFlagResponse",
"DeleteFeatureResponse",
@@ -53,6 +56,7 @@
"ListFlagsParams",
"ListFlagsResponse",
"UpdateFeatureRequestBodyFeatureType",
+ "UpdateFeatureRequestBodyLifecyclePhase",
"UpdateFeatureResponse",
"UpdateFlagResponse",
"UpdateFlagRulesResponse",
diff --git a/src/schematic/features/client.py b/src/schematic/features/client.py
index 117bea2..343960c 100644
--- a/src/schematic/features/client.py
+++ b/src/schematic/features/client.py
@@ -16,6 +16,7 @@
from .types.count_features_response import CountFeaturesResponse
from .types.count_flags_response import CountFlagsResponse
from .types.create_feature_request_body_feature_type import CreateFeatureRequestBodyFeatureType
+from .types.create_feature_request_body_lifecycle_phase import CreateFeatureRequestBodyLifecyclePhase
from .types.create_feature_response import CreateFeatureResponse
from .types.create_flag_response import CreateFlagResponse
from .types.delete_feature_response import DeleteFeatureResponse
@@ -27,6 +28,7 @@
from .types.list_features_response import ListFeaturesResponse
from .types.list_flags_response import ListFlagsResponse
from .types.update_feature_request_body_feature_type import UpdateFeatureRequestBodyFeatureType
+from .types.update_feature_request_body_lifecycle_phase import UpdateFeatureRequestBodyLifecyclePhase
from .types.update_feature_response import UpdateFeatureResponse
from .types.update_flag_response import UpdateFlagResponse
from .types.update_flag_rules_response import UpdateFlagRulesResponse
@@ -85,11 +87,35 @@ def count_audience_companies(
Examples
--------
- from schematic import Schematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.count_audience_companies(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ from schematic import (
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ Schematic,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.count_audience_companies(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
"""
_response = self._raw_client.count_audience_companies(
condition_groups=condition_groups,
@@ -136,11 +162,35 @@ def count_audience_users(
Examples
--------
- from schematic import Schematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.count_audience_users(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ from schematic import (
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ Schematic,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.count_audience_users(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
"""
_response = self._raw_client.count_audience_users(
condition_groups=condition_groups,
@@ -187,11 +237,35 @@ def list_audience_companies(
Examples
--------
- from schematic import Schematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.list_audience_companies(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ from schematic import (
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ Schematic,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.list_audience_companies(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
"""
_response = self._raw_client.list_audience_companies(
condition_groups=condition_groups,
@@ -238,11 +312,35 @@ def list_audience_users(
Examples
--------
- from schematic import Schematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.list_audience_users(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ from schematic import (
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ Schematic,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.list_audience_users(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
"""
_response = self._raw_client.list_audience_users(
condition_groups=condition_groups,
@@ -295,7 +393,10 @@ def list_features(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.features.list_features()
"""
_response = self._raw_client.list_features(
@@ -318,7 +419,7 @@ def create_feature(
event_subtype: typing.Optional[str] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[CreateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
singular_name: typing.Optional[str] = OMIT,
@@ -340,7 +441,7 @@ def create_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[CreateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -361,8 +462,15 @@ def create_feature(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.create_feature(description='description', feature_type="boolean", name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.create_feature(
+ description="description",
+ feature_type="boolean",
+ name="name",
+ )
"""
_response = self._raw_client.create_feature(
description=description,
@@ -400,8 +508,13 @@ def get_feature(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.get_feature(feature_id='feature_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.get_feature(
+ feature_id="feature_id",
+ )
"""
_response = self._raw_client.get_feature(feature_id, request_options=request_options)
return _response.data
@@ -415,7 +528,7 @@ def update_feature(
feature_type: typing.Optional[UpdateFeatureRequestBodyFeatureType] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[UpdateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
name: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
@@ -439,7 +552,7 @@ def update_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[UpdateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -462,8 +575,13 @@ def update_feature(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.update_feature(feature_id='feature_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.update_feature(
+ feature_id="feature_id",
+ )
"""
_response = self._raw_client.update_feature(
feature_id,
@@ -502,8 +620,13 @@ def delete_feature(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.delete_feature(feature_id='feature_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.delete_feature(
+ feature_id="feature_id",
+ )
"""
_response = self._raw_client.delete_feature(feature_id, request_options=request_options)
return _response.data
@@ -549,7 +672,10 @@ def count_features(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.features.count_features()
"""
_response = self._raw_client.count_features(
@@ -599,7 +725,10 @@ def list_flags(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.features.list_flags()
"""
_response = self._raw_client.list_flags(
@@ -612,7 +741,6 @@ def create_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -626,8 +754,6 @@ def create_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -647,13 +773,20 @@ def create_flag(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.create_flag(default_value=True, description='description', flag_type='flag_type', key='key', name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.create_flag(
+ default_value=True,
+ description="description",
+ key="key",
+ name="name",
+ )
"""
_response = self._raw_client.create_flag(
default_value=default_value,
description=description,
- flag_type=flag_type,
key=key,
name=name,
feature_id=feature_id,
@@ -680,8 +813,13 @@ def get_flag(self, flag_id: str, *, request_options: typing.Optional[RequestOpti
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.get_flag(flag_id='flag_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.get_flag(
+ flag_id="flag_id",
+ )
"""
_response = self._raw_client.get_flag(flag_id, request_options=request_options)
return _response.data
@@ -692,7 +830,6 @@ def update_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -709,8 +846,6 @@ def update_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -730,14 +865,22 @@ def update_flag(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.update_flag(flag_id='flag_id', default_value=True, description='description', flag_type='flag_type', key='key', name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.update_flag(
+ flag_id="flag_id",
+ default_value=True,
+ description="description",
+ key="key",
+ name="name",
+ )
"""
_response = self._raw_client.update_flag(
flag_id,
default_value=default_value,
description=description,
- flag_type=flag_type,
key=key,
name=name,
feature_id=feature_id,
@@ -766,8 +909,13 @@ def delete_flag(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.delete_flag(flag_id='flag_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.delete_flag(
+ flag_id="flag_id",
+ )
"""
_response = self._raw_client.delete_flag(flag_id, request_options=request_options)
return _response.data
@@ -797,12 +945,44 @@ def update_flag_rules(
Examples
--------
- from schematic import Schematic
- from schematic import CreateOrUpdateRuleRequestBody
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.update_flag_rules(flag_id='flag_id', rules=[CreateOrUpdateRuleRequestBody(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], name='name', priority=1, value=True, )], )
+ from schematic import (
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ CreateOrUpdateRuleRequestBody,
+ Schematic,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.update_flag_rules(
+ flag_id="flag_id",
+ rules=[
+ CreateOrUpdateRuleRequestBody(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ name="name",
+ priority=1,
+ value=True,
+ )
+ ],
+ )
"""
_response = self._raw_client.update_flag_rules(flag_id, rules=rules, request_options=request_options)
return _response.data
@@ -836,8 +1016,13 @@ def check_flag(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.features.check_flag(key='key', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.features.check_flag(
+ key="key",
+ )
"""
_response = self._raw_client.check_flag(key, company=company, user=user, request_options=request_options)
return _response.data
@@ -867,7 +1052,10 @@ def check_flags(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.features.check_flags()
"""
_response = self._raw_client.check_flags(company=company, user=user, request_options=request_options)
@@ -909,7 +1097,10 @@ def count_flags(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.features.count_flags()
"""
_response = self._raw_client.count_flags(
@@ -968,13 +1159,42 @@ async def count_audience_companies(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.count_audience_companies(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ await client.features.count_audience_companies(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_audience_companies(
@@ -1022,13 +1242,42 @@ async def count_audience_users(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.count_audience_users(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ await client.features.count_audience_users(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_audience_users(
@@ -1076,13 +1325,42 @@ async def list_audience_companies(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.list_audience_companies(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ await client.features.list_audience_companies(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_audience_companies(
@@ -1130,13 +1408,42 @@ async def list_audience_users(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.list_audience_users(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ await client.features.list_audience_users(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_audience_users(
@@ -1189,11 +1496,19 @@ async def list_features(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.features.list_features()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_features(
@@ -1216,7 +1531,7 @@ async def create_feature(
event_subtype: typing.Optional[str] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[CreateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
singular_name: typing.Optional[str] = OMIT,
@@ -1238,7 +1553,7 @@ async def create_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[CreateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -1258,11 +1573,23 @@ async def create_feature(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.create_feature(description='description', feature_type="boolean", name='name', )
+ await client.features.create_feature(
+ description="description",
+ feature_type="boolean",
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_feature(
@@ -1300,11 +1627,21 @@ async def get_feature(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.get_feature(feature_id='feature_id', )
+ await client.features.get_feature(
+ feature_id="feature_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_feature(feature_id, request_options=request_options)
@@ -1319,7 +1656,7 @@ async def update_feature(
feature_type: typing.Optional[UpdateFeatureRequestBodyFeatureType] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[UpdateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
name: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
@@ -1343,7 +1680,7 @@ async def update_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[UpdateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -1365,11 +1702,21 @@ async def update_feature(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.update_feature(feature_id='feature_id', )
+ await client.features.update_feature(
+ feature_id="feature_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_feature(
@@ -1408,11 +1755,21 @@ async def delete_feature(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.delete_feature(feature_id='feature_id', )
+ await client.features.delete_feature(
+ feature_id="feature_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_feature(feature_id, request_options=request_options)
@@ -1458,11 +1815,19 @@ async def count_features(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.features.count_features()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_features(
@@ -1511,11 +1876,19 @@ async def list_flags(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.features.list_flags()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_flags(
@@ -1528,7 +1901,6 @@ async def create_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -1542,8 +1914,6 @@ async def create_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -1562,17 +1932,29 @@ async def create_flag(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.create_flag(default_value=True, description='description', flag_type='flag_type', key='key', name='name', )
+ await client.features.create_flag(
+ default_value=True,
+ description="description",
+ key="key",
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_flag(
default_value=default_value,
description=description,
- flag_type=flag_type,
key=key,
name=name,
feature_id=feature_id,
@@ -1600,11 +1982,21 @@ async def get_flag(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.get_flag(flag_id='flag_id', )
+ await client.features.get_flag(
+ flag_id="flag_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_flag(flag_id, request_options=request_options)
@@ -1616,7 +2008,6 @@ async def update_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -1633,8 +2024,6 @@ async def update_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -1653,18 +2042,31 @@ async def update_flag(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.update_flag(flag_id='flag_id', default_value=True, description='description', flag_type='flag_type', key='key', name='name', )
+ await client.features.update_flag(
+ flag_id="flag_id",
+ default_value=True,
+ description="description",
+ key="key",
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_flag(
flag_id,
default_value=default_value,
description=description,
- flag_type=flag_type,
key=key,
name=name,
feature_id=feature_id,
@@ -1692,11 +2094,21 @@ async def delete_flag(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.delete_flag(flag_id='flag_id', )
+ await client.features.delete_flag(
+ flag_id="flag_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_flag(flag_id, request_options=request_options)
@@ -1727,14 +2139,51 @@ async def update_flag_rules(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateOrUpdateRuleRequestBody
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ CreateOrUpdateRuleRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.update_flag_rules(flag_id='flag_id', rules=[CreateOrUpdateRuleRequestBody(condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], name='name', priority=1, value=True, )], )
+ await client.features.update_flag_rules(
+ flag_id="flag_id",
+ rules=[
+ CreateOrUpdateRuleRequestBody(
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ name="name",
+ priority=1,
+ value=True,
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_flag_rules(flag_id, rules=rules, request_options=request_options)
@@ -1768,11 +2217,21 @@ async def check_flag(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.features.check_flag(key='key', )
+ await client.features.check_flag(
+ key="key",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.check_flag(key, company=company, user=user, request_options=request_options)
@@ -1802,11 +2261,19 @@ async def check_flags(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.features.check_flags()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.check_flags(company=company, user=user, request_options=request_options)
@@ -1847,11 +2314,19 @@ async def count_flags(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.features.count_flags()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_flags(
diff --git a/src/schematic/features/raw_client.py b/src/schematic/features/raw_client.py
index 029d278..aeefbbb 100644
--- a/src/schematic/features/raw_client.py
+++ b/src/schematic/features/raw_client.py
@@ -27,6 +27,7 @@
from .types.count_features_response import CountFeaturesResponse
from .types.count_flags_response import CountFlagsResponse
from .types.create_feature_request_body_feature_type import CreateFeatureRequestBodyFeatureType
+from .types.create_feature_request_body_lifecycle_phase import CreateFeatureRequestBodyLifecyclePhase
from .types.create_feature_response import CreateFeatureResponse
from .types.create_flag_response import CreateFlagResponse
from .types.delete_feature_response import DeleteFeatureResponse
@@ -38,6 +39,7 @@
from .types.list_features_response import ListFeaturesResponse
from .types.list_flags_response import ListFlagsResponse
from .types.update_feature_request_body_feature_type import UpdateFeatureRequestBodyFeatureType
+from .types.update_feature_request_body_lifecycle_phase import UpdateFeatureRequestBodyLifecyclePhase
from .types.update_feature_response import UpdateFeatureResponse
from .types.update_flag_response import UpdateFlagResponse
from .types.update_flag_rules_response import UpdateFlagRulesResponse
@@ -119,51 +121,66 @@ def count_audience_companies(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_audience_users(
@@ -235,51 +252,66 @@ def count_audience_users(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_audience_companies(
@@ -351,51 +383,66 @@ def list_audience_companies(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_audience_users(
@@ -467,51 +514,66 @@ def list_audience_users(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_features(
@@ -577,51 +639,66 @@ def list_features(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_feature(
@@ -633,7 +710,7 @@ def create_feature(
event_subtype: typing.Optional[str] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[CreateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
singular_name: typing.Optional[str] = OMIT,
@@ -655,7 +732,7 @@ def create_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[CreateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -709,51 +786,66 @@ def create_feature(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_feature(
@@ -790,51 +882,55 @@ def get_feature(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_feature(
@@ -846,7 +942,7 @@ def update_feature(
feature_type: typing.Optional[UpdateFeatureRequestBodyFeatureType] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[UpdateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
name: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
@@ -870,7 +966,7 @@ def update_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[UpdateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -926,61 +1022,66 @@ def update_feature(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_feature(
@@ -1017,51 +1118,66 @@ def delete_feature(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_features(
@@ -1127,51 +1243,66 @@ def count_features(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_flags(
@@ -1231,51 +1362,66 @@ def list_flags(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_flag(
@@ -1283,7 +1429,6 @@ def create_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -1297,8 +1442,6 @@ def create_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -1322,10 +1465,10 @@ def create_flag(
"default_value": default_value,
"description": description,
"feature_id": feature_id,
- "flag_type": flag_type,
"key": key,
"maintainer_id": maintainer_id,
"name": name,
+ "flag_type": "boolean",
},
headers={
"content-type": "application/json",
@@ -1345,51 +1488,66 @@ def create_flag(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_flag(
@@ -1426,51 +1584,55 @@ def get_flag(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_flag(
@@ -1479,7 +1641,6 @@ def update_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -1496,8 +1657,6 @@ def update_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -1521,10 +1680,10 @@ def update_flag(
"default_value": default_value,
"description": description,
"feature_id": feature_id,
- "flag_type": flag_type,
"key": key,
"maintainer_id": maintainer_id,
"name": name,
+ "flag_type": "boolean",
},
headers={
"content-type": "application/json",
@@ -1544,61 +1703,66 @@ def update_flag(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_flag(
@@ -1635,51 +1799,66 @@ def delete_flag(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_flag_rules(
@@ -1731,61 +1910,66 @@ def update_flag_rules(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def check_flag(
@@ -1839,51 +2023,66 @@ def check_flag(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def check_flags(
@@ -1933,51 +2132,66 @@ def check_flags(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_flags(
@@ -2037,51 +2251,66 @@ def count_flags(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -2158,51 +2387,66 @@ async def count_audience_companies(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_audience_users(
@@ -2274,51 +2518,66 @@ async def count_audience_users(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_audience_companies(
@@ -2390,51 +2649,66 @@ async def list_audience_companies(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_audience_users(
@@ -2506,51 +2780,66 @@ async def list_audience_users(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_features(
@@ -2616,51 +2905,66 @@ async def list_features(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_feature(
@@ -2672,7 +2976,7 @@ async def create_feature(
event_subtype: typing.Optional[str] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[CreateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
singular_name: typing.Optional[str] = OMIT,
@@ -2694,7 +2998,7 @@ async def create_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[CreateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -2748,51 +3052,66 @@ async def create_feature(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_feature(
@@ -2829,51 +3148,55 @@ async def get_feature(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_feature(
@@ -2885,7 +3208,7 @@ async def update_feature(
feature_type: typing.Optional[UpdateFeatureRequestBodyFeatureType] = OMIT,
flag: typing.Optional[CreateOrUpdateFlagRequestBody] = OMIT,
icon: typing.Optional[str] = OMIT,
- lifecycle_phase: typing.Optional[str] = OMIT,
+ lifecycle_phase: typing.Optional[UpdateFeatureRequestBodyLifecyclePhase] = OMIT,
maintainer_id: typing.Optional[str] = OMIT,
name: typing.Optional[str] = OMIT,
plural_name: typing.Optional[str] = OMIT,
@@ -2909,7 +3232,7 @@ async def update_feature(
icon : typing.Optional[str]
- lifecycle_phase : typing.Optional[str]
+ lifecycle_phase : typing.Optional[UpdateFeatureRequestBodyLifecyclePhase]
maintainer_id : typing.Optional[str]
@@ -2965,61 +3288,66 @@ async def update_feature(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_feature(
@@ -3056,51 +3384,66 @@ async def delete_feature(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_features(
@@ -3166,51 +3509,66 @@ async def count_features(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_flags(
@@ -3270,51 +3628,66 @@ async def list_flags(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_flag(
@@ -3322,7 +3695,6 @@ async def create_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -3336,8 +3708,6 @@ async def create_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -3361,10 +3731,10 @@ async def create_flag(
"default_value": default_value,
"description": description,
"feature_id": feature_id,
- "flag_type": flag_type,
"key": key,
"maintainer_id": maintainer_id,
"name": name,
+ "flag_type": "boolean",
},
headers={
"content-type": "application/json",
@@ -3384,51 +3754,66 @@ async def create_flag(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_flag(
@@ -3465,51 +3850,55 @@ async def get_flag(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_flag(
@@ -3518,7 +3907,6 @@ async def update_flag(
*,
default_value: bool,
description: str,
- flag_type: str,
key: str,
name: str,
feature_id: typing.Optional[str] = OMIT,
@@ -3535,8 +3923,6 @@ async def update_flag(
description : str
- flag_type : str
-
key : str
name : str
@@ -3560,10 +3946,10 @@ async def update_flag(
"default_value": default_value,
"description": description,
"feature_id": feature_id,
- "flag_type": flag_type,
"key": key,
"maintainer_id": maintainer_id,
"name": name,
+ "flag_type": "boolean",
},
headers={
"content-type": "application/json",
@@ -3583,61 +3969,66 @@ async def update_flag(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_flag(
@@ -3674,51 +4065,66 @@ async def delete_flag(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_flag_rules(
@@ -3770,61 +4176,66 @@ async def update_flag_rules(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def check_flag(
@@ -3878,51 +4289,66 @@ async def check_flag(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def check_flags(
@@ -3972,51 +4398,66 @@ async def check_flags(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_flags(
@@ -4076,49 +4517,64 @@ async def count_flags(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/features/types/__init__.py b/src/schematic/features/types/__init__.py
index 89df1f4..29fa2a8 100644
--- a/src/schematic/features/types/__init__.py
+++ b/src/schematic/features/types/__init__.py
@@ -11,6 +11,7 @@
from .count_flags_params import CountFlagsParams
from .count_flags_response import CountFlagsResponse
from .create_feature_request_body_feature_type import CreateFeatureRequestBodyFeatureType
+from .create_feature_request_body_lifecycle_phase import CreateFeatureRequestBodyLifecyclePhase
from .create_feature_response import CreateFeatureResponse
from .create_flag_response import CreateFlagResponse
from .delete_feature_response import DeleteFeatureResponse
@@ -24,6 +25,7 @@
from .list_flags_params import ListFlagsParams
from .list_flags_response import ListFlagsResponse
from .update_feature_request_body_feature_type import UpdateFeatureRequestBodyFeatureType
+from .update_feature_request_body_lifecycle_phase import UpdateFeatureRequestBodyLifecyclePhase
from .update_feature_response import UpdateFeatureResponse
from .update_flag_response import UpdateFlagResponse
from .update_flag_rules_response import UpdateFlagRulesResponse
@@ -38,6 +40,7 @@
"CountFlagsParams",
"CountFlagsResponse",
"CreateFeatureRequestBodyFeatureType",
+ "CreateFeatureRequestBodyLifecyclePhase",
"CreateFeatureResponse",
"CreateFlagResponse",
"DeleteFeatureResponse",
@@ -51,6 +54,7 @@
"ListFlagsParams",
"ListFlagsResponse",
"UpdateFeatureRequestBodyFeatureType",
+ "UpdateFeatureRequestBodyLifecyclePhase",
"UpdateFeatureResponse",
"UpdateFlagResponse",
"UpdateFlagRulesResponse",
diff --git a/src/schematic/features/types/create_feature_request_body_lifecycle_phase.py b/src/schematic/features/types/create_feature_request_body_lifecycle_phase.py
new file mode 100644
index 0000000..7ed512a
--- /dev/null
+++ b/src/schematic/features/types/create_feature_request_body_lifecycle_phase.py
@@ -0,0 +1,8 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CreateFeatureRequestBodyLifecyclePhase = typing.Union[
+ typing.Literal["add_on", "alpha", "beta", "deprecated", "ga", "in_plan", "inactive", "internal_testing", "legacy"],
+ typing.Any,
+]
diff --git a/src/schematic/features/types/update_feature_request_body_lifecycle_phase.py b/src/schematic/features/types/update_feature_request_body_lifecycle_phase.py
new file mode 100644
index 0000000..2c56e00
--- /dev/null
+++ b/src/schematic/features/types/update_feature_request_body_lifecycle_phase.py
@@ -0,0 +1,8 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+UpdateFeatureRequestBodyLifecyclePhase = typing.Union[
+ typing.Literal["add_on", "alpha", "beta", "deprecated", "ga", "in_plan", "inactive", "internal_testing", "legacy"],
+ typing.Any,
+]
diff --git a/src/schematic/plangroups/client.py b/src/schematic/plangroups/client.py
index 22fc094..203cb7a 100644
--- a/src/schematic/plangroups/client.py
+++ b/src/schematic/plangroups/client.py
@@ -45,7 +45,10 @@ def get_plan_group(self, *, request_options: typing.Optional[RequestOptions] = N
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.plangroups.get_plan_group()
"""
_response = self._raw_client.get_plan_group(request_options=request_options)
@@ -90,10 +93,19 @@ def create_plan_group(
Examples
--------
- from schematic import Schematic
- from schematic import OrderedPlansInGroup
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plangroups.create_plan_group(add_on_ids=['add_on_ids'], ordered_plans=[OrderedPlansInGroup(plan_id='plan_id', )], )
+ from schematic import OrderedPlansInGroup, Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plangroups.create_plan_group(
+ add_on_ids=["add_on_ids"],
+ ordered_plans=[
+ OrderedPlansInGroup(
+ plan_id="plan_id",
+ )
+ ],
+ )
"""
_response = self._raw_client.create_plan_group(
add_on_ids=add_on_ids,
@@ -150,10 +162,20 @@ def update_plan_group(
Examples
--------
- from schematic import Schematic
- from schematic import OrderedPlansInGroup
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plangroups.update_plan_group(plan_group_id='plan_group_id', add_on_ids=['add_on_ids'], ordered_plans=[OrderedPlansInGroup(plan_id='plan_id', )], )
+ from schematic import OrderedPlansInGroup, Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plangroups.update_plan_group(
+ plan_group_id="plan_group_id",
+ add_on_ids=["add_on_ids"],
+ ordered_plans=[
+ OrderedPlansInGroup(
+ plan_id="plan_id",
+ )
+ ],
+ )
"""
_response = self._raw_client.update_plan_group(
plan_group_id,
@@ -198,11 +220,19 @@ async def get_plan_group(self, *, request_options: typing.Optional[RequestOption
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.plangroups.get_plan_group()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_plan_group(request_options=request_options)
@@ -247,12 +277,26 @@ async def create_plan_group(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import OrderedPlansInGroup
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic, OrderedPlansInGroup
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plangroups.create_plan_group(add_on_ids=['add_on_ids'], ordered_plans=[OrderedPlansInGroup(plan_id='plan_id', )], )
+ await client.plangroups.create_plan_group(
+ add_on_ids=["add_on_ids"],
+ ordered_plans=[
+ OrderedPlansInGroup(
+ plan_id="plan_id",
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_plan_group(
@@ -310,12 +354,27 @@ async def update_plan_group(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import OrderedPlansInGroup
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic, OrderedPlansInGroup
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plangroups.update_plan_group(plan_group_id='plan_group_id', add_on_ids=['add_on_ids'], ordered_plans=[OrderedPlansInGroup(plan_id='plan_id', )], )
+ await client.plangroups.update_plan_group(
+ plan_group_id="plan_group_id",
+ add_on_ids=["add_on_ids"],
+ ordered_plans=[
+ OrderedPlansInGroup(
+ plan_id="plan_id",
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_plan_group(
diff --git a/src/schematic/plangroups/raw_client.py b/src/schematic/plangroups/raw_client.py
index 3c0b04b..e0941c5 100644
--- a/src/schematic/plangroups/raw_client.py
+++ b/src/schematic/plangroups/raw_client.py
@@ -61,51 +61,55 @@ def get_plan_group(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_plan_group(
@@ -179,51 +183,66 @@ def create_plan_group(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_plan_group(
@@ -301,61 +320,66 @@ def update_plan_group(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -394,51 +418,55 @@ async def get_plan_group(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_plan_group(
@@ -512,51 +540,66 @@ async def create_plan_group(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_plan_group(
@@ -634,59 +677,64 @@ async def update_plan_group(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/plans/__init__.py b/src/schematic/plans/__init__.py
index 41d0eb9..5af1e8c 100644
--- a/src/schematic/plans/__init__.py
+++ b/src/schematic/plans/__init__.py
@@ -29,6 +29,7 @@
UpdatePlanResponse,
UpdatePlanTraitResponse,
UpsertBillingProductPlanResponse,
+ UpsertBillingProductRequestBodyChargeType,
)
__all__ = [
@@ -58,4 +59,5 @@
"UpdatePlanResponse",
"UpdatePlanTraitResponse",
"UpsertBillingProductPlanResponse",
+ "UpsertBillingProductRequestBodyChargeType",
]
diff --git a/src/schematic/plans/client.py b/src/schematic/plans/client.py
index 5eae0a2..5d645b5 100644
--- a/src/schematic/plans/client.py
+++ b/src/schematic/plans/client.py
@@ -27,6 +27,7 @@
from .types.update_plan_response import UpdatePlanResponse
from .types.update_plan_trait_response import UpdatePlanTraitResponse
from .types.upsert_billing_product_plan_response import UpsertBillingProductPlanResponse
+from .types.upsert_billing_product_request_body_charge_type import UpsertBillingProductRequestBodyChargeType
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
@@ -76,8 +77,14 @@ def update_company_plans(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.update_company_plans(company_plan_id='company_plan_id', add_on_ids=['add_on_ids'], )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.update_company_plans(
+ company_plan_id="company_plan_id",
+ add_on_ids=["add_on_ids"],
+ )
"""
_response = self._raw_client.update_company_plans(
company_plan_id, add_on_ids=add_on_ids, base_plan_id=base_plan_id, request_options=request_options
@@ -104,8 +111,13 @@ def get_audience(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.get_audience(plan_audience_id='plan_audience_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.get_audience(
+ plan_audience_id="plan_audience_id",
+ )
"""
_response = self._raw_client.get_audience(plan_audience_id, request_options=request_options)
return _response.data
@@ -138,11 +150,36 @@ def update_audience(
Examples
--------
- from schematic import Schematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.update_audience(plan_audience_id='plan_audience_id', condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ from schematic import (
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ Schematic,
+ )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.update_audience(
+ plan_audience_id="plan_audience_id",
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
"""
_response = self._raw_client.update_audience(
plan_audience_id, condition_groups=condition_groups, conditions=conditions, request_options=request_options
@@ -169,8 +206,13 @@ def delete_audience(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.delete_audience(plan_audience_id='plan_audience_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.delete_audience(
+ plan_audience_id="plan_audience_id",
+ )
"""
_response = self._raw_client.delete_audience(plan_audience_id, request_options=request_options)
return _response.data
@@ -211,7 +253,10 @@ def list_plan_traits(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.plans.list_plan_traits()
"""
_response = self._raw_client.list_plan_traits(
@@ -242,8 +287,15 @@ def create_plan_trait(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.create_plan_trait(plan_id='plan_id', trait_id='trait_id', trait_value='trait_value', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.create_plan_trait(
+ plan_id="plan_id",
+ trait_id="trait_id",
+ trait_value="trait_value",
+ )
"""
_response = self._raw_client.create_plan_trait(
plan_id=plan_id, trait_id=trait_id, trait_value=trait_value, request_options=request_options
@@ -270,8 +322,13 @@ def get_plan_trait(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.get_plan_trait(plan_trait_id='plan_trait_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.get_plan_trait(
+ plan_trait_id="plan_trait_id",
+ )
"""
_response = self._raw_client.get_plan_trait(plan_trait_id, request_options=request_options)
return _response.data
@@ -305,8 +362,15 @@ def update_plan_trait(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.update_plan_trait(plan_trait_id='plan_trait_id', plan_id='plan_id', trait_value='trait_value', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.update_plan_trait(
+ plan_trait_id="plan_trait_id",
+ plan_id="plan_id",
+ trait_value="trait_value",
+ )
"""
_response = self._raw_client.update_plan_trait(
plan_trait_id, plan_id=plan_id, trait_value=trait_value, request_options=request_options
@@ -333,8 +397,13 @@ def delete_plan_trait(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.delete_plan_trait(plan_trait_id='plan_trait_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.delete_plan_trait(
+ plan_trait_id="plan_trait_id",
+ )
"""
_response = self._raw_client.delete_plan_trait(plan_trait_id, request_options=request_options)
return _response.data
@@ -375,7 +444,10 @@ def count_plan_traits(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.plans.count_plan_traits()
"""
_response = self._raw_client.count_plan_traits(
@@ -439,7 +511,10 @@ def list_plans(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.plans.list_plans()
"""
_response = self._raw_client.list_plans(
@@ -488,8 +563,15 @@ def create_plan(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.create_plan(description='description', name='name', plan_type="plan", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.create_plan(
+ description="description",
+ name="name",
+ plan_type="plan",
+ )
"""
_response = self._raw_client.create_plan(
description=description, name=name, plan_type=plan_type, icon=icon, request_options=request_options
@@ -514,8 +596,13 @@ def get_plan(self, plan_id: str, *, request_options: typing.Optional[RequestOpti
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.get_plan(plan_id='plan_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.get_plan(
+ plan_id="plan_id",
+ )
"""
_response = self._raw_client.get_plan(plan_id, request_options=request_options)
return _response.data
@@ -552,8 +639,14 @@ def update_plan(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.update_plan(plan_id='plan_id', name='name', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.update_plan(
+ plan_id="plan_id",
+ name="name",
+ )
"""
_response = self._raw_client.update_plan(
plan_id, name=name, description=description, icon=icon, request_options=request_options
@@ -580,8 +673,13 @@ def delete_plan(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.delete_plan(plan_id='plan_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.delete_plan(
+ plan_id="plan_id",
+ )
"""
_response = self._raw_client.delete_plan(plan_id, request_options=request_options)
return _response.data
@@ -590,13 +688,16 @@ def upsert_billing_product_plan(
self,
plan_id: str,
*,
- is_free_plan: bool,
+ charge_type: UpsertBillingProductRequestBodyChargeType,
is_trialable: bool,
billing_product_id: typing.Optional[str] = OMIT,
- charge_type: typing.Optional[str] = OMIT,
+ currency: typing.Optional[str] = OMIT,
+ monthly_price: typing.Optional[int] = OMIT,
monthly_price_id: typing.Optional[str] = OMIT,
+ one_time_price: typing.Optional[int] = OMIT,
one_time_price_id: typing.Optional[str] = OMIT,
trial_days: typing.Optional[int] = OMIT,
+ yearly_price: typing.Optional[int] = OMIT,
yearly_price_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> UpsertBillingProductPlanResponse:
@@ -606,20 +707,26 @@ def upsert_billing_product_plan(
plan_id : str
plan_id
- is_free_plan : bool
+ charge_type : UpsertBillingProductRequestBodyChargeType
is_trialable : bool
billing_product_id : typing.Optional[str]
- charge_type : typing.Optional[str]
+ currency : typing.Optional[str]
+
+ monthly_price : typing.Optional[int]
monthly_price_id : typing.Optional[str]
+ one_time_price : typing.Optional[int]
+
one_time_price_id : typing.Optional[str]
trial_days : typing.Optional[int]
+ yearly_price : typing.Optional[int]
+
yearly_price_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
@@ -633,18 +740,28 @@ def upsert_billing_product_plan(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.plans.upsert_billing_product_plan(plan_id='plan_id', is_free_plan=True, is_trialable=True, )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.plans.upsert_billing_product_plan(
+ plan_id="plan_id",
+ charge_type="one_time",
+ is_trialable=True,
+ )
"""
_response = self._raw_client.upsert_billing_product_plan(
plan_id,
- is_free_plan=is_free_plan,
+ charge_type=charge_type,
is_trialable=is_trialable,
billing_product_id=billing_product_id,
- charge_type=charge_type,
+ currency=currency,
+ monthly_price=monthly_price,
monthly_price_id=monthly_price_id,
+ one_time_price=one_time_price,
one_time_price_id=one_time_price_id,
trial_days=trial_days,
+ yearly_price=yearly_price,
yearly_price_id=yearly_price_id,
request_options=request_options,
)
@@ -706,7 +823,10 @@ def count_plans(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.plans.count_plans()
"""
_response = self._raw_client.count_plans(
@@ -768,11 +888,22 @@ async def update_company_plans(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.update_company_plans(company_plan_id='company_plan_id', add_on_ids=['add_on_ids'], )
+ await client.plans.update_company_plans(
+ company_plan_id="company_plan_id",
+ add_on_ids=["add_on_ids"],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_company_plans(
@@ -799,11 +930,21 @@ async def get_audience(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.get_audience(plan_audience_id='plan_audience_id', )
+ await client.plans.get_audience(
+ plan_audience_id="plan_audience_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_audience(plan_audience_id, request_options=request_options)
@@ -837,13 +978,43 @@ async def update_audience(
Examples
--------
- from schematic import AsyncSchematic
- from schematic import CreateOrUpdateConditionGroupRequestBody
- from schematic import CreateOrUpdateConditionRequestBody
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import (
+ AsyncSchematic,
+ CreateOrUpdateConditionGroupRequestBody,
+ CreateOrUpdateConditionRequestBody,
+ )
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.update_audience(plan_audience_id='plan_audience_id', condition_groups=[CreateOrUpdateConditionGroupRequestBody(conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )], conditions=[CreateOrUpdateConditionRequestBody(condition_type="company", operator="eq", resource_ids=['resource_ids'], )], )
+ await client.plans.update_audience(
+ plan_audience_id="plan_audience_id",
+ condition_groups=[
+ CreateOrUpdateConditionGroupRequestBody(
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+ ],
+ conditions=[
+ CreateOrUpdateConditionRequestBody(
+ condition_type="company",
+ operator="eq",
+ resource_ids=["resource_ids"],
+ )
+ ],
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_audience(
@@ -870,11 +1041,21 @@ async def delete_audience(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.delete_audience(plan_audience_id='plan_audience_id', )
+ await client.plans.delete_audience(
+ plan_audience_id="plan_audience_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_audience(plan_audience_id, request_options=request_options)
@@ -915,11 +1096,19 @@ async def list_plan_traits(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.plans.list_plan_traits()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_plan_traits(
@@ -949,11 +1138,23 @@ async def create_plan_trait(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.create_plan_trait(plan_id='plan_id', trait_id='trait_id', trait_value='trait_value', )
+ await client.plans.create_plan_trait(
+ plan_id="plan_id",
+ trait_id="trait_id",
+ trait_value="trait_value",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_plan_trait(
@@ -980,11 +1181,21 @@ async def get_plan_trait(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.get_plan_trait(plan_trait_id='plan_trait_id', )
+ await client.plans.get_plan_trait(
+ plan_trait_id="plan_trait_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_plan_trait(plan_trait_id, request_options=request_options)
@@ -1018,11 +1229,23 @@ async def update_plan_trait(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.update_plan_trait(plan_trait_id='plan_trait_id', plan_id='plan_id', trait_value='trait_value', )
+ await client.plans.update_plan_trait(
+ plan_trait_id="plan_trait_id",
+ plan_id="plan_id",
+ trait_value="trait_value",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_plan_trait(
@@ -1049,11 +1272,21 @@ async def delete_plan_trait(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.delete_plan_trait(plan_trait_id='plan_trait_id', )
+ await client.plans.delete_plan_trait(
+ plan_trait_id="plan_trait_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_plan_trait(plan_trait_id, request_options=request_options)
@@ -1094,11 +1327,19 @@ async def count_plan_traits(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.plans.count_plan_traits()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_plan_traits(
@@ -1161,11 +1402,19 @@ async def list_plans(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.plans.list_plans()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_plans(
@@ -1213,11 +1462,23 @@ async def create_plan(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.create_plan(description='description', name='name', plan_type="plan", )
+ await client.plans.create_plan(
+ description="description",
+ name="name",
+ plan_type="plan",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_plan(
@@ -1244,11 +1505,21 @@ async def get_plan(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.get_plan(plan_id='plan_id', )
+ await client.plans.get_plan(
+ plan_id="plan_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_plan(plan_id, request_options=request_options)
@@ -1285,11 +1556,22 @@ async def update_plan(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.update_plan(plan_id='plan_id', name='name', )
+ await client.plans.update_plan(
+ plan_id="plan_id",
+ name="name",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_plan(
@@ -1316,11 +1598,21 @@ async def delete_plan(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.delete_plan(plan_id='plan_id', )
+ await client.plans.delete_plan(
+ plan_id="plan_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_plan(plan_id, request_options=request_options)
@@ -1330,13 +1622,16 @@ async def upsert_billing_product_plan(
self,
plan_id: str,
*,
- is_free_plan: bool,
+ charge_type: UpsertBillingProductRequestBodyChargeType,
is_trialable: bool,
billing_product_id: typing.Optional[str] = OMIT,
- charge_type: typing.Optional[str] = OMIT,
+ currency: typing.Optional[str] = OMIT,
+ monthly_price: typing.Optional[int] = OMIT,
monthly_price_id: typing.Optional[str] = OMIT,
+ one_time_price: typing.Optional[int] = OMIT,
one_time_price_id: typing.Optional[str] = OMIT,
trial_days: typing.Optional[int] = OMIT,
+ yearly_price: typing.Optional[int] = OMIT,
yearly_price_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> UpsertBillingProductPlanResponse:
@@ -1346,20 +1641,26 @@ async def upsert_billing_product_plan(
plan_id : str
plan_id
- is_free_plan : bool
+ charge_type : UpsertBillingProductRequestBodyChargeType
is_trialable : bool
billing_product_id : typing.Optional[str]
- charge_type : typing.Optional[str]
+ currency : typing.Optional[str]
+
+ monthly_price : typing.Optional[int]
monthly_price_id : typing.Optional[str]
+ one_time_price : typing.Optional[int]
+
one_time_price_id : typing.Optional[str]
trial_days : typing.Optional[int]
+ yearly_price : typing.Optional[int]
+
yearly_price_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
@@ -1372,22 +1673,37 @@ async def upsert_billing_product_plan(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.plans.upsert_billing_product_plan(plan_id='plan_id', is_free_plan=True, is_trialable=True, )
+ await client.plans.upsert_billing_product_plan(
+ plan_id="plan_id",
+ charge_type="one_time",
+ is_trialable=True,
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.upsert_billing_product_plan(
plan_id,
- is_free_plan=is_free_plan,
+ charge_type=charge_type,
is_trialable=is_trialable,
billing_product_id=billing_product_id,
- charge_type=charge_type,
+ currency=currency,
+ monthly_price=monthly_price,
monthly_price_id=monthly_price_id,
+ one_time_price=one_time_price,
one_time_price_id=one_time_price_id,
trial_days=trial_days,
+ yearly_price=yearly_price,
yearly_price_id=yearly_price_id,
request_options=request_options,
)
@@ -1448,11 +1764,19 @@ async def count_plans(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.plans.count_plans()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_plans(
diff --git a/src/schematic/plans/raw_client.py b/src/schematic/plans/raw_client.py
index 3ecb0a9..3f2e3a5 100644
--- a/src/schematic/plans/raw_client.py
+++ b/src/schematic/plans/raw_client.py
@@ -38,6 +38,7 @@
from .types.update_plan_response import UpdatePlanResponse
from .types.update_plan_trait_response import UpdatePlanTraitResponse
from .types.upsert_billing_product_plan_response import UpsertBillingProductPlanResponse
+from .types.upsert_billing_product_request_body_charge_type import UpsertBillingProductRequestBodyChargeType
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
@@ -98,61 +99,66 @@ def update_company_plans(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_audience(
@@ -189,51 +195,55 @@ def get_audience(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_audience(
@@ -295,61 +305,66 @@ def update_audience(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_audience(
@@ -386,51 +401,66 @@ def delete_audience(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_plan_traits(
@@ -490,51 +520,66 @@ def list_plan_traits(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_plan_trait(
@@ -583,51 +628,66 @@ def create_plan_trait(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_plan_trait(
@@ -664,51 +724,55 @@ def get_plan_trait(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_plan_trait(
@@ -762,61 +826,66 @@ def update_plan_trait(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_plan_trait(
@@ -853,51 +922,66 @@ def delete_plan_trait(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_plan_traits(
@@ -957,51 +1041,66 @@ def count_plan_traits(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_plans(
@@ -1086,51 +1185,66 @@ def list_plans(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_plan(
@@ -1188,51 +1302,66 @@ def create_plan(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_plan(
@@ -1269,51 +1398,55 @@ def get_plan(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_plan(
@@ -1371,61 +1504,66 @@ def update_plan(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_plan(
@@ -1462,64 +1600,82 @@ def delete_plan(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def upsert_billing_product_plan(
self,
plan_id: str,
*,
- is_free_plan: bool,
+ charge_type: UpsertBillingProductRequestBodyChargeType,
is_trialable: bool,
billing_product_id: typing.Optional[str] = OMIT,
- charge_type: typing.Optional[str] = OMIT,
+ currency: typing.Optional[str] = OMIT,
+ monthly_price: typing.Optional[int] = OMIT,
monthly_price_id: typing.Optional[str] = OMIT,
+ one_time_price: typing.Optional[int] = OMIT,
one_time_price_id: typing.Optional[str] = OMIT,
trial_days: typing.Optional[int] = OMIT,
+ yearly_price: typing.Optional[int] = OMIT,
yearly_price_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[UpsertBillingProductPlanResponse]:
@@ -1529,20 +1685,26 @@ def upsert_billing_product_plan(
plan_id : str
plan_id
- is_free_plan : bool
+ charge_type : UpsertBillingProductRequestBodyChargeType
is_trialable : bool
billing_product_id : typing.Optional[str]
- charge_type : typing.Optional[str]
+ currency : typing.Optional[str]
+
+ monthly_price : typing.Optional[int]
monthly_price_id : typing.Optional[str]
+ one_time_price : typing.Optional[int]
+
one_time_price_id : typing.Optional[str]
trial_days : typing.Optional[int]
+ yearly_price : typing.Optional[int]
+
yearly_price_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
@@ -1559,11 +1721,14 @@ def upsert_billing_product_plan(
json={
"billing_product_id": billing_product_id,
"charge_type": charge_type,
- "is_free_plan": is_free_plan,
+ "currency": currency,
"is_trialable": is_trialable,
+ "monthly_price": monthly_price,
"monthly_price_id": monthly_price_id,
+ "one_time_price": one_time_price,
"one_time_price_id": one_time_price_id,
"trial_days": trial_days,
+ "yearly_price": yearly_price,
"yearly_price_id": yearly_price_id,
},
headers={
@@ -1584,61 +1749,66 @@ def upsert_billing_product_plan(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_plans(
@@ -1723,51 +1893,66 @@ def count_plans(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -1826,61 +2011,66 @@ async def update_company_plans(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_audience(
@@ -1917,51 +2107,55 @@ async def get_audience(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_audience(
@@ -2023,61 +2217,66 @@ async def update_audience(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_audience(
@@ -2114,51 +2313,66 @@ async def delete_audience(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_plan_traits(
@@ -2218,51 +2432,66 @@ async def list_plan_traits(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_plan_trait(
@@ -2311,51 +2540,66 @@ async def create_plan_trait(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_plan_trait(
@@ -2392,51 +2636,55 @@ async def get_plan_trait(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_plan_trait(
@@ -2490,61 +2738,66 @@ async def update_plan_trait(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_plan_trait(
@@ -2581,51 +2834,66 @@ async def delete_plan_trait(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_plan_traits(
@@ -2685,51 +2953,66 @@ async def count_plan_traits(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_plans(
@@ -2814,51 +3097,66 @@ async def list_plans(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_plan(
@@ -2916,51 +3214,66 @@ async def create_plan(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_plan(
@@ -2997,51 +3310,55 @@ async def get_plan(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_plan(
@@ -3099,61 +3416,66 @@ async def update_plan(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_plan(
@@ -3190,64 +3512,82 @@ async def delete_plan(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def upsert_billing_product_plan(
self,
plan_id: str,
*,
- is_free_plan: bool,
+ charge_type: UpsertBillingProductRequestBodyChargeType,
is_trialable: bool,
billing_product_id: typing.Optional[str] = OMIT,
- charge_type: typing.Optional[str] = OMIT,
+ currency: typing.Optional[str] = OMIT,
+ monthly_price: typing.Optional[int] = OMIT,
monthly_price_id: typing.Optional[str] = OMIT,
+ one_time_price: typing.Optional[int] = OMIT,
one_time_price_id: typing.Optional[str] = OMIT,
trial_days: typing.Optional[int] = OMIT,
+ yearly_price: typing.Optional[int] = OMIT,
yearly_price_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[UpsertBillingProductPlanResponse]:
@@ -3257,20 +3597,26 @@ async def upsert_billing_product_plan(
plan_id : str
plan_id
- is_free_plan : bool
+ charge_type : UpsertBillingProductRequestBodyChargeType
is_trialable : bool
billing_product_id : typing.Optional[str]
- charge_type : typing.Optional[str]
+ currency : typing.Optional[str]
+
+ monthly_price : typing.Optional[int]
monthly_price_id : typing.Optional[str]
+ one_time_price : typing.Optional[int]
+
one_time_price_id : typing.Optional[str]
trial_days : typing.Optional[int]
+ yearly_price : typing.Optional[int]
+
yearly_price_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
@@ -3287,11 +3633,14 @@ async def upsert_billing_product_plan(
json={
"billing_product_id": billing_product_id,
"charge_type": charge_type,
- "is_free_plan": is_free_plan,
+ "currency": currency,
"is_trialable": is_trialable,
+ "monthly_price": monthly_price,
"monthly_price_id": monthly_price_id,
+ "one_time_price": one_time_price,
"one_time_price_id": one_time_price_id,
"trial_days": trial_days,
+ "yearly_price": yearly_price,
"yearly_price_id": yearly_price_id,
},
headers={
@@ -3312,61 +3661,66 @@ async def upsert_billing_product_plan(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_plans(
@@ -3451,49 +3805,64 @@ async def count_plans(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/plans/types/__init__.py b/src/schematic/plans/types/__init__.py
index a1309cf..79fbb0e 100644
--- a/src/schematic/plans/types/__init__.py
+++ b/src/schematic/plans/types/__init__.py
@@ -28,6 +28,7 @@
from .update_plan_response import UpdatePlanResponse
from .update_plan_trait_response import UpdatePlanTraitResponse
from .upsert_billing_product_plan_response import UpsertBillingProductPlanResponse
+from .upsert_billing_product_request_body_charge_type import UpsertBillingProductRequestBodyChargeType
__all__ = [
"CountPlanTraitsParams",
@@ -56,4 +57,5 @@
"UpdatePlanResponse",
"UpdatePlanTraitResponse",
"UpsertBillingProductPlanResponse",
+ "UpsertBillingProductRequestBodyChargeType",
]
diff --git a/src/schematic/plans/types/upsert_billing_product_request_body_charge_type.py b/src/schematic/plans/types/upsert_billing_product_request_body_charge_type.py
new file mode 100644
index 0000000..84305ba
--- /dev/null
+++ b/src/schematic/plans/types/upsert_billing_product_request_body_charge_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+UpsertBillingProductRequestBodyChargeType = typing.Union[typing.Literal["one_time", "recurring", "free"], typing.Any]
diff --git a/src/schematic/types/__init__.py b/src/schematic/types/__init__.py
index 835bbd4..41bac73 100644
--- a/src/schematic/types/__init__.py
+++ b/src/schematic/types/__init__.py
@@ -133,6 +133,7 @@
from .preview_subscription_change_response_data import PreviewSubscriptionChangeResponseData
from .preview_subscription_finance_response_data import PreviewSubscriptionFinanceResponseData
from .preview_subscription_upcoming_invoice_line_items import PreviewSubscriptionUpcomingInvoiceLineItems
+from .quickstart_resp import QuickstartResp
from .raw_event_batch_response_data import RawEventBatchResponseData
from .raw_event_response_data import RawEventResponseData
from .rule_condition_detail_response_data import RuleConditionDetailResponseData
@@ -294,6 +295,7 @@
"PreviewSubscriptionChangeResponseData",
"PreviewSubscriptionFinanceResponseData",
"PreviewSubscriptionUpcomingInvoiceLineItems",
+ "QuickstartResp",
"RawEventBatchResponseData",
"RawEventResponseData",
"RuleConditionDetailResponseData",
diff --git a/src/schematic/types/billing_coupon_response_data.py b/src/schematic/types/billing_coupon_response_data.py
index f6f7a68..a93553d 100644
--- a/src/schematic/types/billing_coupon_response_data.py
+++ b/src/schematic/types/billing_coupon_response_data.py
@@ -20,7 +20,7 @@ class BillingCouponResponseData(UniversalBaseModel):
max_redemptions: typing.Optional[int] = None
metadata: typing.Dict[str, typing.Optional[typing.Any]]
name: str
- percent_off: typing.Optional[int] = None
+ percent_off: typing.Optional[float] = None
times_redeemed: int
valid_from: typing.Optional[dt.datetime] = None
valid_until: typing.Optional[dt.datetime] = None
diff --git a/src/schematic/types/billing_product_plan_response_data.py b/src/schematic/types/billing_product_plan_response_data.py
index bff74af..e8739f1 100644
--- a/src/schematic/types/billing_product_plan_response_data.py
+++ b/src/schematic/types/billing_product_plan_response_data.py
@@ -14,6 +14,7 @@ class BillingProductPlanResponseData(UniversalBaseModel):
account_id: str
billing_product_id: str
charge_type: str
+ controlled_by: str
environment_id: str
is_trialable: bool
monthly_price_id: typing.Optional[str] = None
diff --git a/src/schematic/types/company_plan_detail_response_data.py b/src/schematic/types/company_plan_detail_response_data.py
index d0788c6..01b5e02 100644
--- a/src/schematic/types/company_plan_detail_response_data.py
+++ b/src/schematic/types/company_plan_detail_response_data.py
@@ -18,6 +18,7 @@ class CompanyPlanDetailResponseData(UniversalBaseModel):
charge_type: str
company_can_trial: bool
company_count: int
+ controlled_by: str
created_at: dt.datetime
current: bool
custom: bool
diff --git a/src/schematic/types/create_flag_request_body.py b/src/schematic/types/create_flag_request_body.py
index bd68098..4863bda 100644
--- a/src/schematic/types/create_flag_request_body.py
+++ b/src/schematic/types/create_flag_request_body.py
@@ -10,7 +10,7 @@ class CreateFlagRequestBody(UniversalBaseModel):
default_value: bool
description: str
feature_id: typing.Optional[str] = None
- flag_type: str
+ flag_type: typing.Literal["boolean"] = "boolean"
key: str
maintainer_id: typing.Optional[str] = None
name: str
diff --git a/src/schematic/types/create_or_update_flag_request_body.py b/src/schematic/types/create_or_update_flag_request_body.py
index 1c57a7e..c4bad9d 100644
--- a/src/schematic/types/create_or_update_flag_request_body.py
+++ b/src/schematic/types/create_or_update_flag_request_body.py
@@ -10,7 +10,7 @@ class CreateOrUpdateFlagRequestBody(UniversalBaseModel):
default_value: bool
description: str
feature_id: typing.Optional[str] = None
- flag_type: str
+ flag_type: typing.Literal["boolean"] = "boolean"
id: typing.Optional[str] = None
key: str
maintainer_id: typing.Optional[str] = None
diff --git a/src/schematic/types/event_summary_response_data.py b/src/schematic/types/event_summary_response_data.py
index f6cbf60..d077b2d 100644
--- a/src/schematic/types/event_summary_response_data.py
+++ b/src/schematic/types/event_summary_response_data.py
@@ -8,12 +8,12 @@
class EventSummaryResponseData(UniversalBaseModel):
- company_count: int
+ company_count: typing.Optional[int] = None
environment_id: str
event_count: int
event_subtype: str
last_seen_at: typing.Optional[dt.datetime] = None
- user_count: int
+ user_count: typing.Optional[int] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
diff --git a/src/schematic/types/plan_detail_response_data.py b/src/schematic/types/plan_detail_response_data.py
index d8f9e62..19f4786 100644
--- a/src/schematic/types/plan_detail_response_data.py
+++ b/src/schematic/types/plan_detail_response_data.py
@@ -15,6 +15,7 @@ class PlanDetailResponseData(UniversalBaseModel):
billing_product: typing.Optional[BillingProductDetailResponseData] = None
charge_type: str
company_count: int
+ controlled_by: str
created_at: dt.datetime
description: str
features: typing.List[FeatureDetailResponseData]
diff --git a/src/schematic/types/plan_group_plan_detail_response_data.py b/src/schematic/types/plan_group_plan_detail_response_data.py
index d82f5a2..e6b258c 100644
--- a/src/schematic/types/plan_group_plan_detail_response_data.py
+++ b/src/schematic/types/plan_group_plan_detail_response_data.py
@@ -17,6 +17,7 @@ class PlanGroupPlanDetailResponseData(UniversalBaseModel):
billing_product: typing.Optional[BillingProductDetailResponseData] = None
charge_type: str
company_count: int
+ controlled_by: str
created_at: dt.datetime
custom_plan_config: typing.Optional[CustomPlanViewConfigResponseData] = None
description: str
diff --git a/src/schematic/types/quickstart_resp.py b/src/schematic/types/quickstart_resp.py
new file mode 100644
index 0000000..27a3908
--- /dev/null
+++ b/src/schematic/types/quickstart_resp.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+
+
+class QuickstartResp(UniversalBaseModel):
+ ok: bool
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/types/upsert_user_request_body.py b/src/schematic/types/upsert_user_request_body.py
index 377a590..b9d0db3 100644
--- a/src/schematic/types/upsert_user_request_body.py
+++ b/src/schematic/types/upsert_user_request_body.py
@@ -8,12 +8,12 @@
class UpsertUserRequestBody(UniversalBaseModel):
- companies: typing.List[typing.Dict[str, str]] = pydantic.Field()
+ companies: typing.Optional[typing.List[typing.Dict[str, str]]] = pydantic.Field(default=None)
"""
Optionally specify companies using array of key/value pairs
"""
- company: typing.Dict[str, str] = pydantic.Field()
+ company: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
"""
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
"""
diff --git a/src/schematic/webhooks/client.py b/src/schematic/webhooks/client.py
index 5e17b43..2a78f09 100644
--- a/src/schematic/webhooks/client.py
+++ b/src/schematic/webhooks/client.py
@@ -74,7 +74,10 @@ def list_webhook_events(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.webhooks.list_webhook_events()
"""
_response = self._raw_client.list_webhook_events(
@@ -102,8 +105,13 @@ def get_webhook_event(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.webhooks.get_webhook_event(webhook_event_id='webhook_event_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.webhooks.get_webhook_event(
+ webhook_event_id="webhook_event_id",
+ )
"""
_response = self._raw_client.get_webhook_event(webhook_event_id, request_options=request_options)
return _response.data
@@ -144,7 +152,10 @@ def count_webhook_events(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.webhooks.count_webhook_events()
"""
_response = self._raw_client.count_webhook_events(
@@ -182,7 +193,10 @@ def list_webhooks(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.webhooks.list_webhooks()
"""
_response = self._raw_client.list_webhooks(q=q, limit=limit, offset=offset, request_options=request_options)
@@ -219,8 +233,15 @@ def create_webhook(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.webhooks.create_webhook(name='name', request_types=["company.updated"], url='url', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.webhooks.create_webhook(
+ name="name",
+ request_types=["company.updated"],
+ url="url",
+ )
"""
_response = self._raw_client.create_webhook(
name=name,
@@ -251,8 +272,13 @@ def get_webhook(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.webhooks.get_webhook(webhook_id='webhook_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.webhooks.get_webhook(
+ webhook_id="webhook_id",
+ )
"""
_response = self._raw_client.get_webhook(webhook_id, request_options=request_options)
return _response.data
@@ -295,8 +321,13 @@ def update_webhook(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.webhooks.update_webhook(webhook_id='webhook_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.webhooks.update_webhook(
+ webhook_id="webhook_id",
+ )
"""
_response = self._raw_client.update_webhook(
webhook_id,
@@ -329,8 +360,13 @@ def delete_webhook(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
- client.webhooks.delete_webhook(webhook_id='webhook_id', )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.webhooks.delete_webhook(
+ webhook_id="webhook_id",
+ )
"""
_response = self._raw_client.delete_webhook(webhook_id, request_options=request_options)
return _response.data
@@ -365,7 +401,10 @@ def count_webhooks(
Examples
--------
from schematic import Schematic
- client = Schematic(api_key="YOUR_API_KEY", )
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
client.webhooks.count_webhooks()
"""
_response = self._raw_client.count_webhooks(q=q, limit=limit, offset=offset, request_options=request_options)
@@ -422,11 +461,19 @@ async def list_webhook_events(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.webhooks.list_webhook_events()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_webhook_events(
@@ -453,11 +500,21 @@ async def get_webhook_event(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.webhooks.get_webhook_event(webhook_event_id='webhook_event_id', )
+ await client.webhooks.get_webhook_event(
+ webhook_event_id="webhook_event_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_webhook_event(webhook_event_id, request_options=request_options)
@@ -498,11 +555,19 @@ async def count_webhook_events(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.webhooks.count_webhook_events()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_webhook_events(
@@ -539,11 +604,19 @@ async def list_webhooks(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.webhooks.list_webhooks()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.list_webhooks(
@@ -581,11 +654,23 @@ async def create_webhook(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.webhooks.create_webhook(name='name', request_types=["company.updated"], url='url', )
+ await client.webhooks.create_webhook(
+ name="name",
+ request_types=["company.updated"],
+ url="url",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.create_webhook(
@@ -616,11 +701,21 @@ async def get_webhook(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.webhooks.get_webhook(webhook_id='webhook_id', )
+ await client.webhooks.get_webhook(
+ webhook_id="webhook_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.get_webhook(webhook_id, request_options=request_options)
@@ -663,11 +758,21 @@ async def update_webhook(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.webhooks.update_webhook(webhook_id='webhook_id', )
+ await client.webhooks.update_webhook(
+ webhook_id="webhook_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.update_webhook(
@@ -700,11 +805,21 @@ async def delete_webhook(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
- await client.webhooks.delete_webhook(webhook_id='webhook_id', )
+ await client.webhooks.delete_webhook(
+ webhook_id="webhook_id",
+ )
+
+
asyncio.run(main())
"""
_response = await self._raw_client.delete_webhook(webhook_id, request_options=request_options)
@@ -739,11 +854,19 @@ async def count_webhooks(
Examples
--------
- from schematic import AsyncSchematic
import asyncio
- client = AsyncSchematic(api_key="YOUR_API_KEY", )
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
async def main() -> None:
await client.webhooks.count_webhooks()
+
+
asyncio.run(main())
"""
_response = await self._raw_client.count_webhooks(
diff --git a/src/schematic/webhooks/raw_client.py b/src/schematic/webhooks/raw_client.py
index 58326d0..fed243d 100644
--- a/src/schematic/webhooks/raw_client.py
+++ b/src/schematic/webhooks/raw_client.py
@@ -95,51 +95,66 @@ def list_webhook_events(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_webhook_event(
@@ -176,51 +191,55 @@ def get_webhook_event(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_webhook_events(
@@ -280,51 +299,66 @@ def count_webhook_events(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def list_webhooks(
@@ -376,51 +410,66 @@ def list_webhooks(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def create_webhook(
@@ -482,51 +531,66 @@ def create_webhook(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def get_webhook(
@@ -563,51 +627,55 @@ def get_webhook(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def update_webhook(
@@ -677,61 +745,66 @@ def update_webhook(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def delete_webhook(
@@ -768,51 +841,66 @@ def delete_webhook(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
def count_webhooks(
@@ -864,51 +952,66 @@ def count_webhooks(
return HttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
@@ -973,51 +1076,66 @@ async def list_webhook_events(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_webhook_event(
@@ -1054,51 +1172,55 @@ async def get_webhook_event(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_webhook_events(
@@ -1158,51 +1280,66 @@ async def count_webhook_events(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def list_webhooks(
@@ -1254,51 +1391,66 @@ async def list_webhooks(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def create_webhook(
@@ -1360,51 +1512,66 @@ async def create_webhook(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def get_webhook(
@@ -1441,51 +1608,55 @@ async def get_webhook(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def update_webhook(
@@ -1555,61 +1726,66 @@ async def update_webhook(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 404:
raise NotFoundError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def delete_webhook(
@@ -1646,51 +1822,66 @@ async def delete_webhook(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
async def count_webhooks(
@@ -1742,49 +1933,64 @@ async def count_webhooks(
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 400:
raise BadRequestError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 401:
raise UnauthorizedError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
if _response.status_code == 403:
raise ForbiddenError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
)
if _response.status_code == 500:
raise InternalServerError(
- typing.cast(
+ headers=dict(_response.headers),
+ body=typing.cast(
types_api_error_ApiError,
parse_obj_as(
type_=types_api_error_ApiError, # type: ignore
object_=_response.json(),
),
- )
+ ),
)
_response_json = _response.json()
except JSONDecodeError:
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response.text
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise core_api_error_ApiError(
- headers=dict(_response.headers), status_code=_response.status_code, body=_response_json
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
diff --git a/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py b/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py
index f097e3c..24ec6ca 100644
--- a/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py
+++ b/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py
@@ -30,6 +30,8 @@
"subscription.trial.ended",
"entitlement.limit.warning",
"entitlement.limit.reached",
+ "entitlement.soft_limit.warning",
+ "entitlement.soft_limit.reached",
],
typing.Any,
]
diff --git a/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py b/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py
index dff35cd..442b853 100644
--- a/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py
+++ b/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py
@@ -30,6 +30,8 @@
"subscription.trial.ended",
"entitlement.limit.warning",
"entitlement.limit.reached",
+ "entitlement.soft_limit.warning",
+ "entitlement.soft_limit.reached",
],
typing.Any,
]