Compare commits

...

25 Commits

Author SHA1 Message Date
532fbb352c float
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-03-03 15:53:35 -08:00
a1a02a1230 updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-02-24 17:07:15 -08:00
e5146a7cd5 Bump jinja2 from 3.1.2 to 3.1.3 (#189)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-24 17:04:28 -08:00
dedbe43c3e bump
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-02-24 17:03:55 -08:00
218c6b4672 Update api spec (#192)
YOYO NEW API SPEC!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-24 16:41:39 -08:00
800e9756c5 Bump ruff from 0.0.291 to 0.2.2 (#199)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.291 to 0.2.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.0.291...v0.2.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-24 16:39:17 -08:00
24e1d948f2 Bump codecov/codecov-action from 3 to 4 (#196)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-24 16:38:43 -08:00
bf758803cc Bump pillow from 10.0.1 to 10.2.0 (#194)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.1 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.0.1...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-24 16:38:26 -08:00
62e481fb1e update version
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-01-16 15:17:14 -08:00
ff4bff38dd Bump pydantic from 2.5.2 to 2.5.3 (#187)
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.5.2 to 2.5.3.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.5.2...v2.5.3)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 15:06:09 -08:00
f417993c85 Bump fonttools from 4.41.1 to 4.43.0 (#188)
Bumps [fonttools](https://github.com/fonttools/fonttools) from 4.41.1 to 4.43.0.
- [Release notes](https://github.com/fonttools/fonttools/releases)
- [Changelog](https://github.com/fonttools/fonttools/blob/main/NEWS.rst)
- [Commits](https://github.com/fonttools/fonttools/compare/4.41.1...4.43.0)

---
updated-dependencies:
- dependency-name: fonttools
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 15:06:00 -08:00
8bebb40c9f Update api spec (#186)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-16 15:04:35 -08:00
ec68e67645 Update README.md 2024-01-06 20:16:15 -08:00
95894ba00f Update README.md 2024-01-06 19:20:18 -08:00
ad19153225 updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-01-06 18:45:20 -08:00
8d476bbec6 pydantic cleanup
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-01-06 18:32:34 -08:00
b233f94a24 Update README.md 2024-01-06 17:58:11 -08:00
6351fb1bbc updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-01-06 15:23:57 -08:00
0e11945f1d Bump black from 23.7.0 to 23.12.1 (#184)
Bumps [black](https://github.com/psf/black) from 23.7.0 to 23.12.1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/23.7.0...23.12.1)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 15:18:36 -08:00
d3d454a2d7 bump
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-01-06 15:12:51 -08:00
b150024bff Bump actions/setup-python from 4 to 5 (#176)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 15:08:53 -08:00
0ad6216cde Update api spec (#182)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-06 14:56:45 -08:00
8925458665 better timeout
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-12-21 09:28:32 -08:00
25f8effd19 longer timeout
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-12-21 09:06:08 -08:00
9c6c504ae5 fixes #181
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-12-21 08:58:24 -08:00
285 changed files with 20870 additions and 2558 deletions

View File

@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
# Installation instructions are from: https://python-poetry.org/docs/
- name: Install dependencies

View File

@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
@ -49,7 +49,7 @@ jobs:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

View File

@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x

View File

@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
# Installation instructions are from: https://python-poetry.org/docs/

View File

@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
# Installation instructions are from: https://python-poetry.org/docs/
- name: Install dependencies

View File

@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
# Installation instructions are from: https://python-poetry.org/docs/
- name: Install dependencies

View File

@ -15,6 +15,13 @@ jobs:
name: update-spec
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ secrets.GH_ORG_APP_ID }}
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
- name: make generate
shell: bash
@ -38,7 +45,7 @@ jobs:
with:
repository: 'kittycad/website'
path: 'docs'
token: ${{secrets.PAT_GITHUB}}
token: ${{ steps.app-token.outputs.token }}
- name: move spec to docs
shell: bash
run: |
@ -62,6 +69,6 @@ jobs:
--head "$NEW_BRANCH" \
--base main || true
env:
GITHUB_TOKEN: ${{secrets.PAT_GITHUB}}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

View File

@ -1,18 +1,16 @@
![image](https://user-images.githubusercontent.com/19377312/165883233-3bdbc9fb-ddf9-4173-8cf2-d1b70ab7127d.png)
# kittycad.py
The Python API client for KittyCAD.
- [PyPI](https://pypi.org/project/kittycad/)
- [Python docs](https://python.api.docs.kittycad.io/)
- [KittyCAD API Docs](https://docs.kittycad.io/?lang=python)
- [Python docs](https://python.api.docs.zoo.dev/)
- [KittyCAD API Docs](https://zoo.dev/docs/api?lang=python)
## Generating
You can trigger a build with the GitHub action to generate the client. This will
automatically update the client to the latest version based on the spec hosted
at [api.kittycad.io](https://api.kittycad.io/).
at [api.zoo.dev](https://api.zoo.dev/).
Alternatively, if you wish to generate the client locally, make sure you have
[Docker installed](https://docs.docker.com/get-docker/) and run:

View File

@ -51,7 +51,7 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
{% if has_request_body %}"content": body,{% endif %}
{% if has_request_body %}{% if request_body_type != "bytes" %}"content": body.model_dump_json(),{% else %}"content": body,{% endif %}{% endif %}
}

View File

@ -233,7 +233,11 @@ def generateTypeAndExamplePython(
elif (
schema["type"] == "number"
and "format" in schema
and (schema["format"] == "float" or schema["format"] == "double")
and (
schema["format"] == "float"
or schema["format"] == "double"
or schema["format"] == "money-usd"
)
):
parameter_type = "float"
parameter_example = "3.14"
@ -518,7 +522,7 @@ from kittycad.types import Response
short_sync_example = short_sync_example + (
"""
if isinstance(result, Error) or result == None:
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
@ -705,6 +709,7 @@ async def test_"""
"docs": str,
"parse_response": str,
"has_request_body": bool,
"request_body_type": str,
},
)
template_info: TemplateType = {
@ -716,6 +721,7 @@ async def test_"""
"docs": "",
"parse_response": "",
"has_request_body": False,
"request_body_type": "",
}
if len(endpoint_refs) == 0:
@ -843,7 +849,17 @@ async def test_"""
+ response_code
+ " = response.text\n"
)
elif (
json["type"] == "object"
and "additionalProperties" in json
):
parse_response.write(
"\t\tresponse_"
+ response_code
+ " = response.json()\n"
)
else:
print(json)
raise Exception("Unknown type", json["type"])
else:
parse_response.write(
@ -954,6 +970,7 @@ async def test_"""
}
)
template_info["has_request_body"] = True
template_info["request_body_type"] = request_body_type
# Generate the template for the functions.
environment = jinja2.Environment(loader=jinja2.FileSystemLoader("generate/"))
@ -1014,7 +1031,7 @@ def generateType(path: str, name: str, schema: dict, data: dict):
elif type_name == "integer":
generateIntegerType(file_path, name, schema, type_name)
elif type_name == "number":
generateIntegerType(file_path, name, schema, type_name)
generateFloatType(file_path, name, schema, type_name)
elif type_name == "string":
generateStringType(file_path, name, schema, type_name)
else:
@ -1497,6 +1514,24 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict):
f.write(object_code)
f.write("\n")
all_options.append(object_name)
else:
# Generate each of the options from the tag.
i = 0
for one_of in schema["oneOf"]:
# Get the value of the tag.
object_name = name + str(i)
object_code = generateObjectTypeCode(
object_name,
one_of,
"object",
data,
None,
None,
)
f.write(object_code)
f.write("\n")
all_options.append(object_name)
i += 1
# Write the sum type.
description = getOneOfDescription(schema)
@ -1691,7 +1726,12 @@ def getEndpointRefs(endpoint: dict, data: dict) -> List[str]:
raise Exception("Unknown array type")
elif json["type"] == "string":
refs.append("str")
elif (
json["type"] == "object" and "additionalProperties" in json
):
refs.append("dict")
else:
print(json)
raise Exception("Unknown type ", json["type"])
else:
refs.append("dict")

View File

@ -2,7 +2,7 @@ import datetime
from typing import List, Optional, Dict, Union, Any, Literal
from uuid import UUID
from pydantic import BaseModel, Base64Bytes, AnyUrl
from pydantic import BaseModel, Base64Bytes, AnyUrl, ConfigDict
from pydantic_extra_types.phone_numbers import PhoneNumber
from .base64data import Base64Data
@ -19,3 +19,7 @@ class {{ name }}(BaseModel):
{{ field.name }}: {{ field.type }}
{% endif %}
{% endfor %}
model_config = ConfigDict(
protected_namespaces=()
)

View File

@ -22,7 +22,7 @@ poetry run python generate/generate.py
poetry run isort .
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py
poetry run ruff check --fix .
poetry run mypy .
poetry run mypy . || true
# Run the tests.

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """ # noqa: E501
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate CAD models. """ # noqa: E501

View File

@ -0,0 +1,114 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.kcl_code_completion_request import KclCodeCompletionRequest
from ...models.kcl_code_completion_response import KclCodeCompletionResponse
from ...types import Response
def _get_kwargs(
body: KclCodeCompletionRequest,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ai/kcl/completions".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[KclCodeCompletionResponse, Error]]:
if response.status_code == 201:
response_201 = KclCodeCompletionResponse(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[KclCodeCompletionResponse, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: KclCodeCompletionRequest,
*,
client: Client,
) -> Response[Optional[Union[KclCodeCompletionResponse, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: KclCodeCompletionRequest,
*,
client: Client,
) -> Optional[Union[KclCodeCompletionResponse, Error]]:
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: KclCodeCompletionRequest,
*,
client: Client,
) -> Response[Optional[Union[KclCodeCompletionResponse, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: KclCodeCompletionRequest,
*,
client: Client,
) -> Optional[Union[KclCodeCompletionResponse, Error]]:
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -29,7 +29,7 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
"content": body.model_dump_json(),
}
@ -86,7 +86,6 @@ def sync(
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.
""" # noqa: E501
return sync_detailed(
@ -123,7 +122,6 @@ async def asyncio(
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.
""" # noqa: E501
return (

View File

@ -15,6 +15,7 @@ def _get_kwargs(
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
no_models: Optional[bool] = None,
) -> Dict[str, Any]:
url = "{}/user/text-to-cad".format(
client.base_url,
@ -38,6 +39,12 @@ def _get_kwargs(
else:
url = url + "?sort_by=" + str(sort_by)
if no_models is not None:
if "?" in url:
url = url + "&no_models=" + str(no_models)
else:
url = url + "?no_models=" + str(no_models)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
@ -81,11 +88,13 @@ def sync_detailed(
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
no_models: Optional[bool] = None,
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
no_models=no_models,
client=client,
)
@ -103,6 +112,7 @@ def sync(
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
no_models: Optional[bool] = None,
) -> Optional[Union[TextToCadResultsPage, Error]]:
"""This will always return the STEP file contents as well as the format the user originally requested.
This endpoint requires authentication by any Zoo user. It returns the text-to-CAD models for the authenticated user.
@ -113,6 +123,7 @@ def sync(
limit=limit,
page_token=page_token,
sort_by=sort_by,
no_models=no_models,
client=client,
).parsed
@ -123,11 +134,13 @@ async def asyncio_detailed(
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
no_models: Optional[bool] = None,
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
no_models=no_models,
client=client,
)
@ -143,6 +156,7 @@ async def asyncio(
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
no_models: Optional[bool] = None,
) -> Optional[Union[TextToCadResultsPage, Error]]:
"""This will always return the STEP file contents as well as the format the user originally requested.
This endpoint requires authentication by any Zoo user. It returns the text-to-CAD models for the authenticated user.
@ -154,6 +168,7 @@ async def asyncio(
limit=limit,
page_token=page_token,
sort_by=sort_by,
no_models=no_models,
client=client,
)
).parsed

View File

@ -0,0 +1,117 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_call_with_price import ApiCallWithPrice
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/api-calls/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPrice, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPrice(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[ApiCallWithPrice, Error]]:
"""This endpoint requires authentication by an org admin. It returns details of the requested API call for the user's org.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[ApiCallWithPrice, Error]]:
"""This endpoint requires authentication by an org admin. It returns details of the requested API call for the user's org.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,159 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_call_with_price_results_page import ApiCallWithPriceResultsPage
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/org/api-calls".format(
client.base_url,
) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This includes all API calls that were made by users in the org.
This endpoint requires authentication by an org admin. It returns the API calls for the authenticated user's org.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This includes all API calls that were made by users in the org.
This endpoint requires authentication by an org admin. It returns the API calls for the authenticated user's org.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -11,11 +11,18 @@ from ...types import Response
def _get_kwargs(
*,
client: Client,
label: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/user/api-tokens".format(
client.base_url,
) # noqa: E501
if label is not None:
if "?" in url:
url = url + "&label=" + str(label)
else:
url = url + "?label=" + str(label)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
@ -54,8 +61,10 @@ def _build_response(
def sync_detailed(
*,
client: Client,
label: Optional[str] = None,
) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs(
label=label,
client=client,
)
@ -70,10 +79,12 @@ def sync_detailed(
def sync(
*,
client: Client,
label: Optional[str] = None,
) -> Optional[Union[ApiToken, Error]]:
"""This endpoint requires authentication by any Zoo user. It creates a new API token for the authenticated user.""" # noqa: E501
return sync_detailed(
label=label,
client=client,
).parsed
@ -81,8 +92,10 @@ def sync(
async def asyncio_detailed(
*,
client: Client,
label: Optional[str] = None,
) -> Response[Optional[Union[ApiToken, Error]]]:
kwargs = _get_kwargs(
label=label,
client=client,
)
@ -95,11 +108,13 @@ async def asyncio_detailed(
async def asyncio(
*,
client: Client,
label: Optional[str] = None,
) -> Optional[Union[ApiToken, Error]]:
"""This endpoint requires authentication by any Zoo user. It creates a new API token for the authenticated user.""" # noqa: E501
return (
await asyncio_detailed(
label=label,
client=client,
)
).parsed

View File

@ -5,7 +5,7 @@ import httpx
from ...client import Client
from ...models.email_authentication_form import EmailAuthenticationForm
from ...models.error import Error
from ...models.verification_token import VerificationToken
from ...models.verification_token_response import VerificationTokenResponse
from ...types import Response
@ -26,15 +26,15 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[VerificationToken, Error]]:
) -> Optional[Union[VerificationTokenResponse, Error]]:
if response.status_code == 201:
response_201 = VerificationToken(**response.json())
response_201 = VerificationTokenResponse(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
@ -47,7 +47,7 @@ def _parse_response(
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[VerificationToken, Error]]]:
) -> Response[Optional[Union[VerificationTokenResponse, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -60,7 +60,7 @@ def sync_detailed(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Response[Optional[Union[VerificationToken, Error]]]:
) -> Response[Optional[Union[VerificationTokenResponse, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
@ -78,7 +78,7 @@ def sync(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[VerificationToken, Error]]:
) -> Optional[Union[VerificationTokenResponse, Error]]:
return sync_detailed(
body=body,
client=client,
@ -89,7 +89,7 @@ async def asyncio_detailed(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Response[Optional[Union[VerificationToken, Error]]]:
) -> Response[Optional[Union[VerificationTokenResponse, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
@ -105,7 +105,7 @@ async def asyncio(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[VerificationToken, Error]]:
) -> Optional[Union[VerificationTokenResponse, Error]]:
return (
await asyncio_detailed(
body=body,

View File

@ -0,0 +1,126 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
provider_id: Uuid,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/auth/saml/provider/{provider_id}/login".format(
client.base_url,
provider_id=provider_id,
) # noqa: E501
if callback_url is not None:
if "?" in url:
url = url + "&callback_url=" + str(callback_url)
else:
url = url + "?callback_url=" + str(callback_url)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
provider_id: Uuid,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
provider_id=provider_id,
callback_url=callback_url,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
provider_id: Uuid,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Optional[Error]:
"""The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.""" # noqa: E501
return sync_detailed(
provider_id=provider_id,
callback_url=callback_url,
client=client,
).parsed
async def asyncio_detailed(
provider_id: Uuid,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
provider_id=provider_id,
callback_url=callback_url,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
provider_id: Uuid,
*,
client: Client,
callback_url: Optional[str] = None,
) -> Optional[Error]:
"""The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.""" # noqa: E501
return (
await asyncio_detailed(
provider_id=provider_id,
callback_url=callback_url,
client=client,
)
).parsed

View File

@ -0,0 +1,117 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
provider_id: Uuid,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/auth/saml/provider/{provider_id}/login".format(
client.base_url,
provider_id=provider_id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
provider_id: Uuid,
body: bytes,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
provider_id=provider_id,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
provider_id: Uuid,
body: bytes,
*,
client: Client,
) -> Optional[Error]:
return sync_detailed(
provider_id=provider_id,
body=body,
client=client,
).parsed
async def asyncio_detailed(
provider_id: Uuid,
body: bytes,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
provider_id=provider_id,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
provider_id: Uuid,
body: bytes,
*,
client: Client,
) -> Optional[Error]:
return (
await asyncio_detailed(
provider_id=provider_id,
body=body,
client=client,
)
).parsed

View File

@ -3,8 +3,8 @@ from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.ai_plugin_manifest import AiPluginManifest
from ...models.error import Error
from ...models.ip_addr_info import IpAddrInfo
from ...types import Response
@ -12,7 +12,7 @@ def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/.well-known/ai-plugin.json".format(
url = "{}/_meta/ipinfo".format(
client.base_url,
) # noqa: E501
@ -27,11 +27,9 @@ def _get_kwargs(
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AiPluginManifest, Error]]:
def _parse_response(*, response: httpx.Response) -> Optional[Union[IpAddrInfo, Error]]:
if response.status_code == 200:
response_200 = AiPluginManifest(**response.json())
response_200 = IpAddrInfo(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
@ -44,7 +42,7 @@ def _parse_response(
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[AiPluginManifest, Error]]]:
) -> Response[Optional[Union[IpAddrInfo, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -56,7 +54,7 @@ def _build_response(
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[AiPluginManifest, Error]]]:
) -> Response[Optional[Union[IpAddrInfo, Error]]]:
kwargs = _get_kwargs(
client=client,
)
@ -72,7 +70,7 @@ def sync_detailed(
def sync(
*,
client: Client,
) -> Optional[Union[AiPluginManifest, Error]]:
) -> Optional[Union[IpAddrInfo, Error]]:
return sync_detailed(
client=client,
).parsed
@ -81,7 +79,7 @@ def sync(
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[AiPluginManifest, Error]]]:
) -> Response[Optional[Union[IpAddrInfo, Error]]]:
kwargs = _get_kwargs(
client=client,
)
@ -95,7 +93,7 @@ async def asyncio_detailed(
async def asyncio(
*,
client: Client,
) -> Optional[Union[AiPluginManifest, Error]]:
) -> Optional[Union[IpAddrInfo, Error]]:
return (
await asyncio_detailed(
client=client,

View File

@ -11,7 +11,7 @@ def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/openai/openapi.json".format(
url = "{}/pricing/subscriptions".format(
client.base_url,
) # noqa: E501
@ -70,7 +70,7 @@ def sync(
*,
client: Client,
) -> Optional[Union[dict, Error]]:
"""This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501
"""This is the ultimate source of truth for the pricing of our subscriptions.""" # noqa: E501
return sync_detailed(
client=client,
@ -95,7 +95,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[dict, Error]]:
"""This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501
"""This is the ultimate source of truth for the pricing of our subscriptions.""" # noqa: E501
return (
await asyncio_detailed(

View File

@ -1 +1 @@
""" Contains methods for accessing the modeling API paths: Modeling API for updating your 3D files using the KittyCAD engine. """ # noqa: E501
""" Contains methods for accessing the modeling API paths: Modeling API for updating your 3D files using the Zoo engine. """ # noqa: E501

View File

@ -0,0 +1 @@
""" Contains methods for accessing the orgs API paths: An organization is a group of users of the Zoo API. Here, we can add users to an org and perform operations on orgs. """ # noqa: E501

View File

@ -0,0 +1,116 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.org import Org
from ...models.org_details import OrgDetails
from ...types import Response
def _get_kwargs(
body: OrgDetails,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
if response.status_code == 201:
response_201 = Org(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Org, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: OrgDetails,
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: OrgDetails,
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by a Zoo user that is not already in an org. It creates a new org for the authenticated user and makes them an admin.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: OrgDetails,
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: OrgDetails,
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by a Zoo user that is not already in an org. It creates a new org for the authenticated user and makes them an admin.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,126 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.add_org_member import AddOrgMember
from ...models.error import Error
from ...models.org_member import OrgMember
from ...types import Response
def _get_kwargs(
body: AddOrgMember,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/members".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[OrgMember, Error]]:
if response.status_code == 201:
response_201 = OrgMember(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[OrgMember, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: AddOrgMember,
*,
client: Client,
) -> Response[Optional[Union[OrgMember, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: AddOrgMember,
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""If the user exists, this will add them to your org. If they do not exist, this will create a new user and add them to your org.
In both cases the user gets an email that they have been added to the org.
If the user is already in your org, this will return a 400 and a message.
If the user is already in a different org, this will return a 400 and a message.
This endpoint requires authentication by an org admin. It adds the specified member to the authenticated user's org.
""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: AddOrgMember,
*,
client: Client,
) -> Response[Optional[Union[OrgMember, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: AddOrgMember,
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""If the user exists, this will add them to your org. If they do not exist, this will create a new user and add them to your org.
In both cases the user gets an email that they have been added to the org.
If the user is already in your org, this will return a 400 and a message.
If the user is already in a different org, this will return a 400 and a message.
This endpoint requires authentication by an org admin. It adds the specified member to the authenticated user's org.
""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,118 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.saml_identity_provider import SamlIdentityProvider
from ...models.saml_identity_provider_create import SamlIdentityProviderCreate
from ...types import Response
def _get_kwargs(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/saml/idp".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[SamlIdentityProvider, Error]]:
if response.status_code == 201:
response_201 = SamlIdentityProvider(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Optional[Union[SamlIdentityProvider, Error]]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Optional[Union[SamlIdentityProvider, Error]]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,106 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Error]:
"""In order to delete an org, you must first delete all of its members, except yourself.
You must also have no outstanding invoices or unpaid balances.
This endpoint requires authentication by an org admin. It deletes the authenticated user's org.
""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Error]:
"""In order to delete an org, you must first delete all of its members, except yourself.
You must also have no outstanding invoices or unpaid balances.
This endpoint requires authentication by an org admin. It deletes the authenticated user's org.
""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,111 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
user_id: Uuid,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/members/{user_id}".format(
client.base_url,
user_id=user_id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
user_id: Uuid,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
user_id=user_id,
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
user_id: Uuid,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It removes the specified member from the authenticated user's org.""" # noqa: E501
return sync_detailed(
user_id=user_id,
client=client,
).parsed
async def asyncio_detailed(
user_id: Uuid,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
user_id=user_id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
user_id: Uuid,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It removes the specified member from the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
user_id=user_id,
client=client,
)
).parsed

View File

@ -0,0 +1,100 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/saml/idp".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,116 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.org import Org
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
id: Uuid,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/orgs/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
if response.status_code == 200:
response_200 = Org(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Org, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: Uuid,
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by a Zoo employee. It gets the information for the specified org.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: Uuid,
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by a Zoo employee. It gets the information for the specified org.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,105 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.org import Org
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
if response.status_code == 200:
response_200 = Org(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Org, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by an org admin. It gets the authenticated user's org.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by an org admin. It gets the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,116 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.org_member import OrgMember
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
user_id: Uuid,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/members/{user_id}".format(
client.base_url,
user_id=user_id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[OrgMember, Error]]:
if response.status_code == 200:
response_200 = OrgMember(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[OrgMember, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
user_id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[OrgMember, Error]]]:
kwargs = _get_kwargs(
user_id=user_id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
user_id: Uuid,
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""This endpoint requires authentication by an org admin. It gets the specified member of the authenticated user's org.""" # noqa: E501
return sync_detailed(
user_id=user_id,
client=client,
).parsed
async def asyncio_detailed(
user_id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[OrgMember, Error]]]:
kwargs = _get_kwargs(
user_id=user_id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
user_id: Uuid,
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""This endpoint requires authentication by an org admin. It gets the specified member of the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
user_id=user_id,
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.privacy_settings import PrivacySettings
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/privacy".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[PrivacySettings, Error]]:
if response.status_code == 200:
response_200 = PrivacySettings(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[PrivacySettings, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by an org admin. It gets the privacy settings for the authenticated user's org.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by an org admin. It gets the privacy settings for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.saml_identity_provider import SamlIdentityProvider
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/saml/idp".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[SamlIdentityProvider, Error]]:
if response.status_code == 200:
response_200 = SamlIdentityProvider(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[SamlIdentityProvider, Error]]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[SamlIdentityProvider, Error]]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.user_org_info import UserOrgInfo
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/org".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[UserOrgInfo, Error]]:
if response.status_code == 200:
response_200 = UserOrgInfo(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[UserOrgInfo, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[UserOrgInfo, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[UserOrgInfo, Error]]:
"""This endpoint requires authentication by any Zoo user. It gets the authenticated user's org.
If the user is not a member of an org, this endpoint will return a 404.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[UserOrgInfo, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[UserOrgInfo, Error]]:
"""This endpoint requires authentication by any Zoo user. It gets the authenticated user's org.
If the user is not a member of an org, this endpoint will return a 404.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,169 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...models.org_member_results_page import OrgMemberResultsPage
from ...models.user_org_role import UserOrgRole
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/org/members".format(
client.base_url,
) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
if role is not None:
if "?" in url:
url = url + "&role=" + str(role)
else:
url = url + "?role=" + str(role)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[OrgMemberResultsPage, Error]]:
if response.status_code == 200:
response_200 = OrgMemberResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[OrgMemberResultsPage, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[OrgMemberResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
role=role,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[OrgMemberResultsPage, Error]]:
"""This endpoint requires authentication by an org admin. It lists the members of the authenticated user's org.""" # noqa: E501
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
role=role,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[OrgMemberResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
role=role,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[OrgMemberResultsPage, Error]]:
"""This endpoint requires authentication by an org admin. It lists the members of the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
role=role,
client=client,
)
).parsed

View File

@ -0,0 +1,153 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...models.org_results_page import OrgResultsPage
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/orgs".format(
client.base_url,
) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[OrgResultsPage, Error]]:
if response.status_code == 200:
response_200 = OrgResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[OrgResultsPage, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[OrgResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[OrgResultsPage, Error]]:
"""This endpoint requires authentication by a Zoo employee. The orgs are returned in order of creation, with the most recently created orgs first.""" # noqa: E501
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[OrgResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[OrgResultsPage, Error]]:
"""This endpoint requires authentication by a Zoo employee. The orgs are returned in order of creation, with the most recently created orgs first.""" # noqa: E501
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1,129 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.subscription_tier_price import SubscriptionTierPrice
from ...models.uuid import Uuid
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
from ...types import Response
def _get_kwargs(
id: Uuid,
body: SubscriptionTierPrice,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/orgs/{id}/enterprise/pricing".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ZooProductSubscriptions, Error]]:
if response.status_code == 200:
response_200 = ZooProductSubscriptions(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: Uuid,
body: SubscriptionTierPrice,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
id=id,
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: Uuid,
body: SubscriptionTierPrice,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""You must be a Zoo employee to perform this request.""" # noqa: E501
return sync_detailed(
id=id,
body=body,
client=client,
).parsed
async def asyncio_detailed(
id: Uuid,
body: SubscriptionTierPrice,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
id=id,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
id: Uuid,
body: SubscriptionTierPrice,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""You must be a Zoo employee to perform this request.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,116 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.org import Org
from ...models.org_details import OrgDetails
from ...types import Response
def _get_kwargs(
body: OrgDetails,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
if response.status_code == 200:
response_200 = Org(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Org, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: OrgDetails,
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: OrgDetails,
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by an org admin. It updates the authenticated user's org.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: OrgDetails,
*,
client: Client,
) -> Response[Optional[Union[Org, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
body: OrgDetails,
*,
client: Client,
) -> Optional[Union[Org, Error]]:
"""This endpoint requires authentication by an org admin. It updates the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,127 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.org_member import OrgMember
from ...models.update_member_to_org_body import UpdateMemberToOrgBody
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
user_id: Uuid,
body: UpdateMemberToOrgBody,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/members/{user_id}".format(
client.base_url,
user_id=user_id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[OrgMember, Error]]:
if response.status_code == 200:
response_200 = OrgMember(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[OrgMember, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
user_id: Uuid,
body: UpdateMemberToOrgBody,
*,
client: Client,
) -> Response[Optional[Union[OrgMember, Error]]]:
kwargs = _get_kwargs(
user_id=user_id,
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
user_id: Uuid,
body: UpdateMemberToOrgBody,
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""This endpoint requires authentication by an org admin. It updates the specified member of the authenticated user's org.""" # noqa: E501
return sync_detailed(
user_id=user_id,
body=body,
client=client,
).parsed
async def asyncio_detailed(
user_id: Uuid,
body: UpdateMemberToOrgBody,
*,
client: Client,
) -> Response[Optional[Union[OrgMember, Error]]]:
kwargs = _get_kwargs(
user_id=user_id,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
user_id: Uuid,
body: UpdateMemberToOrgBody,
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""This endpoint requires authentication by an org admin. It updates the specified member of the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
user_id=user_id,
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,117 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.privacy_settings import PrivacySettings
from ...types import Response
def _get_kwargs(
body: PrivacySettings,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/privacy".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[PrivacySettings, Error]]:
if response.status_code == 200:
response_200 = PrivacySettings(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[PrivacySettings, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: PrivacySettings,
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: PrivacySettings,
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by an org admin. It updates the privacy settings for the authenticated user's org.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: PrivacySettings,
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
body: PrivacySettings,
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by an org admin. It updates the privacy settings for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,118 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.saml_identity_provider import SamlIdentityProvider
from ...models.saml_identity_provider_create import SamlIdentityProviderCreate
from ...types import Response
def _get_kwargs(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/saml/idp".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[SamlIdentityProvider, Error]]:
if response.status_code == 200:
response_200 = SamlIdentityProvider(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Optional[Union[SamlIdentityProvider, Error]]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
body: SamlIdentityProviderCreate,
*,
client: Client,
) -> Optional[Union[SamlIdentityProvider, Error]]:
"""This endpoint requires authentication by an org admin.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,120 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
from ...models.zoo_product_subscriptions_org_request import (
ZooProductSubscriptionsOrgRequest,
)
from ...types import Response
def _get_kwargs(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/subscriptions".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ZooProductSubscriptions, Error]]:
if response.status_code == 201:
response_201 = ZooProductSubscriptions(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by an org admin. It creates the subscription for the authenticated user's org.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by an org admin. It creates the subscription for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,120 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.billing_info import BillingInfo
from ...models.customer import Customer
from ...models.error import Error
from ...types import Response
def _get_kwargs(
body: BillingInfo,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
if response.status_code == 201:
response_201 = Customer(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Customer, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: BillingInfo,
*,
client: Client,
) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by the org admin. It creates the payment information for the authenticated user's org.
""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: BillingInfo,
*,
client: Client,
) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by the org admin. It creates the payment information for the authenticated user's org.
""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -26,7 +26,7 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
"content": body.model_dump_json(),
}

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.payment_intent import PaymentIntent
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/intent".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[PaymentIntent, Error]]:
if response.status_code == 201:
response_201 = PaymentIntent(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[PaymentIntent, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[PaymentIntent, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[PaymentIntent, Error]]:
"""This endpoint requires authentication by the org admin. It creates a new payment intent for the authenticated user's org's org.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[PaymentIntent, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[PaymentIntent, Error]]:
"""This endpoint requires authentication by the org admin. It creates a new payment intent for the authenticated user's org's org.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,120 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
from ...models.zoo_product_subscriptions_user_request import (
ZooProductSubscriptionsUserRequest,
)
from ...types import Response
def _get_kwargs(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/subscriptions".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ZooProductSubscriptions, Error]]:
if response.status_code == 201:
response_201 = ZooProductSubscriptions(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by any Zoo user. It creates the subscription for the user.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by any Zoo user. It creates the subscription for the user.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,104 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Error]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by an org admin. It deletes the payment information for the authenticated user's org.
""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Error]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by an org admin. It deletes the payment information for the authenticated user's org.
""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,110 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/methods/{id}".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It deletes the specified payment method for the authenticated user's org.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It deletes the specified payment method for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/subscriptions".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ZooProductSubscriptions, Error]]:
if response.status_code == 200:
response_200 = ZooProductSubscriptions(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by an org admin. It gets the subscription for the authenticated user's org.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by an org admin. It gets the subscription for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,118 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
id: Uuid,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/orgs/{id}/payment/balance".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[CustomerBalance, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: Uuid,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified org.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: Uuid,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified org.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,118 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
id: Uuid,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/users/{id}/payment/balance".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[CustomerBalance, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: Uuid,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified user.""" # noqa: E501
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: Uuid,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: Uuid,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified user.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/balance".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[CustomerBalance, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by an org admin. It gets the balance information for the authenticated user's org.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by an org admin. It gets the balance information for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,109 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.customer import Customer
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
if response.status_code == 200:
response_200 = Customer(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Customer, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by an org admin. It gets the payment information for the authenticated user's org.
""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by an org admin. It gets the payment information for the authenticated user's org.
""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/subscriptions".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ZooProductSubscriptions, Error]]:
if response.status_code == 200:
response_200 = ZooProductSubscriptions(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by any Zoo user. It gets the subscription for the user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by any Zoo user. It gets the subscription for the user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, List, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.invoice import Invoice
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/invoices".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[Invoice], Error]]:
if response.status_code == 200:
response_200 = [Invoice(**item) for item in response.json()]
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[List[Invoice], Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[List[Invoice], Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[List[Invoice], Error]]:
"""This endpoint requires authentication by an org admin. It lists invoices for the authenticated user's org.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[List[Invoice], Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[List[Invoice], Error]]:
"""This endpoint requires authentication by an org admin. It lists invoices for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, List, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.payment_method import PaymentMethod
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/methods".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[PaymentMethod], Error]]:
if response.status_code == 200:
response_200 = [PaymentMethod(**item) for item in response.json()]
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[List[PaymentMethod], Error]]:
"""This endpoint requires authentication by an org admin. It lists payment methods for the authenticated user's org.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[List[PaymentMethod], Error]]:
"""This endpoint requires authentication by an org admin. It lists payment methods for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,120 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
from ...models.zoo_product_subscriptions_org_request import (
ZooProductSubscriptionsOrgRequest,
)
from ...types import Response
def _get_kwargs(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/subscriptions".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ZooProductSubscriptions, Error]]:
if response.status_code == 200:
response_200 = ZooProductSubscriptions(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by an org admin. It updates the subscription for the authenticated user's org.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
body: ZooProductSubscriptionsOrgRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by an org admin. It updates the subscription for the authenticated user's org.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,129 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...models.update_payment_balance import UpdatePaymentBalance
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/orgs/{id}/payment/balance".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[CustomerBalance, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified org.""" # noqa: E501
return sync_detailed(
id=id,
body=body,
client=client,
).parsed
async def asyncio_detailed(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified org.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,129 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.customer_balance import CustomerBalance
from ...models.error import Error
from ...models.update_payment_balance import UpdatePaymentBalance
from ...models.uuid import Uuid
from ...types import Response
def _get_kwargs(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/users/{id}/payment/balance".format(
client.base_url,
id=id,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[CustomerBalance, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified user.""" # noqa: E501
return sync_detailed(
id=id,
body=body,
client=client,
).parsed
async def asyncio_detailed(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Response[Optional[Union[CustomerBalance, Error]]]:
kwargs = _get_kwargs(
id=id,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
id: Uuid,
body: UpdatePaymentBalance,
*,
client: Client,
) -> Optional[Union[CustomerBalance, Error]]:
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified user.""" # noqa: E501
return (
await asyncio_detailed(
id=id,
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,120 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.billing_info import BillingInfo
from ...models.customer import Customer
from ...models.error import Error
from ...types import Response
def _get_kwargs(
body: BillingInfo,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
if response.status_code == 200:
response_200 = Customer(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Customer, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: BillingInfo,
*,
client: Client,
) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by an org admin. It updates the payment information for the authenticated user's org.
""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: BillingInfo,
*,
client: Client,
) -> Response[Optional[Union[Customer, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
body: BillingInfo,
*,
client: Client,
) -> Optional[Union[Customer, Error]]:
"""This includes billing address, phone, and name.
This endpoint requires authentication by an org admin. It updates the payment information for the authenticated user's org.
""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -26,7 +26,7 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
"content": body.model_dump_json(),
}

View File

@ -0,0 +1,120 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
from ...models.zoo_product_subscriptions_user_request import (
ZooProductSubscriptionsUserRequest,
)
from ...types import Response
def _get_kwargs(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/payment/subscriptions".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ZooProductSubscriptions, Error]]:
if response.status_code == 200:
response_200 = ZooProductSubscriptions(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by any Zoo user. It updates the subscription for the user.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
body: ZooProductSubscriptionsUserRequest,
*,
client: Client,
) -> Optional[Union[ZooProductSubscriptions, Error]]:
"""This endpoint requires authentication by any Zoo user. It updates the subscription for the user.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,100 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/payment/tax".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It will return an error if the org's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It will return an error if the org's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -66,7 +66,7 @@ def sync(
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by any Zoo user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
"""This endpoint requires authentication by any Zoo user. It will return an error if the user's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
return sync_detailed(
client=client,
@ -91,7 +91,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by any Zoo user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
"""This endpoint requires authentication by any Zoo user. It will return an error if the user's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
return (
await asyncio_detailed(

View File

@ -0,0 +1 @@
""" Contains methods for accessing the service_accounts API paths: Service accounts allow organizations to call the API. Organization admins can create, delete, and list the service accounts for their org. Service accounts are scoped to an organization not individual users, these are better to use for automations than individual API tokens, since they won't stop working when an individual leaves the company. """ # noqa: E501

View File

@ -0,0 +1,122 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.service_account import ServiceAccount
from ...types import Response
def _get_kwargs(
*,
client: Client,
label: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/org/service-accounts".format(
client.base_url,
) # noqa: E501
if label is not None:
if "?" in url:
url = url + "&label=" + str(label)
else:
url = url + "?label=" + str(label)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ServiceAccount, Error]]:
if response.status_code == 201:
response_201 = ServiceAccount(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ServiceAccount, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
label: Optional[str] = None,
) -> Response[Optional[Union[ServiceAccount, Error]]]:
kwargs = _get_kwargs(
label=label,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
label: Optional[str] = None,
) -> Optional[Union[ServiceAccount, Error]]:
"""This endpoint requires authentication by an org admin. It creates a new service account for the organization.""" # noqa: E501
return sync_detailed(
label=label,
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
label: Optional[str] = None,
) -> Response[Optional[Union[ServiceAccount, Error]]]:
kwargs = _get_kwargs(
label=label,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
label: Optional[str] = None,
) -> Optional[Union[ServiceAccount, Error]]:
"""This endpoint requires authentication by an org admin. It creates a new service account for the organization.""" # noqa: E501
return (
await asyncio_detailed(
label=label,
client=client,
)
).parsed

View File

@ -0,0 +1,114 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/service-accounts/{token}".format(
client.base_url,
token=token,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.
This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.
""" # noqa: E501
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
token: str,
*,
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.
This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.
""" # noqa: E501
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

@ -0,0 +1,117 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.service_account import ServiceAccount
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/org/service-accounts/{token}".format(
client.base_url,
token=token,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ServiceAccount, Error]]:
if response.status_code == 200:
response_200 = ServiceAccount(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ServiceAccount, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
) -> Response[Optional[Union[ServiceAccount, Error]]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
) -> Optional[Union[ServiceAccount, Error]]:
"""This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.""" # noqa: E501
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
) -> Response[Optional[Union[ServiceAccount, Error]]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
token: str,
*,
client: Client,
) -> Optional[Union[ServiceAccount, Error]]:
"""This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.""" # noqa: E501
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

@ -0,0 +1,157 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...models.error import Error
from ...models.service_account_results_page import ServiceAccountResultsPage
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/org/service-accounts".format(
client.base_url,
) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ServiceAccountResultsPage, Error]]:
if response.status_code == 200:
response_200 = ServiceAccountResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ServiceAccountResultsPage, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[ServiceAccountResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ServiceAccountResultsPage, Error]]:
"""This endpoint requires authentication by an org admin. It returns the service accounts for the organization.
The service accounts are returned in order of creation, with the most recently created service accounts first.
""" # noqa: E501
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[ServiceAccountResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ServiceAccountResultsPage, Error]]:
"""This endpoint requires authentication by an org admin. It returns the service accounts for the organization.
The service accounts are returned in order of creation, with the most recently created service accounts first.
""" # noqa: E501
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1 @@
""" Contains methods for accessing the store API paths: Operations involving our swag store. """ # noqa: E501

View File

@ -0,0 +1,118 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.discount_code import DiscountCode
from ...models.error import Error
from ...models.store_coupon_params import StoreCouponParams
from ...types import Response
def _get_kwargs(
body: StoreCouponParams,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/store/coupon".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[DiscountCode, Error]]:
if response.status_code == 201:
response_201 = DiscountCode(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[DiscountCode, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: StoreCouponParams,
*,
client: Client,
) -> Response[Optional[Union[DiscountCode, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: StoreCouponParams,
*,
client: Client,
) -> Optional[Union[DiscountCode, Error]]:
"""This endpoint requires authentication by a Zoo employee. It creates a new store coupon.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: StoreCouponParams,
*,
client: Client,
) -> Response[Optional[Union[DiscountCode, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: StoreCouponParams,
*,
client: Client,
) -> Optional[Union[DiscountCode, Error]]:
"""This endpoint requires authentication by a Zoo employee. It creates a new store coupon.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1 +1 @@
""" Contains methods for accessing the users API paths: A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves. """ # noqa: E501
""" Contains methods for accessing the users API paths: A user is someone who uses the Zoo API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves. """ # noqa: E501

View File

@ -0,0 +1,111 @@
from typing import Any, Dict, List, Optional, Union
import httpx
from ...client import Client
from ...models.account_provider import AccountProvider
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/oauth2/providers".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[AccountProvider], Error]]:
if response.status_code == 200:
response_200 = [AccountProvider(**item) for item in response.json()]
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[List[AccountProvider], Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[List[AccountProvider], Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[List[AccountProvider], Error]]:
"""If this returns an empty array, then the user has not connected any OAuth2 providers and uses raw email authentication.
This endpoint requires authentication by any Zoo user. It gets the providers for the authenticated user.
""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[List[AccountProvider], Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[List[AccountProvider], Error]]:
"""If this returns an empty array, then the user has not connected any OAuth2 providers and uses raw email authentication.
This endpoint requires authentication by any Zoo user. It gets the providers for the authenticated user.
""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,107 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.privacy_settings import PrivacySettings
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/privacy".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[PrivacySettings, Error]]:
if response.status_code == 200:
response_200 = PrivacySettings(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[PrivacySettings, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by any Zoo user. It gets the privacy settings for the user.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by any Zoo user. It gets the privacy settings for the user.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -104,7 +104,7 @@ def sync(
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[UserResultsPage, Error]]:
"""This endpoint required authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
"""This endpoint requires authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
return sync_detailed(
limit=limit,
@ -141,7 +141,7 @@ async def asyncio(
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[UserResultsPage, Error]]:
"""This endpoint required authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
"""This endpoint requires authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
return (
await asyncio_detailed(

View File

@ -104,7 +104,7 @@ def sync(
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ExtendedUserResultsPage, Error]]:
"""This endpoint required authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
"""This endpoint requires authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
return sync_detailed(
limit=limit,
@ -141,7 +141,7 @@ async def asyncio(
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ExtendedUserResultsPage, Error]]:
"""This endpoint required authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
"""This endpoint requires authentication by a Zoo employee. The users are returned in order of creation, with the most recently created users first.""" # noqa: E501
return (
await asyncio_detailed(

View File

@ -0,0 +1,117 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.privacy_settings import PrivacySettings
from ...types import Response
def _get_kwargs(
body: PrivacySettings,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/privacy".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[PrivacySettings, Error]]:
if response.status_code == 200:
response_200 = PrivacySettings(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[PrivacySettings, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: PrivacySettings,
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.put(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: PrivacySettings,
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by any Zoo user. It updates the privacy settings for the user.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: PrivacySettings,
*,
client: Client,
) -> Response[Optional[Union[PrivacySettings, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.put(**kwargs)
return _build_response(response=response)
async def asyncio(
body: PrivacySettings,
*,
client: Client,
) -> Optional[Union[PrivacySettings, Error]]:
"""This endpoint requires authentication by any Zoo user. It updates the privacy settings for the user.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -26,7 +26,7 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
"content": body.model_dump_json(),
}

View File

@ -13,7 +13,7 @@ class Client:
base_url: str = attr.ib(default="https://api.kittycad.io")
cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
timeout: float = attr.ib(50.0, kw_only=True)
timeout: float = attr.ib(120.0, kw_only=True)
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
def get_headers(self) -> Dict[str, str]:

View File

@ -1,12 +1,19 @@
import json
import os
import time
import uuid
from typing import Optional, Union
import pytest
from .api.ai import create_text_to_cad, get_text_to_cad_model_for_user
from .api.api_tokens import list_api_tokens_for_user
from .api.file import create_file_conversion, create_file_mass, create_file_volume
from .api.file import (
create_file_center_of_mass,
create_file_conversion,
create_file_mass,
create_file_volume,
)
from .api.meta import ping
from .api.modeling import modeling_commands_ws
from .api.users import get_user_self, list_users_extended
@ -20,6 +27,7 @@ from .models import (
Direction,
Error,
ExtendedUserResultsPage,
FileCenterOfMass,
FileConversion,
FileExportFormat,
FileImportFormat,
@ -32,6 +40,8 @@ from .models import (
ModelingCmdId,
Pong,
System,
TextToCad,
TextToCadCreateBody,
UnitDensity,
UnitLength,
UnitMass,
@ -294,6 +304,37 @@ def test_file_volume():
assert fv.status == ApiCallStatus.COMPLETED
def test_file_center_of_mass():
# Create our client.
client = ClientFromEnv()
dir_path = os.path.dirname(os.path.realpath(__file__))
file = open(os.path.join(dir_path, "../assets/testing.obj"), "rb")
content = file.read()
file.close()
# Get the fc.
result: Union[FileCenterOfMass, Error, None] = create_file_center_of_mass.sync(
client=client,
body=content,
src_format=FileImportFormat.OBJ,
output_unit=UnitLength.CM,
)
assert isinstance(result, FileCenterOfMass)
fv: FileCenterOfMass = result
print(f"FileCenterOfMass: {fv}")
assert fv.id is not None
assert fv.center_of_mass is not None
assert fv.model_dump_json() is not None
assert fv.status == ApiCallStatus.COMPLETED
def test_list_users():
# Create our client.
client = ClientFromEnv()
@ -489,3 +530,43 @@ def test_serialize_deserialize():
assert model_dump["resp"]["type"] == "modeling" # type: ignore
assert model_dump["resp"]["data"]["modeling_response"]["type"] == "import_files" # type: ignore
assert model_dump["resp"]["data"]["modeling_response"]["data"]["object_id"] == "f61ac02e-77bd-468f-858f-fd4141a26acd" # type: ignore
def test_text_to_cad():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(
client=client,
output_format=FileExportFormat.STEP,
body=TextToCadCreateBody(
prompt="a 2x4 lego",
),
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: TextToCad = result
# Poll the api until the status is completed.
# Timeout after some seconds.
start_time = time.time()
while (
body.status == ApiCallStatus.IN_PROGRESS or body.status == ApiCallStatus.QUEUED
) and time.time() - start_time < 120:
result_status: Optional[
Union[TextToCad, Error]
] = get_text_to_cad_model_for_user.sync(
client=client,
id=body.id,
)
if isinstance(result_status, Error) or result_status is None:
print(result_status)
raise Exception("Error in response")
body = result_status
assert body.status == ApiCallStatus.COMPLETED

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,9 @@
""" Contains all the data models used in inputs/outputs """
from .account_provider import AccountProvider
from .add_org_member import AddOrgMember
from .address_details import AddressDetails
from .ai_feedback import AiFeedback
from .ai_plugin_api import AiPluginApi
from .ai_plugin_api_type import AiPluginApiType
from .ai_plugin_auth import AiPluginAuth
from .ai_plugin_auth_type import AiPluginAuthType
from .ai_plugin_http_auth_type import AiPluginHttpAuthType
from .ai_plugin_manifest import AiPluginManifest
from .ai_prompt import AiPrompt
from .ai_prompt_results_page import AiPromptResultsPage
from .ai_prompt_type import AiPromptType
@ -32,9 +28,11 @@ from .async_api_call import AsyncApiCall
from .async_api_call_output import AsyncApiCallOutput
from .async_api_call_results_page import AsyncApiCallResultsPage
from .async_api_call_type import AsyncApiCallType
from .auth_callback import AuthCallback
from .axis import Axis
from .axis_direction_pair import AxisDirectionPair
from .billing_info import BillingInfo
from .block_reason import BlockReason
from .cache_metadata import CacheMetadata
from .camera_drag_interaction_type import CameraDragInteractionType
from .card_details import CardDetails
@ -56,14 +54,17 @@ from .curve_type import CurveType
from .customer import Customer
from .customer_balance import CustomerBalance
from .density import Density
from .der_encoded_key_pair import DerEncodedKeyPair
from .device_access_token_request_form import DeviceAccessTokenRequestForm
from .device_auth_request_form import DeviceAuthRequestForm
from .device_auth_verify_params import DeviceAuthVerifyParams
from .direction import Direction
from .discount import Discount
from .discount_code import DiscountCode
from .distance_type import DistanceType
from .email_authentication_form import EmailAuthenticationForm
from .empty import Empty
from .entity_circular_pattern import EntityCircularPattern
from .entity_get_all_child_uuids import EntityGetAllChildUuids
from .entity_get_child_uuid import EntityGetChildUuid
from .entity_get_distance import EntityGetDistance
@ -78,6 +79,8 @@ from .export import Export
from .export_file import ExportFile
from .extended_user import ExtendedUser
from .extended_user_results_page import ExtendedUserResultsPage
from .extrusion_face_cap_type import ExtrusionFaceCapType
from .extrusion_face_info import ExtrusionFaceInfo
from .failure_web_socket_response import FailureWebSocketResponse
from .fbx_storage import FbxStorage
from .file_center_of_mass import FileCenterOfMass
@ -97,6 +100,7 @@ from .gltf_presentation import GltfPresentation
from .gltf_storage import GltfStorage
from .highlight_set_entity import HighlightSetEntity
from .ice_server import IceServer
from .idp_metadata_source import IdpMetadataSource
from .image_format import ImageFormat
from .import_file import ImportFile
from .import_files import ImportFiles
@ -104,25 +108,43 @@ from .input_format import InputFormat
from .invoice import Invoice
from .invoice_line_item import InvoiceLineItem
from .invoice_status import InvoiceStatus
from .ip_addr_info import IpAddrInfo
from .jetstream import Jetstream
from .jetstream_api_stats import JetstreamApiStats
from .jetstream_config import JetstreamConfig
from .jetstream_stats import JetstreamStats
from .kcl_code_completion_params import KclCodeCompletionParams
from .kcl_code_completion_request import KclCodeCompletionRequest
from .kcl_code_completion_response import KclCodeCompletionResponse
from .leaf_node import LeafNode
from .length_unit import LengthUnit
from .mass import Mass
from .meta_cluster_info import MetaClusterInfo
from .metadata import Metadata
from .method import Method
from .modeling_app_individual_subscription_tier import (
ModelingAppIndividualSubscriptionTier,
)
from .modeling_app_organization_subscription_tier import (
ModelingAppOrganizationSubscriptionTier,
)
from .modeling_app_subscription_tier import ModelingAppSubscriptionTier
from .modeling_app_subscription_tier_name import ModelingAppSubscriptionTierName
from .modeling_cmd import ModelingCmd
from .modeling_cmd_id import ModelingCmdId
from .modeling_cmd_req import ModelingCmdReq
from .mouse_click import MouseClick
from .new_address import NewAddress
from .o_auth2_client_info import OAuth2ClientInfo
from .o_auth2_grant_type import OAuth2GrantType
from .ok_modeling_cmd_response import OkModelingCmdResponse
from .ok_web_socket_response_data import OkWebSocketResponseData
from .onboarding import Onboarding
from .org import Org
from .org_details import OrgDetails
from .org_member import OrgMember
from .org_member_results_page import OrgMemberResultsPage
from .org_results_page import OrgResultsPage
from .org_role import OrgRole
from .output_file import OutputFile
from .output_format import OutputFormat
from .path_command import PathCommand
@ -137,28 +159,42 @@ from .payment_intent import PaymentIntent
from .payment_method import PaymentMethod
from .payment_method_card_checks import PaymentMethodCardChecks
from .payment_method_type import PaymentMethodType
from .perspective_camera_parameters import PerspectiveCameraParameters
from .plan_interval import PlanInterval
from .plane_intersect_and_project import PlaneIntersectAndProject
from .ply_storage import PlyStorage
from .point2d import Point2d
from .point3d import Point3d
from .pong import Pong
from .privacy_settings import PrivacySettings
from .raw_file import RawFile
from .rtc_ice_candidate_init import RtcIceCandidateInit
from .rtc_sdp_type import RtcSdpType
from .rtc_session_description import RtcSessionDescription
from .saml_identity_provider import SamlIdentityProvider
from .saml_identity_provider_create import SamlIdentityProviderCreate
from .scene_selection_type import SceneSelectionType
from .scene_tool_type import SceneToolType
from .select_get import SelectGet
from .select_with_point import SelectWithPoint
from .selection import Selection
from .service_account import ServiceAccount
from .service_account_results_page import ServiceAccountResultsPage
from .session import Session
from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from .solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
from .solid3d_get_extrusion_face_info import Solid3dGetExtrusionFaceInfo
from .solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge
from .solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from .solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
from .stl_storage import StlStorage
from .store_coupon_params import StoreCouponParams
from .subscription_tier_feature import SubscriptionTierFeature
from .subscription_tier_price import SubscriptionTierPrice
from .subscription_tier_type import SubscriptionTierType
from .subscription_training_data_behavior import SubscriptionTrainingDataBehavior
from .success_web_socket_response import SuccessWebSocketResponse
from .support_tier import SupportTier
from .surface_area import SurfaceArea
from .system import System
from .take_snapshot import TakeSnapshot
@ -192,11 +228,20 @@ from .unit_torque import UnitTorque
from .unit_torque_conversion import UnitTorqueConversion
from .unit_volume import UnitVolume
from .unit_volume_conversion import UnitVolumeConversion
from .update_member_to_org_body import UpdateMemberToOrgBody
from .update_payment_balance import UpdatePaymentBalance
from .update_user import UpdateUser
from .user import User
from .user_org_info import UserOrgInfo
from .user_org_role import UserOrgRole
from .user_results_page import UserResultsPage
from .uuid import Uuid
from .verification_token import VerificationToken
from .verification_token_response import VerificationTokenResponse
from .volume import Volume
from .web_socket_request import WebSocketRequest
from .web_socket_response import WebSocketResponse
from .zoo_product_subscription import ZooProductSubscription
from .zoo_product_subscriptions import ZooProductSubscriptions
from .zoo_product_subscriptions_org_request import ZooProductSubscriptionsOrgRequest
from .zoo_product_subscriptions_user_request import ZooProductSubscriptionsUserRequest
from .zoo_tool import ZooTool

View File

@ -4,12 +4,20 @@ from enum import Enum
class AccountProvider(str, Enum):
"""An account provider.""" # noqa: E501
"""# The Apple account provider. """ # noqa: E501
APPLE = "apple"
"""# The Discord account provider. """ # noqa: E501
DISCORD = "discord"
"""# The Google account provider. """ # noqa: E501
GOOGLE = "google"
"""# The GitHub account provider. """ # noqa: E501
GITHUB = "github"
"""# The Microsoft account provider. """ # noqa: E501
MICROSOFT = "microsoft"
"""# The SAML account provider. """ # noqa: E501
SAML = "saml"
"""# The Tencent QQ account provider. """ # noqa: E501
TENCENT = "tencent"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,14 @@
from pydantic import BaseModel, ConfigDict
from ..models.user_org_role import UserOrgRole
class AddOrgMember(BaseModel):
"""Data for adding a member to an org."""
email: str
role: UserOrgRole
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,23 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.country_code import CountryCode
class AddressDetails(BaseModel):
"""Address details."""
city: Optional[str] = None
country: CountryCode
state: Optional[str] = None
street1: Optional[str] = None
street2: Optional[str] = None
zip: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,15 +0,0 @@
from typing import Optional
from pydantic import BaseModel
from ..models.ai_plugin_api_type import AiPluginApiType
class AiPluginApi(BaseModel):
"""AI plugin api information."""
is_user_authenticated: Optional[bool] = None
type: Optional[AiPluginApiType] = None
url: str

View File

@ -1,11 +0,0 @@
from enum import Enum
class AiPluginApiType(str, Enum):
"""AI plugin api type.""" # noqa: E501
"""# An OpenAPI specification. """ # noqa: E501
OPENAPI = "openapi"
def __str__(self) -> str:
return str(self.value)

View File

@ -1,14 +0,0 @@
from typing import Optional
from pydantic import BaseModel
from ..models.ai_plugin_auth_type import AiPluginAuthType
from ..models.ai_plugin_http_auth_type import AiPluginHttpAuthType
class AiPluginAuth(BaseModel):
"""AI plugin auth information."""
authorization_type: Optional[AiPluginHttpAuthType] = None
type: Optional[AiPluginAuthType] = None

View File

@ -1,17 +0,0 @@
from enum import Enum
class AiPluginAuthType(str, Enum):
"""AI plugin auth type.""" # noqa: E501
"""# None. """ # noqa: E501
NONE = "none"
"""# User http. """ # noqa: E501
USER_HTTP = "user_http"
"""# Service http. """ # noqa: E501
SERVICE_HTTP = "service_http"
"""# OAuth. """ # noqa: E501
OAUTH = "oauth"
def __str__(self) -> str:
return str(self.value)

View File

@ -1,13 +0,0 @@
from enum import Enum
class AiPluginHttpAuthType(str, Enum):
"""AI plugin http auth type.""" # noqa: E501
"""# Basic. """ # noqa: E501
BASIC = "basic"
"""# Bearer. """ # noqa: E501
BEARER = "bearer"
def __str__(self) -> str:
return str(self.value)

View File

@ -1,33 +0,0 @@
from typing import Optional
from pydantic import BaseModel
from ..models.ai_plugin_api import AiPluginApi
from ..models.ai_plugin_auth import AiPluginAuth
class AiPluginManifest(BaseModel):
"""AI plugin manifest.
This is used for OpenAI's ChatGPT plugins. You can read more about them [here](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest).
"""
api: AiPluginApi
auth: AiPluginAuth
contact_email: Optional[str] = None
description_for_human: Optional[str] = None
description_for_model: Optional[str] = None
legal_info_url: str
logo_url: str
name_for_human: Optional[str] = None
name_for_model: Optional[str] = None
schema_version: Optional[str] = None

View File

@ -1,7 +1,7 @@
import datetime
from typing import Any, Optional
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from ..models.ai_feedback import AiFeedback
from ..models.ai_prompt_type import AiPromptType
@ -39,3 +39,5 @@ class AiPrompt(BaseModel):
updated_at: datetime.datetime
user_id: Uuid
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,6 +1,6 @@
from typing import List, Optional
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from ..models.ai_prompt import AiPrompt
@ -11,3 +11,5 @@ class AiPromptResultsPage(BaseModel):
items: List[AiPrompt]
next_page: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,5 +1,5 @@
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from ..models.unit_angle import UnitAngle
@ -10,3 +10,5 @@ class Angle(BaseModel):
unit: UnitAngle
value: float
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,5 +1,5 @@
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from ..models.annotation_line_end import AnnotationLineEnd
@ -10,3 +10,5 @@ class AnnotationLineEndOptions(BaseModel):
end: AnnotationLineEnd
start: AnnotationLineEnd
model_config = ConfigDict(protected_namespaces=())

Some files were not shown because too many files have changed in this diff Show More