mirror of
https://github.com/ivuorinen/cinode-api.git
synced 2026-01-26 03:04:03 +00:00
Added Python client, updated TS typings, readme
This commit is contained in:
4
.github/workflows/static.yml
vendored
4
.github/workflows/static.yml
vendored
@@ -4,7 +4,7 @@ name: Deploy static content to Pages
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["main"]
|
||||
branches: ['main']
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
@@ -18,7 +18,7 @@ permissions:
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
group: 'pages'
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
|
||||
10
README.md
10
README.md
@@ -1,4 +1,12 @@
|
||||
# Cinode OpenAPI TypeScript API
|
||||
# Cinode OpenAPI TypeScript typings & Python API Client
|
||||
|
||||
## API Typings and Clients
|
||||
|
||||
### TypeScript
|
||||
|
||||
- Types created with [drwpow/openapi-typescript](https://github.com/drwpow/openapi-typescript)
|
||||
- API Examples with [drwpow/openapi-fetch](https://github.com/drwpow/openapi-fetch)
|
||||
|
||||
### Python
|
||||
|
||||
- Created with [openapi-python-client](https://github.com/openapi-generators/openapi-python-client)
|
||||
|
||||
14
generate.sh
14
generate.sh
@@ -3,13 +3,23 @@
|
||||
# Generate Cinode TypeScript type definitions
|
||||
|
||||
SRC="https://api.cinode.com/swagger/v0.1/swagger.json"
|
||||
DEST="$(pwd)/src/cinode.d.ts"
|
||||
DEST="$(pwd)/src/"
|
||||
DEST_TS="$DEST/cinode.d.ts"
|
||||
DEST_PY="$DEST/cinode-py-client"
|
||||
|
||||
python3 -m pip install --user --upgrade pipx
|
||||
python3 -m pipx ensurepath
|
||||
python3 -m pipx install openapi-python-client --include-deps
|
||||
|
||||
rm -rf "$DEST_PY"
|
||||
openapi-python-client generate --url "$SRC"
|
||||
mv "cinode-api-client" "$DEST_PY"
|
||||
|
||||
npx openapi-typescript \
|
||||
"$SRC" \
|
||||
--export-type \
|
||||
--path-params-as-type \
|
||||
--output "$DEST"
|
||||
--output "$DEST_TS"
|
||||
|
||||
npm run prettier
|
||||
|
||||
|
||||
23
src/cinode-py-client/.gitignore
vendored
Normal file
23
src/cinode-py-client/.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
__pycache__/
|
||||
build/
|
||||
dist/
|
||||
*.egg-info/
|
||||
.pytest_cache/
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# JetBrains
|
||||
.idea/
|
||||
|
||||
/coverage.xml
|
||||
/.coverage
|
||||
131
src/cinode-py-client/README.md
Normal file
131
src/cinode-py-client/README.md
Normal file
@@ -0,0 +1,131 @@
|
||||
# cinode-api-client
|
||||
|
||||
A client library for accessing Cinode API
|
||||
|
||||
## Usage
|
||||
|
||||
First, create a client:
|
||||
|
||||
```python
|
||||
from cinode_api_client import Client
|
||||
|
||||
client = Client(base_url="https://api.example.com")
|
||||
```
|
||||
|
||||
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
|
||||
|
||||
```python
|
||||
from cinode_api_client import AuthenticatedClient
|
||||
|
||||
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
|
||||
```
|
||||
|
||||
Now call your endpoint and use your models:
|
||||
|
||||
```python
|
||||
from cinode_api_client.models import MyDataModel
|
||||
from cinode_api_client.api.my_tag import get_my_data_model
|
||||
from cinode_api_client.types import Response
|
||||
|
||||
with client as client:
|
||||
my_data: MyDataModel = get_my_data_model.sync(client=client)
|
||||
# or if you need more info (e.g. status_code)
|
||||
response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
|
||||
```
|
||||
|
||||
Or do the same thing with an async version:
|
||||
|
||||
```python
|
||||
from cinode_api_client.models import MyDataModel
|
||||
from cinode_api_client.api.my_tag import get_my_data_model
|
||||
from cinode_api_client.types import Response
|
||||
|
||||
async with client as client:
|
||||
my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
|
||||
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
|
||||
```
|
||||
|
||||
By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
|
||||
|
||||
```python
|
||||
client = AuthenticatedClient(
|
||||
base_url="https://internal_api.example.com",
|
||||
token="SuperSecretToken",
|
||||
verify_ssl="/path/to/certificate_bundle.pem",
|
||||
)
|
||||
```
|
||||
|
||||
You can also disable certificate validation altogether, but beware that **this is a security risk**.
|
||||
|
||||
```python
|
||||
client = AuthenticatedClient(
|
||||
base_url="https://internal_api.example.com",
|
||||
token="SuperSecretToken",
|
||||
verify_ssl=False
|
||||
)
|
||||
```
|
||||
|
||||
Things to know:
|
||||
|
||||
1. Every path/method combo becomes a Python module with four functions:
|
||||
|
||||
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
|
||||
1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
|
||||
1. `asyncio`: Like `sync` but async instead of blocking
|
||||
1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
|
||||
|
||||
1. All path/query params, and bodies become method arguments.
|
||||
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
||||
1. Any endpoint which did not have a tag will be in `cinode_api_client.api.default`
|
||||
|
||||
## Advanced customizations
|
||||
|
||||
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
|
||||
|
||||
```python
|
||||
from cinode_api_client import Client
|
||||
|
||||
def log_request(request):
|
||||
print(f"Request event hook: {request.method} {request.url} - Waiting for response")
|
||||
|
||||
def log_response(response):
|
||||
request = response.request
|
||||
print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
|
||||
|
||||
client = Client(
|
||||
base_url="https://api.example.com",
|
||||
httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
|
||||
)
|
||||
|
||||
# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
|
||||
```
|
||||
|
||||
You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
|
||||
|
||||
```python
|
||||
import httpx
|
||||
from cinode_api_client import Client
|
||||
|
||||
client = Client(
|
||||
base_url="https://api.example.com",
|
||||
)
|
||||
# Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
|
||||
client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
|
||||
```
|
||||
|
||||
## Building / publishing this package
|
||||
|
||||
This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
|
||||
|
||||
1. Update the metadata in pyproject.toml (e.g. authors, version)
|
||||
1. If you're using a private repository, configure it with Poetry
|
||||
1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
|
||||
1. `poetry config http-basic.<your-repository-name> <username> <password>`
|
||||
1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
|
||||
|
||||
If you want to install this client into another project without publishing it (e.g. for development) then:
|
||||
|
||||
1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
|
||||
1. If that project is not using Poetry:
|
||||
1. Build a wheel with `poetry build -f wheel`
|
||||
1. Install that wheel from the other project `pip install <path-to-wheel>`
|
||||
7
src/cinode-py-client/cinode_api_client/__init__.py
Normal file
7
src/cinode-py-client/cinode_api_client/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
""" A client library for accessing Cinode API """
|
||||
from .client import AuthenticatedClient, Client
|
||||
|
||||
__all__ = (
|
||||
"AuthenticatedClient",
|
||||
"Client",
|
||||
)
|
||||
1
src/cinode-py-client/cinode_api_client/api/__init__.py
Normal file
1
src/cinode-py-client/cinode_api_client/api/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
""" Contains methods for accessing the API """
|
||||
196
src/cinode-py-client/cinode_api_client/api/absence/absence.py
Normal file
196
src/cinode-py-client/cinode_api_client/api/absence/absence.py
Normal file
@@ -0,0 +1,196 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.absence_period_model import AbsencePeriodModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences/{id}".format(
|
||||
companyId=company_id,
|
||||
companyUserId=company_user_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = AbsencePeriodModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Get absence period by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Get absence period by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Get absence period by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Get absence period by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,191 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences/{id}".format(
|
||||
companyId=company_id,
|
||||
companyUserId=company_user_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete absence
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete absence
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete absence
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete absence
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,206 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.absence_add_edit_model import AbsenceAddEditModel
|
||||
from ...models.absence_period_model import AbsencePeriodModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences".format(
|
||||
companyId=company_id,
|
||||
companyUserId=company_user_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = AbsencePeriodModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
||||
response_403 = cast(Any, None)
|
||||
return response_403
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Create Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Create Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Create Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Create Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,217 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.absence_add_edit_model import AbsenceAddEditModel
|
||||
from ...models.absence_period_model import AbsencePeriodModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "put",
|
||||
"url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences/{id}".format(
|
||||
companyId=company_id,
|
||||
companyUserId=company_user_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = AbsencePeriodModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
||||
response_403 = cast(Any, None)
|
||||
return response_403
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Update Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Update Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Update Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AbsenceAddEditModel,
|
||||
) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]:
|
||||
"""Update Absence Item for User
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
id (int):
|
||||
json_body (AbsenceAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,173 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.absence_type_model import AbsenceTypeModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/absence/types".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = AbsenceTypeModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]:
|
||||
"""Get absence types for company
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]:
|
||||
"""Get absence types for company
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]:
|
||||
"""Get absence types for company
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]:
|
||||
"""Get absence types for company
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
185
src/cinode-py-client/cinode_api_client/api/absences/absences.py
Normal file
185
src/cinode-py-client/cinode_api_client/api/absences/absences.py
Normal file
@@ -0,0 +1,185 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.absence_period_dto_model import AbsencePeriodDtoModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences".format(
|
||||
companyId=company_id,
|
||||
companyUserId=company_user_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = AbsencePeriodDtoModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]:
|
||||
"""Get absence period by company user id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['AbsencePeriodDtoModel']]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]:
|
||||
"""Get absence period by company user id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['AbsencePeriodDtoModel']]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]:
|
||||
"""Get absence period by company user id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['AbsencePeriodDtoModel']]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
company_user_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]:
|
||||
"""Get absence period by company user id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
company_user_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['AbsencePeriodDtoModel']]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
company_user_id=company_user_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,193 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.availability_filter_model import AvailabilityFilterModel
|
||||
from ...models.availability_model import AvailabilityModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
*,
|
||||
json_body: AvailabilityFilterModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/availability".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["AvailabilityModel"]]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = AvailabilityModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["AvailabilityModel"]]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AvailabilityFilterModel,
|
||||
) -> Response[Union[Any, ErrorModel, List["AvailabilityModel"]]]:
|
||||
"""Get availability for company users. Omitting companyUserId gets availability for all company users
|
||||
in company.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (AvailabilityFilterModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['AvailabilityModel']]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AvailabilityFilterModel,
|
||||
) -> Optional[Union[Any, ErrorModel, List["AvailabilityModel"]]]:
|
||||
"""Get availability for company users. Omitting companyUserId gets availability for all company users
|
||||
in company.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (AvailabilityFilterModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['AvailabilityModel']]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AvailabilityFilterModel,
|
||||
) -> Response[Union[Any, ErrorModel, List["AvailabilityModel"]]]:
|
||||
"""Get availability for company users. Omitting companyUserId gets availability for all company users
|
||||
in company.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (AvailabilityFilterModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['AvailabilityModel']]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: AvailabilityFilterModel,
|
||||
) -> Optional[Union[Any, ErrorModel, List["AvailabilityModel"]]]:
|
||||
"""Get availability for company users. Omitting companyUserId gets availability for all company users
|
||||
in company.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (AvailabilityFilterModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['AvailabilityModel']]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
168
src/cinode-py-client/cinode_api_client/api/company/company.py
Normal file
168
src/cinode-py-client/cinode_api_client/api/company/company.py
Normal file
@@ -0,0 +1,168 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_model import CompanyModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company by id
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,184 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_user_extended_model import CompanyUserExtendedModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/addresses/{id}/users".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyUserExtendedModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]:
|
||||
"""Get company users list for an address
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]:
|
||||
"""Get company users list for an address
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]:
|
||||
"""Get company users list for an address
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]:
|
||||
"""Get company users list for an address
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,194 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_add_model import CompanyCandidateAddModel
|
||||
from ...models.company_candidate_extended_model import CompanyCandidateExtendedModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
*,
|
||||
json_body: CompanyCandidateAddModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCandidateExtendedModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddModel,
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Create Candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCandidateAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Create Candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCandidateAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddModel,
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Create Candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCandidateAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Create Candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCandidateAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,187 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_extended_model import CompanyCandidateExtendedModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateExtendedModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Get Candidate by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Get Candidate by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Get Candidate by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Get Candidate by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,189 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete candidate from the system
|
||||
This action is irreversible, use with caution
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete candidate from the system
|
||||
This action is irreversible, use with caution
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete candidate from the system
|
||||
This action is irreversible, use with caution
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete candidate from the system
|
||||
This action is irreversible, use with caution
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_add_invite_model import CompanyCandidateAddInviteModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: CompanyCandidateAddInviteModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}/invite".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddInviteModel,
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Invite the CompanyCandidate to create their own Cinode account
|
||||
A email is sent with your message and details for how to login
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateAddInviteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddInviteModel,
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Invite the CompanyCandidate to create their own Cinode account
|
||||
A email is sent with your message and details for how to login
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateAddInviteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddInviteModel,
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Invite the CompanyCandidate to create their own Cinode account
|
||||
A email is sent with your message and details for how to login
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateAddInviteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateAddInviteModel,
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Invite the CompanyCandidate to create their own Cinode account
|
||||
A email is sent with your message and details for how to login
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateAddInviteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,209 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_extended_model import CompanyCandidateExtendedModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.operation import Operation
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: List["Operation"],
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = []
|
||||
for componentsschemas_json_patch_document_item_data in json_body:
|
||||
componentsschemas_json_patch_document_item = componentsschemas_json_patch_document_item_data.to_dict()
|
||||
|
||||
json_json_body.append(componentsschemas_json_patch_document_item)
|
||||
|
||||
return {
|
||||
"method": "patch",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateExtendedModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_model import CompanyCandidateEventModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateEventModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates event by id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates event by id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates event by id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates event by id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_meeting_model import CompanyCandidateEventMeetingModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateEventMeetingModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates meeting event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates meeting event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates meeting event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates meeting event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate meeting event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate meeting event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate meeting event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate meeting event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,208 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_meeting_model import CompanyCandidateEventMeetingModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.event_meeting_add_edit_model import EventMeetingAddEditModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCandidateEventMeetingModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,219 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_meeting_model import CompanyCandidateEventMeetingModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.event_meeting_add_edit_model import EventMeetingAddEditModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "put",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateEventMeetingModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Update meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Update meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Update meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventMeetingAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Update meeting event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventMeetingAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events meetings list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events meetings list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events meetings list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events meetings list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_note_model import CompanyCandidateEventNoteModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateEventNoteModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates note event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates note event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates note event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates note event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate note event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate note event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate note event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate note event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,208 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_note_model import CompanyCandidateEventNoteModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.event_note_add_edit_model import EventNoteAddEditModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCandidateEventNoteModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,219 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_note_model import CompanyCandidateEventNoteModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.event_note_add_edit_model import EventNoteAddEditModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "put",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateEventNoteModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Update note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Update note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Update note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventNoteAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]:
|
||||
"""Update note event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventNoteAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events notes list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events notes list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events notes list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events notes list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_task_model import CompanyCandidateEventTaskModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateEventTaskModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates task event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates task event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates task event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company candidates task event with specified id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate task event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate task event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate task event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete company candidate task event
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,208 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_task_model import CompanyCandidateEventTaskModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.event_task_add_edit_model import EventTaskAddEditModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCandidateEventTaskModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Add new task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,219 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_task_model import CompanyCandidateEventTaskModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.event_task_add_edit_model import EventTaskAddEditModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "put",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateEventTaskModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Update task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Update task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Update task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: EventTaskAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]:
|
||||
"""Update task event for company candidate
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (str):
|
||||
json_body (EventTaskAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events tasks list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events tasks list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events tasks list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events tasks list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]:
|
||||
"""Get company candidates events list
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,200 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}/attachments/{attachmentId}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
attachmentId=attachment_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, str]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(str, response.json())
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, str]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, str]]:
|
||||
"""Get Candidate File Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, str]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, str]]:
|
||||
"""Get Candidate File Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, str]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, str]]:
|
||||
"""Get Candidate File Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, str]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, str]]:
|
||||
"""Get Candidate File Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, str]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,205 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.candidate_attachment_multipart_data import CandidateAttachmentMultipartData
|
||||
from ...models.company_candidate_file_attachment_list_model import CompanyCandidateFileAttachmentListModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
multipart_data: CandidateAttachmentMultipartData,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
multipart_multipart_data = multipart_data.to_multipart()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}/attachments".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
"files": multipart_multipart_data,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCandidateFileAttachmentListModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
multipart_data: CandidateAttachmentMultipartData,
|
||||
) -> Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]:
|
||||
"""Upload Candidate File Attachment
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
multipart_data (CandidateAttachmentMultipartData):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
multipart_data=multipart_data,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
multipart_data: CandidateAttachmentMultipartData,
|
||||
) -> Optional[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]:
|
||||
"""Upload Candidate File Attachment
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
multipart_data (CandidateAttachmentMultipartData):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
multipart_data=multipart_data,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
multipart_data: CandidateAttachmentMultipartData,
|
||||
) -> Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]:
|
||||
"""Upload Candidate File Attachment
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
multipart_data (CandidateAttachmentMultipartData):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
multipart_data=multipart_data,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
multipart_data: CandidateAttachmentMultipartData,
|
||||
) -> Optional[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]:
|
||||
"""Upload Candidate File Attachment
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
multipart_data (CandidateAttachmentMultipartData):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
multipart_data=multipart_data,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,178 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_pipeline_model import CompanyCandidatePipelineModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/pipelines".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyCandidatePipelineModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]:
|
||||
"""Get candidate pipelines
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]:
|
||||
"""Get candidate pipelines
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]:
|
||||
"""Get candidate pipelines
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]:
|
||||
"""Get candidate pipelines
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/skills/{id}".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Skill
|
||||
|
||||
Sample request:
|
||||
|
||||
DELETE /v0.1/companies/1/candidates/19870/skills/577
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Skill
|
||||
|
||||
Sample request:
|
||||
|
||||
DELETE /v0.1/companies/1/candidates/19870/skills/577
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Skill
|
||||
|
||||
Sample request:
|
||||
|
||||
DELETE /v0.1/companies/1/candidates/19870/skills/577
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Skill
|
||||
|
||||
Sample request:
|
||||
|
||||
DELETE /v0.1/companies/1/candidates/19870/skills/577
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,243 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_skill_add_model import CompanyCandidateSkillAddModel
|
||||
from ...models.company_candidate_skill_model import CompanyCandidateSkillModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
json_body: CompanyCandidateSkillAddModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{candidateId}/skills".format(
|
||||
companyId=company_id,
|
||||
candidateId=candidate_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateSkillModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
||||
response_403 = cast(Any, None)
|
||||
return response_403
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateSkillAddModel,
|
||||
) -> Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]:
|
||||
r"""Add a Skill to company candidate
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/candidates/19870/skills
|
||||
{
|
||||
\"name\": \"SQL\",
|
||||
\"companyCandidateId\": 19870,
|
||||
\"keywordSynonymId\": 577,
|
||||
\"languageId\":1
|
||||
}
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (CompanyCandidateSkillAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateSkillAddModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]:
|
||||
r"""Add a Skill to company candidate
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/candidates/19870/skills
|
||||
{
|
||||
\"name\": \"SQL\",
|
||||
\"companyCandidateId\": 19870,
|
||||
\"keywordSynonymId\": 577,
|
||||
\"languageId\":1
|
||||
}
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (CompanyCandidateSkillAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateSkillAddModel,
|
||||
) -> Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]:
|
||||
r"""Add a Skill to company candidate
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/candidates/19870/skills
|
||||
{
|
||||
\"name\": \"SQL\",
|
||||
\"companyCandidateId\": 19870,
|
||||
\"keywordSynonymId\": 577,
|
||||
\"languageId\":1
|
||||
}
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (CompanyCandidateSkillAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
candidate_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateSkillAddModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]:
|
||||
r"""Add a Skill to company candidate
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/candidates/19870/skills
|
||||
{
|
||||
\"name\": \"SQL\",
|
||||
\"companyCandidateId\": 19870,
|
||||
\"keywordSynonymId\": 577,
|
||||
\"languageId\":1
|
||||
}
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
candidate_id (int):
|
||||
json_body (CompanyCandidateSkillAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
candidate_id=candidate_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,205 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_uri_attachment_add_model import CompanyCandidateUriAttachmentAddModel
|
||||
from ...models.company_candidate_uri_attachment_model import CompanyCandidateUriAttachmentModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: CompanyCandidateUriAttachmentAddModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}/uriattachments".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCandidateUriAttachmentModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateUriAttachmentAddModel,
|
||||
) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]:
|
||||
"""Add Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateUriAttachmentAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateUriAttachmentAddModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]:
|
||||
"""Add Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateUriAttachmentAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateUriAttachmentAddModel,
|
||||
) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]:
|
||||
"""Add Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateUriAttachmentAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCandidateUriAttachmentAddModel,
|
||||
) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]:
|
||||
"""Add Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCandidateUriAttachmentAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}/uriattachments/{attachmentId}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
attachmentId=attachment_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete Candidate Uri (Link)
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,202 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_uri_attachment_model import CompanyCandidateUriAttachmentModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates/{id}/uriattachments/{attachmentId}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
attachmentId=attachment_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCandidateUriAttachmentModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]:
|
||||
"""Get Candidate Uri Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]:
|
||||
"""Get Candidate Uri Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]:
|
||||
"""Get Candidate Uri Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
attachment_id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]:
|
||||
"""Get Candidate Uri Attachment by Id
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
attachment_id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
attachment_id=attachment_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,178 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_candidate_base_model import CompanyCandidateBaseModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/candidates".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyCandidateBaseModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]:
|
||||
"""Get Candidates
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]:
|
||||
"""Get Candidates
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]:
|
||||
"""Get Candidates
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]:
|
||||
"""Get Candidates
|
||||
|
||||
Requires access level: CompanyRecruiter. Requires module: Recruitment.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,168 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_capabilities_model import CompanyCapabilitiesModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/capabilities".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCapabilitiesModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company capabilities
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company capabilities
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company capabilities
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company capabilities
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,176 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.currency_model import CurrencyModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/currencies".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CurrencyModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
||||
response_403 = cast(Any, None)
|
||||
return response_403
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]:
|
||||
"""Get company currencies
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]:
|
||||
"""Get company currencies
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]:
|
||||
"""Get company currencies
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]:
|
||||
"""Get company currencies
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,203 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_delete_model import CompanyCustomerDeleteModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: CompanyCustomerDeleteModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{id}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerDeleteModel,
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerDeleteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerDeleteModel,
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerDeleteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerDeleteModel,
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerDeleteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerDeleteModel,
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerDeleteModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,190 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_model import CompanyCustomerModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{id}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCustomerModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company customer by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company customer by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company customer by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Get company customer by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,191 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_add_model import CompanyCustomerAddModel
|
||||
from ...models.company_customer_model import CompanyCustomerModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
*,
|
||||
json_body: CompanyCustomerAddModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/customers".format(
|
||||
companyId=company_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCustomerModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddModel,
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Add company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCustomerAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Add company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCustomerAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddModel,
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Add company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCustomerAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Add company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
json_body (CompanyCustomerAddModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,209 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_model import CompanyCustomerModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.operation import Operation
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: List["Operation"],
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = []
|
||||
for componentsschemas_json_patch_document_item_data in json_body:
|
||||
componentsschemas_json_patch_document_item = componentsschemas_json_patch_document_item_data.to_dict()
|
||||
|
||||
json_json_body.append(componentsschemas_json_patch_document_item)
|
||||
|
||||
return {
|
||||
"method": "patch",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{id}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCustomerModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["Operation"],
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Patch company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (List['Operation']): Array of patch operations to perform
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,205 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_edit_model import CompanyCustomerEditModel
|
||||
from ...models.company_customer_model import CompanyCustomerModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: CompanyCustomerEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "put",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{id}".format(
|
||||
companyId=company_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCustomerModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Update company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Update company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Update company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]:
|
||||
"""Update company customer
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_address_model import CompanyCustomerAddressModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCustomerAddressModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer address by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer address by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer address by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer address by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,219 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_address_add_edit_model import CompanyCustomerAddressAddEditModel
|
||||
from ...models.company_customer_address_model import CompanyCustomerAddressModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "put",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCustomerAddressModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,205 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_address_add_edit_model import CompanyCustomerAddressAddEditModel
|
||||
from ...models.company_customer_address_model import CompanyCustomerAddressModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCustomerAddressModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerAddressAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer address
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerAddressAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_contact_model import CompanyCustomerContactModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCustomerContactModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer contact by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer contact by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer contact by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer contact by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,219 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_contact_add_edit_model import CompanyCustomerContactAddEditModel
|
||||
from ...models.company_customer_contact_model import CompanyCustomerContactModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "put",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CompanyCustomerContactModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Update customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,205 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_contact_add_edit_model import CompanyCustomerContactAddEditModel
|
||||
from ...models.company_customer_contact_model import CompanyCustomerContactModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = json_body.to_dict()
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.CREATED:
|
||||
response_201 = CompanyCustomerContactModel.from_dict(response.json())
|
||||
|
||||
return response_201
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: CompanyCustomerContactAddEditModel,
|
||||
) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]:
|
||||
"""Add customer contact
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
json_body (CompanyCustomerContactAddEditModel):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,301 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_tag_model import CompanyTagModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
contact_id: int,
|
||||
*,
|
||||
json_body: List["CompanyTagModel"],
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
json_json_body = []
|
||||
for json_body_item_data in json_body:
|
||||
json_body_item = json_body_item_data.to_dict()
|
||||
|
||||
json_json_body.append(json_body_item)
|
||||
|
||||
return {
|
||||
"method": "post",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{contactId}/tags".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
contactId=contact_id,
|
||||
),
|
||||
"json": json_json_body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyTagModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
||||
response_403 = cast(Any, None)
|
||||
return response_403
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
contact_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["CompanyTagModel"],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]:
|
||||
r"""Edit Tags for CustomerContact
|
||||
|
||||
Note:
|
||||
|
||||
Posted tags will replace any existing tags for the contact.
|
||||
A new tag will be created if the Id for a tag is not provided.
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/customers/19870/contacts/5360/tags
|
||||
[
|
||||
{
|
||||
\"name\": \"tag-name\",
|
||||
\"id\": 2
|
||||
},
|
||||
{
|
||||
\"name\": \"tag-test\",
|
||||
\"id\": 1
|
||||
},
|
||||
]
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
contact_id (int):
|
||||
json_body (List['CompanyTagModel']):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
contact_id=contact_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
contact_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["CompanyTagModel"],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]:
|
||||
r"""Edit Tags for CustomerContact
|
||||
|
||||
Note:
|
||||
|
||||
Posted tags will replace any existing tags for the contact.
|
||||
A new tag will be created if the Id for a tag is not provided.
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/customers/19870/contacts/5360/tags
|
||||
[
|
||||
{
|
||||
\"name\": \"tag-name\",
|
||||
\"id\": 2
|
||||
},
|
||||
{
|
||||
\"name\": \"tag-test\",
|
||||
\"id\": 1
|
||||
},
|
||||
]
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
contact_id (int):
|
||||
json_body (List['CompanyTagModel']):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
contact_id=contact_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
contact_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["CompanyTagModel"],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]:
|
||||
r"""Edit Tags for CustomerContact
|
||||
|
||||
Note:
|
||||
|
||||
Posted tags will replace any existing tags for the contact.
|
||||
A new tag will be created if the Id for a tag is not provided.
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/customers/19870/contacts/5360/tags
|
||||
[
|
||||
{
|
||||
\"name\": \"tag-name\",
|
||||
\"id\": 2
|
||||
},
|
||||
{
|
||||
\"name\": \"tag-test\",
|
||||
\"id\": 1
|
||||
},
|
||||
]
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
contact_id (int):
|
||||
json_body (List['CompanyTagModel']):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
contact_id=contact_id,
|
||||
json_body=json_body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
contact_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
json_body: List["CompanyTagModel"],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]:
|
||||
r"""Edit Tags for CustomerContact
|
||||
|
||||
Note:
|
||||
|
||||
Posted tags will replace any existing tags for the contact.
|
||||
A new tag will be created if the Id for a tag is not provided.
|
||||
|
||||
Sample request:
|
||||
|
||||
POST /v0.1/companies/1/customers/19870/contacts/5360/tags
|
||||
[
|
||||
{
|
||||
\"name\": \"tag-name\",
|
||||
\"id\": 2
|
||||
},
|
||||
{
|
||||
\"name\": \"tag-test\",
|
||||
\"id\": 1
|
||||
},
|
||||
]
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
contact_id (int):
|
||||
json_body (List['CompanyTagModel']):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
contact_id=contact_id,
|
||||
client=client,
|
||||
json_body=json_body,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.company_customer_contact_model import CompanyCustomerContactModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CompanyCustomerContactModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]:
|
||||
"""Get customer contact list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]:
|
||||
"""Get customer contact list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]:
|
||||
"""Get customer contact list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]:
|
||||
"""Get customer contact list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.customer_event_model import CustomerEventModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/events/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CustomerEventModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CustomerEventModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CustomerEventModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,192 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, List, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.customer_event_base_model import CustomerEventBaseModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/events".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = []
|
||||
_response_200 = response.json()
|
||||
for response_200_item_data in _response_200:
|
||||
response_200_item = CustomerEventBaseModel.from_dict(response_200_item_data)
|
||||
|
||||
response_200.append(response_200_item)
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]:
|
||||
"""Get customer events list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]:
|
||||
"""Get customer events list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]:
|
||||
"""Get customer events list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]:
|
||||
"""Get customer events list
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,204 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.customer_event_meeting_model import CustomerEventMeetingModel
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "get",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/events/meetings/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = CustomerEventMeetingModel.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event meeting by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event meeting by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event meeting by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]:
|
||||
"""Get customer event meeting by id
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
@@ -0,0 +1,199 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.error_model import ErrorModel
|
||||
from ...models.validation_model import ValidationModel
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
) -> Dict[str, Any]:
|
||||
pass
|
||||
|
||||
return {
|
||||
"method": "delete",
|
||||
"url": "/v0.1/companies/{companyId}/customers/{customerId}/events/meetings/{id}".format(
|
||||
companyId=company_id,
|
||||
customerId=customer_id,
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = cast(Any, None)
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = ValidationModel.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
||||
response_401 = cast(Any, None)
|
||||
return response_401
|
||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
response_500 = ErrorModel.from_dict(response.json())
|
||||
|
||||
return response_500
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer event meeting
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer event meeting
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer event meeting
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, ErrorModel, ValidationModel]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
company_id: int,
|
||||
customer_id: int,
|
||||
id: str,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, ErrorModel, ValidationModel]]:
|
||||
"""Delete customer event meeting
|
||||
|
||||
Requires access level: CompanyManager. Requires module: Customers.
|
||||
|
||||
Args:
|
||||
company_id (int):
|
||||
customer_id (int):
|
||||
id (str):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, ErrorModel, ValidationModel]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
company_id=company_id,
|
||||
customer_id=customer_id,
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user