Compare commits

..

26 Commits

Author SHA1 Message Date
79b977a55a fix test
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-05 13:30:47 -07:00
df9083c3e2 bump version
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-05 13:13:34 -07:00
f3e7f4f229 fix new spec bs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-05 13:12:19 -07:00
12864cdb44 Merge remote-tracking branch 'origin/update-spec'
* origin/update-spec:
  YOYO NEW API SPEC!
2024-04-05 12:58:43 -07:00
671a0a8391 Bump softprops/action-gh-release from 1 to 2 (#209)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  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-04-05 12:58:12 -07:00
553b1c1fcd YOYO NEW API SPEC! 2024-04-04 20:49:25 +00:00
f040c6454d Update api spec (#205)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-04 13:08:49 -08:00
f0599f6d54 bump
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-03-04 12:54:35 -08:00
042bb964e5 Update api spec (#202)
* YOYO NEW API SPEC!

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
2024-03-04 12:53:31 -08:00
a3089ef956 Bump pytest from 7.4.2 to 8.1.0 (#204)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.2 to 8.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.2...8.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  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-03-04 12:35:37 -08:00
0683a11b78 Bump attrs from 23.1.0 to 23.2.0 (#201)
Bumps [attrs](https://github.com/sponsors/hynek) from 23.1.0 to 23.2.0.
- [Commits](https://github.com/sponsors/hynek/commits)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
  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-03-04 12:31:21 -08:00
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
197 changed files with 22547 additions and 5338 deletions

View File

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

@ -28,4 +28,4 @@ jobs:
# TODO: generate a nice little doc for the release text like we do for the
# cli repo.
- name: Create a Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2

View File

@ -35,4 +35,4 @@ jobs:
- name: Run ruff
shell: bash
run: |
poetry run ruff check --format=github .
poetry run ruff check --output-format=github .

View File

@ -3,14 +3,14 @@
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

@ -154,10 +154,19 @@ class WebSocket:
self.ws = sync(
{% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional == False %}
{{arg.name}},
{% endif %}
{% endif %}
{% endfor %}
client=client,
{% for arg in args %}
{% if arg.in_query %}
{% if arg.is_optional %}
{{arg.name}}={{arg.name}},
{% endif %}
{% endif %}
{% endfor %}
)
def __enter__(self,

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"
@ -474,11 +478,16 @@ from kittycad.types import Response
for endpoint_ref in endpoint_refs:
if endpoint_ref == "Error":
continue
example_imports = example_imports + (
"""from kittycad.models import """
+ endpoint_ref.replace("List[", "").replace("]", "")
+ "\n"
)
# For some reason, PrivacySettings is showing up twice so we want to skip
# it here. Obviously this is a hack and we should fix the root cause.
# When this happens again with another struct there might be a more obvious
# solution, but alas, I am lazy.
if endpoint_ref != "PrivacySettings":
example_imports = example_imports + (
"""from kittycad.models import """
+ endpoint_ref.replace("List[", "").replace("]", "")
+ "\n"
)
example_imports = (
example_imports + "from typing import Union, Any, Optional, List, Tuple\n"
)
@ -518,7 +527,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")
@ -845,7 +854,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(
@ -1017,7 +1036,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:
@ -1500,6 +1519,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)
@ -1545,7 +1582,7 @@ def generateObjectTypeCode(
description = ""
if "description" in schema:
description = schema["description"]
description = schema["description"].replace('"', '\\"')
imports = []
refs = getRefs(schema)
@ -1645,8 +1682,9 @@ def getRefs(schema: dict) -> List[str]:
# do nothing
pass
else:
logging.error("unsupported type: ", schema)
raise Exception("unsupported type: ", schema)
# This is likely an empty object like above but with a description
# so we will just skip it.
pass
elif type_name == "array":
if "items" in schema:
schema_refs = getRefs(schema["items"])
@ -1694,7 +1732,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")
@ -1764,6 +1807,11 @@ def getRequestBodyRefs(endpoint: dict) -> List[str]:
if "$ref" in form:
ref = form["$ref"].replace("#/components/schemas/", "")
refs.append(ref)
elif content_type == "multipart/form-data":
form = content[content_type]["schema"]
if "$ref" in form:
ref = form["$ref"].replace("#/components/schemas/", "")
refs.append(ref)
else:
# Throw an error for an unsupported content type.
logging.error("content: ", content)
@ -1802,6 +1850,15 @@ def getRequestBodyTypeSchema(
elif form != {}:
logging.error("not a ref: ", form)
raise Exception("not a ref")
elif content_type == "multipart/form-data":
form = content[content_type]["schema"]
if "$ref" in form:
ref = form["$ref"].replace("#/components/schemas/", "")
type_schema = data["components"]["schemas"][ref]
return ref, type_schema
elif form != {}:
type_schema = form
return None, type_schema
else:
logging.error("unsupported content type: ", content_type)
raise Exception("unsupported content type")

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

@ -0,0 +1,116 @@
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

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

@ -20,6 +20,7 @@ def _get_kwargs(
) # noqa: E501
if feedback is not None:
if "?" in url:
url = url + "&feedback=" + str(feedback)
else:

View File

@ -21,18 +21,21 @@ def _get_kwargs(
) # 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:

View File

@ -22,24 +22,28 @@ def _get_kwargs(
) # 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 no_models is not None:
if "?" in url:
url = url + "&no_models=" + str(no_models)
else:

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

@ -19,6 +19,7 @@ def _get_kwargs(
) # noqa: E501
if group_by is not None:
if "?" in url:
url = url + "&group_by=" + str(group_by)
else:

View File

@ -35,9 +35,7 @@ def _get_kwargs(
}
def _parse_response(
*, response: httpx.Response
) -> Optional[
def _parse_response(*, response: httpx.Response) -> Optional[
Union[
FileConversion,
FileCenterOfMass,
@ -123,9 +121,7 @@ def _parse_response(
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[
def _build_response(*, response: httpx.Response) -> Response[
Optional[
Union[
FileConversion,

View File

@ -21,18 +21,21 @@ def _get_kwargs(
) # 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:

View File

@ -23,18 +23,21 @@ def _get_kwargs(
) # 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:

View File

@ -23,24 +23,28 @@ def _get_kwargs(
) # 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 status is not None:
if "?" in url:
url = url + "&status=" + str(status)
else:

View File

@ -0,0 +1,162 @@
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

@ -21,18 +21,21 @@ def _get_kwargs(
) # 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:

View File

@ -11,11 +11,19 @@ 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 +62,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 +80,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 +93,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 +109,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

@ -21,18 +21,21 @@ def _get_kwargs(
) # 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:

View File

@ -22,6 +22,7 @@ def _get_kwargs(
) # noqa: E501
if output is not None:
if "?" in url:
url = url + "&output=" + str(output)
else:
@ -40,9 +41,9 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, Error]]:
if response.status_code == 200:
response_200 = CodeOutput(**response.json())
return response_200
if response.status_code == 201:
response_201 = CodeOutput(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
@ -92,6 +93,7 @@ def sync(
client: Client,
output: Optional[str] = None,
) -> Optional[Union[CodeOutput, Error]]:
return sync_detailed(
lang=lang,
output=output,
@ -127,6 +129,7 @@ async def asyncio(
client: Client,
output: Optional[str] = None,
) -> Optional[Union[CodeOutput, Error]]:
return (
await asyncio_detailed(
lang=lang,

View File

@ -22,12 +22,14 @@ def _get_kwargs(
) # noqa: E501
if output_unit is not None:
if "?" in url:
url = url + "&output_unit=" + str(output_unit)
else:
url = url + "?output_unit=" + str(output_unit)
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:

View File

@ -25,24 +25,28 @@ def _get_kwargs(
) # noqa: E501
if material_mass is not None:
if "?" in url:
url = url + "&material_mass=" + str(material_mass)
else:
url = url + "?material_mass=" + str(material_mass)
if material_mass_unit is not None:
if "?" in url:
url = url + "&material_mass_unit=" + str(material_mass_unit)
else:
url = url + "?material_mass_unit=" + str(material_mass_unit)
if output_unit is not None:
if "?" in url:
url = url + "&output_unit=" + str(output_unit)
else:
url = url + "?output_unit=" + str(output_unit)
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:

View File

@ -25,24 +25,28 @@ def _get_kwargs(
) # noqa: E501
if material_density is not None:
if "?" in url:
url = url + "&material_density=" + str(material_density)
else:
url = url + "?material_density=" + str(material_density)
if material_density_unit is not None:
if "?" in url:
url = url + "&material_density_unit=" + str(material_density_unit)
else:
url = url + "?material_density_unit=" + str(material_density_unit)
if output_unit is not None:
if "?" in url:
url = url + "&output_unit=" + str(output_unit)
else:
url = url + "?output_unit=" + str(output_unit)
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:

View File

@ -22,12 +22,14 @@ def _get_kwargs(
) # noqa: E501
if output_unit is not None:
if "?" in url:
url = url + "&output_unit=" + str(output_unit)
else:
url = url + "?output_unit=" + str(output_unit)
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:

View File

@ -22,12 +22,14 @@ def _get_kwargs(
) # noqa: E501
if output_unit is not None:
if "?" in url:
url = url + "&output_unit=" + str(output_unit)
else:
url = url + "?output_unit=" + str(output_unit)
if src_format is not None:
if "?" in url:
url = url + "&src_format=" + str(src_format)
else:

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
@ -32,9 +32,9 @@ def _get_kwargs(
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,8 @@ def sync(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[VerificationToken, Error]]:
) -> Optional[Union[VerificationTokenResponse, Error]]:
return sync_detailed(
body=body,
client=client,
@ -89,7 +90,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 +106,8 @@ async def asyncio(
body: EmailAuthenticationForm,
*,
client: Client,
) -> Optional[Union[VerificationToken, Error]]:
) -> Optional[Union[VerificationTokenResponse, Error]]:
return (
await asyncio_detailed(
body=body,

View File

@ -19,18 +19,21 @@ def _get_kwargs(
) # 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)
if email is not None:
if "?" in url:
url = url + "&email=" + str(email)
else:
url = url + "?email=" + str(email)
if token is not None:
if "?" in url:
url = url + "&token=" + str(token)
else:
@ -96,6 +99,7 @@ def sync(
client: Client,
callback_url: Optional[str] = None,
) -> Optional[Error]:
return sync_detailed(
callback_url=callback_url,
email=email,
@ -131,6 +135,7 @@ async def asyncio(
client: Client,
callback_url: Optional[str] = None,
) -> Optional[Error]:
return (
await asyncio_detailed(
callback_url=callback_url,

View File

@ -0,0 +1,127 @@
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,119 @@
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

@ -0,0 +1,111 @@
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.error import Error
from ...models.event import Event
from ...types import Response
def _get_kwargs(
body: Event,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/events".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[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(
body: Event,
*,
client: Client,
) -> Response[Optional[Error]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: Event,
*,
client: Client,
) -> Optional[Error]:
"""We collect anonymous telemetry data for improving our product.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: Event,
*,
client: Client,
) -> Response[Optional[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: Event,
*,
client: Client,
) -> Optional[Error]:
"""We collect anonymous telemetry data for improving our product.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,103 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.ip_addr_info import IpAddrInfo
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/_meta/ipinfo".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[IpAddrInfo, Error]]:
if response.status_code == 200:
response_200 = IpAddrInfo(**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[IpAddrInfo, 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[IpAddrInfo, 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[IpAddrInfo, Error]]:
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[IpAddrInfo, 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[IpAddrInfo, Error]]:
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,104 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/pricing/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[dict, Error]]:
if response.status_code == 200:
response_200 = 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[dict, 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[dict, 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[dict, Error]]:
"""This is the ultimate source of truth for the pricing of our subscriptions.""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[dict, 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[dict, Error]]:
"""This is the ultimate source of truth for the pricing of our subscriptions.""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -70,6 +70,7 @@ def sync(
*,
client: Client,
) -> Optional[Union[dict, Error]]:
return sync_detailed(
client=client,
).parsed
@ -93,6 +94,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[dict, Error]]:
return (
await asyncio_detailed(
client=client,

View File

@ -71,6 +71,7 @@ def sync(
*,
client: Client,
) -> Optional[Union[Pong, Error]]:
return sync_detailed(
client=client,
).parsed
@ -94,6 +95,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[Pong, Error]]:
return (
await asyncio_detailed(
client=client,

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

@ -1,51 +1,73 @@
import json
from typing import Any, Dict, Iterator
from typing import Any, Dict, Iterator, Optional
import bson
from websockets.client import WebSocketClientProtocol, connect as ws_connect_async
from websockets.sync.client import ClientConnection, connect as ws_connect
from ...client import Client
from ...models.post_effect_type import PostEffectType
from ...models.web_socket_request import WebSocketRequest
from ...models.web_socket_response import WebSocketResponse
def _get_kwargs(
fps: int,
post_effect: PostEffectType,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
webrtc: bool,
*,
client: Client,
pool: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/ws/modeling/commands".format(client.base_url) # noqa: E501
if fps is not None:
if "?" in url:
url = url + "&fps=" + str(fps)
else:
url = url + "?fps=" + str(fps)
if pool is not None:
if "?" in url:
url = url + "&pool=" + str(pool)
else:
url = url + "?pool=" + str(pool)
if post_effect is not None:
if "?" in url:
url = url + "&post_effect=" + str(post_effect)
else:
url = url + "?post_effect=" + str(post_effect)
if unlocked_framerate is not None:
if "?" in url:
url = url + "&unlocked_framerate=" + str(unlocked_framerate).lower()
else:
url = url + "?unlocked_framerate=" + str(unlocked_framerate).lower()
if video_res_height is not None:
if "?" in url:
url = url + "&video_res_height=" + str(video_res_height)
else:
url = url + "?video_res_height=" + str(video_res_height)
if video_res_width is not None:
if "?" in url:
url = url + "&video_res_width=" + str(video_res_width)
else:
url = url + "?video_res_width=" + str(video_res_width)
if webrtc is not None:
if "?" in url:
url = url + "&webrtc=" + str(webrtc).lower()
else:
@ -64,17 +86,21 @@ def _get_kwargs(
def sync(
fps: int,
post_effect: PostEffectType,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
webrtc: bool,
*,
client: Client,
pool: Optional[str] = None,
) -> ClientConnection:
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
kwargs = _get_kwargs(
fps=fps,
pool=pool,
post_effect=post_effect,
unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height,
video_res_width=video_res_width,
@ -87,17 +113,21 @@ def sync(
async def asyncio(
fps: int,
post_effect: PostEffectType,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
webrtc: bool,
*,
client: Client,
pool: Optional[str] = None,
) -> WebSocketClientProtocol:
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
kwargs = _get_kwargs(
fps=fps,
pool=pool,
post_effect=post_effect,
unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height,
video_res_width=video_res_width,
@ -121,19 +151,23 @@ class WebSocket:
def __init__(
self,
fps: int,
post_effect: PostEffectType,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
webrtc: bool,
client: Client,
pool: Optional[str] = None,
):
self.ws = sync(
fps,
post_effect,
unlocked_framerate,
video_res_height,
video_res_width,
webrtc,
client=client,
pool=pool,
)
def __enter__(

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,173 @@
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,156 @@
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

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

@ -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,123 @@
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,160 @@
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

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

View File

@ -23,6 +23,7 @@ def _get_kwargs(
) # noqa: E501
if value is not None:
if "?" in url:
url = url + "&value=" + str(value)
else:

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