Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-02-24 17:03:55 -08:00
parent 218c6b4672
commit dedbe43c3e
101 changed files with 7680 additions and 857 deletions

View File

@ -233,7 +233,11 @@ def generateTypeAndExamplePython(
elif (
schema["type"] == "number"
and "format" in schema
and (schema["format"] == "float" or schema["format"] == "double")
and (
schema["format"] == "float"
or schema["format"] == "double"
or schema["format"] == "money-usd"
)
):
parameter_type = "float"
parameter_example = "3.14"
@ -518,7 +522,7 @@ from kittycad.types import Response
short_sync_example = short_sync_example + (
"""
if isinstance(result, Error) or result == None:
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
@ -845,7 +849,17 @@ async def test_"""
+ response_code
+ " = response.text\n"
)
elif (
json["type"] == "object"
and "additionalProperties" in json
):
parse_response.write(
"\t\tresponse_"
+ response_code
+ " = response.json()\n"
)
else:
print(json)
raise Exception("Unknown type", json["type"])
else:
parse_response.write(
@ -1500,6 +1514,24 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict):
f.write(object_code)
f.write("\n")
all_options.append(object_name)
else:
# Generate each of the options from the tag.
i = 0
for one_of in schema["oneOf"]:
# Get the value of the tag.
object_name = name + str(i)
object_code = generateObjectTypeCode(
object_name,
one_of,
"object",
data,
None,
None,
)
f.write(object_code)
f.write("\n")
all_options.append(object_name)
i += 1
# Write the sum type.
description = getOneOfDescription(schema)
@ -1694,7 +1726,12 @@ def getEndpointRefs(endpoint: dict, data: dict) -> List[str]:
raise Exception("Unknown array type")
elif json["type"] == "string":
refs.append("str")
elif (
json["type"] == "object" and "additionalProperties" in json
):
refs.append("dict")
else:
print(json)
raise Exception("Unknown type ", json["type"])
else:
refs.append("dict")

View File

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

View File

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

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

View File

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

View File

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

View File

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

@ -77,7 +77,12 @@ def sync(
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""This endpoint requires authentication by an org admin. It adds the specified member to the authenticated user's org.""" # noqa: E501
"""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,
@ -106,7 +111,12 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[OrgMember, Error]]:
"""This endpoint requires authentication by an org admin. It adds the specified member to the authenticated user's org.""" # noqa: E501
"""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(

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

@ -6,13 +6,13 @@ 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.org_role import OrgRole
from ...models.user_org_role import UserOrgRole
from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
role: OrgRole,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
@ -85,7 +85,7 @@ def _build_response(
def sync_detailed(
sort_by: CreatedAtSortMode,
role: OrgRole,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
@ -109,7 +109,7 @@ def sync_detailed(
def sync(
sort_by: CreatedAtSortMode,
role: OrgRole,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
@ -128,7 +128,7 @@ def sync(
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
role: OrgRole,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,
@ -150,7 +150,7 @@ async def asyncio_detailed(
async def asyncio(
sort_by: CreatedAtSortMode,
role: OrgRole,
role: UserOrgRole,
*,
client: Client,
limit: Optional[int] = None,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@ from .async_api_call import AsyncApiCall
from .async_api_call_output import AsyncApiCallOutput
from .async_api_call_results_page import AsyncApiCallResultsPage
from .async_api_call_type import AsyncApiCallType
from .auth_callback import AuthCallback
from .axis import Axis
from .axis_direction_pair import AxisDirectionPair
from .billing_info import BillingInfo
@ -53,14 +54,17 @@ from .curve_type import CurveType
from .customer import Customer
from .customer_balance import CustomerBalance
from .density import Density
from .der_encoded_key_pair import DerEncodedKeyPair
from .device_access_token_request_form import DeviceAccessTokenRequestForm
from .device_auth_request_form import DeviceAuthRequestForm
from .device_auth_verify_params import DeviceAuthVerifyParams
from .direction import Direction
from .discount import Discount
from .discount_code import DiscountCode
from .distance_type import DistanceType
from .email_authentication_form import EmailAuthenticationForm
from .empty import Empty
from .entity_circular_pattern import EntityCircularPattern
from .entity_get_all_child_uuids import EntityGetAllChildUuids
from .entity_get_child_uuid import EntityGetChildUuid
from .entity_get_distance import EntityGetDistance
@ -75,6 +79,8 @@ from .export import Export
from .export_file import ExportFile
from .extended_user import ExtendedUser
from .extended_user_results_page import ExtendedUserResultsPage
from .extrusion_face_cap_type import ExtrusionFaceCapType
from .extrusion_face_info import ExtrusionFaceInfo
from .failure_web_socket_response import FailureWebSocketResponse
from .fbx_storage import FbxStorage
from .file_center_of_mass import FileCenterOfMass
@ -94,6 +100,7 @@ from .gltf_presentation import GltfPresentation
from .gltf_storage import GltfStorage
from .highlight_set_entity import HighlightSetEntity
from .ice_server import IceServer
from .idp_metadata_source import IdpMetadataSource
from .image_format import ImageFormat
from .import_file import ImportFile
from .import_files import ImportFiles
@ -101,15 +108,28 @@ from .input_format import InputFormat
from .invoice import Invoice
from .invoice_line_item import InvoiceLineItem
from .invoice_status import InvoiceStatus
from .ip_addr_info import IpAddrInfo
from .jetstream import Jetstream
from .jetstream_api_stats import JetstreamApiStats
from .jetstream_config import JetstreamConfig
from .jetstream_stats import JetstreamStats
from .kcl_code_completion_params import KclCodeCompletionParams
from .kcl_code_completion_request import KclCodeCompletionRequest
from .kcl_code_completion_response import KclCodeCompletionResponse
from .leaf_node import LeafNode
from .length_unit import LengthUnit
from .mass import Mass
from .meta_cluster_info import MetaClusterInfo
from .metadata import Metadata
from .method import Method
from .modeling_app_individual_subscription_tier import (
ModelingAppIndividualSubscriptionTier,
)
from .modeling_app_organization_subscription_tier import (
ModelingAppOrganizationSubscriptionTier,
)
from .modeling_app_subscription_tier import ModelingAppSubscriptionTier
from .modeling_app_subscription_tier_name import ModelingAppSubscriptionTierName
from .modeling_cmd import ModelingCmd
from .modeling_cmd_id import ModelingCmdId
from .modeling_cmd_req import ModelingCmdReq
@ -123,6 +143,7 @@ from .org import Org
from .org_details import OrgDetails
from .org_member import OrgMember
from .org_member_results_page import OrgMemberResultsPage
from .org_results_page import OrgResultsPage
from .org_role import OrgRole
from .output_file import OutputFile
from .output_format import OutputFormat
@ -139,28 +160,41 @@ from .payment_method import PaymentMethod
from .payment_method_card_checks import PaymentMethodCardChecks
from .payment_method_type import PaymentMethodType
from .perspective_camera_parameters import PerspectiveCameraParameters
from .plan_interval import PlanInterval
from .plane_intersect_and_project import PlaneIntersectAndProject
from .ply_storage import PlyStorage
from .point2d import Point2d
from .point3d import Point3d
from .pong import Pong
from .privacy_settings import PrivacySettings
from .raw_file import RawFile
from .rtc_ice_candidate_init import RtcIceCandidateInit
from .rtc_sdp_type import RtcSdpType
from .rtc_session_description import RtcSessionDescription
from .saml_identity_provider import SamlIdentityProvider
from .saml_identity_provider_create import SamlIdentityProviderCreate
from .scene_selection_type import SceneSelectionType
from .scene_tool_type import SceneToolType
from .select_get import SelectGet
from .select_with_point import SelectWithPoint
from .selection import Selection
from .service_account import ServiceAccount
from .service_account_results_page import ServiceAccountResultsPage
from .session import Session
from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from .solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
from .solid3d_get_extrusion_face_info import Solid3dGetExtrusionFaceInfo
from .solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge
from .solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from .solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
from .stl_storage import StlStorage
from .store_coupon_params import StoreCouponParams
from .subscription_tier_feature import SubscriptionTierFeature
from .subscription_tier_price import SubscriptionTierPrice
from .subscription_tier_type import SubscriptionTierType
from .subscription_training_data_behavior import SubscriptionTrainingDataBehavior
from .success_web_socket_response import SuccessWebSocketResponse
from .support_tier import SupportTier
from .surface_area import SurfaceArea
from .system import System
from .take_snapshot import TakeSnapshot
@ -195,12 +229,19 @@ from .unit_torque_conversion import UnitTorqueConversion
from .unit_volume import UnitVolume
from .unit_volume_conversion import UnitVolumeConversion
from .update_member_to_org_body import UpdateMemberToOrgBody
from .update_payment_balance import UpdatePaymentBalance
from .update_user import UpdateUser
from .user import User
from .user_org_info import UserOrgInfo
from .user_org_role import UserOrgRole
from .user_results_page import UserResultsPage
from .uuid import Uuid
from .verification_token import VerificationToken
from .verification_token_response import VerificationTokenResponse
from .volume import Volume
from .web_socket_request import WebSocketRequest
from .web_socket_response import WebSocketResponse
from .zoo_product_subscription import ZooProductSubscription
from .zoo_product_subscriptions import ZooProductSubscriptions
from .zoo_product_subscriptions_org_request import ZooProductSubscriptionsOrgRequest
from .zoo_product_subscriptions_user_request import ZooProductSubscriptionsUserRequest
from .zoo_tool import ZooTool

View File

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

View File

@ -1,7 +1,7 @@
from pydantic import BaseModel, ConfigDict
from ..models.org_role import OrgRole
from ..models.user_org_role import UserOrgRole
class AddOrgMember(BaseModel):
@ -9,6 +9,6 @@ class AddOrgMember(BaseModel):
email: str
role: OrgRole
role: UserOrgRole
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,18 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
class AuthCallback(BaseModel):
"""The authentication callback from the OAuth 2.0 client. This is typically posted to the redirect URL as query params after authenticating."""
code: Optional[str] = None
id_token: Optional[str] = None
state: Optional[str] = None
user: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,8 +1,11 @@
import datetime
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.subscription_tier_price import SubscriptionTierPrice
from ..models.uuid import Uuid
from ..models.zoo_product_subscriptions import ZooProductSubscriptions
class CustomerBalance(BaseModel):
@ -16,12 +19,18 @@ class CustomerBalance(BaseModel):
map_id: Uuid
modeling_app_enterprise_price: Optional[SubscriptionTierPrice] = None
monthly_credits_remaining: float
pre_pay_cash_remaining: float
pre_pay_credits_remaining: float
subscription_details: Optional[ZooProductSubscriptions] = None
subscription_id: Optional[str] = None
total_due: float
updated_at: datetime.datetime

View File

@ -0,0 +1,14 @@
from pydantic import BaseModel, ConfigDict
from .base64data import Base64Data
class DerEncodedKeyPair(BaseModel):
"""The DER encoded key pair."""
private_key: Base64Data
public_cert: Base64Data
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,17 @@
import datetime
from typing import Optional
from pydantic import BaseModel, ConfigDict
class DiscountCode(BaseModel):
"""A discount code for a store."""
code: str
expires_at: Optional[datetime.datetime] = None
percent_off: int
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,12 @@
from typing import List
from pydantic import BaseModel, ConfigDict
class EntityCircularPattern(BaseModel):
"""The response from the `EntityCircularPattern` command."""
entity_ids: List[str]
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,13 +1,14 @@
from pydantic import BaseModel, ConfigDict
from ..models.length_unit import LengthUnit
class EntityGetDistance(BaseModel):
"""The response from the `EntitiesGetDistance` command."""
max_distance: float
max_distance: LengthUnit
min_distance: float
min_distance: LengthUnit
model_config = ConfigDict(protected_namespaces=())

View File

@ -15,6 +15,8 @@ class ExtendedUser(BaseModel):
block: Optional[BlockReason] = None
can_train_on_data: Optional[bool] = None
company: Optional[str] = None
created_at: datetime.datetime
@ -35,6 +37,8 @@ class ExtendedUser(BaseModel):
image: str
is_service_account: Optional[bool] = None
last_name: Optional[str] = None
mailchimp_id: Optional[str] = None

View File

@ -0,0 +1,15 @@
from enum import Enum
class ExtrusionFaceCapType(str, Enum):
"""Possible types of faces which can be extruded from a 3D solid.""" # noqa: E501
"""# Uncapped. """ # noqa: E501
NONE = "none"
"""# Capped on top. """ # noqa: E501
TOP = "top"
"""# Capped below. """ # noqa: E501
BOTTOM = "bottom"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,17 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.extrusion_face_cap_type import ExtrusionFaceCapType
class ExtrusionFaceInfo(BaseModel):
"""Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)"""
cap: ExtrusionFaceCapType
curve_id: Optional[str] = None
face_id: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -2,7 +2,7 @@ from enum import Enum
class GlobalAxis(str, Enum):
"""An enum that contains the three global axes.""" # noqa: E501
"""The global axes.""" # noqa: E501
"""# The X axis """ # noqa: E501
X = "x"

View File

@ -0,0 +1,37 @@
from typing import Literal, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
from .base64data import Base64Data
class url(BaseModel):
"""A URL to the identity provider metadata descriptor."""
type: Literal["url"] = "url"
url: str
model_config = ConfigDict(protected_namespaces=())
class base64_encoded_xml(BaseModel):
"""A base64 encoded XML document containing the identity provider metadata descriptor."""
data: Base64Data
type: Literal["base64_encoded_xml"] = "base64_encoded_xml"
model_config = ConfigDict(protected_namespaces=())
IdpMetadataSource = RootModel[
Annotated[
Union[
url,
base64_encoded_xml,
],
Field(discriminator="type"),
]
]

View File

@ -4,7 +4,7 @@ from pydantic import BaseModel, ConfigDict
class ImportFile(BaseModel):
"""File to import into the current model If you are sending binary data for a file, be sure to send the WebSocketRequest as binary/bson, not text/json."""
"""File to import into the current model. If you are sending binary data for a file, be sure to send the WebSocketRequest as binary/bson, not text/json."""
data: bytes

View File

@ -0,0 +1,43 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.country_code import CountryCode
class IpAddrInfo(BaseModel):
"""Information about an ip address. Represents geographical and network-related information."""
asn: Optional[int] = None
city: Optional[str] = None
continent_code: Optional[str] = None
country: Optional[str] = None
country_code: Optional[CountryCode] = None
country_code3: Optional[str] = None
ip: Optional[str] = None
is_in_european_union: Optional[bool] = None
latitude: Optional[float] = None
longitude: Optional[float] = None
offset: Optional[int] = None
organization: Optional[str] = None
postal_code: Optional[str] = None
region: Optional[str] = None
region_code: Optional[str] = None
timezone: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,20 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
class KclCodeCompletionParams(BaseModel):
"""Extra params for the completions."""
language: Optional[str] = None
next_indent: Optional[int] = None
prompt_tokens: Optional[int] = None
suffix_tokens: Optional[int] = None
trim_by_indentation: Optional[bool] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,31 @@
from typing import List, Optional
from pydantic import BaseModel, ConfigDict
from ..models.kcl_code_completion_params import KclCodeCompletionParams
class KclCodeCompletionRequest(BaseModel):
"""A request to generate KCL code completions."""
extra: Optional[KclCodeCompletionParams] = None
max_tokens: Optional[int] = None
n: Optional[int] = None
nwo: Optional[str] = None
prompt: Optional[str] = None
stop: Optional[List[str]] = None
stream: Optional[bool] = None
suffix: Optional[str] = None
temperature: Optional[float] = None
top_p: Optional[float] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,12 @@
from typing import List
from pydantic import BaseModel, ConfigDict
class KclCodeCompletionResponse(BaseModel):
"""A response with KCL code completions."""
completions: List[str]
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,17 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class LengthUnit(int):
""""""
def __int__(self) -> int:
return self
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(int))

View File

@ -0,0 +1,13 @@
from enum import Enum
class ModelingAppIndividualSubscriptionTier(str, Enum):
"""The subscription tiers we offer for the Modeling App to individuals.""" # noqa: E501
"""# The free tier. """ # noqa: E501
FREE = "free"
"""# The pro tier. """ # noqa: E501
PRO = "pro"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,13 @@
from enum import Enum
class ModelingAppOrganizationSubscriptionTier(str, Enum):
"""The subscription tiers we offer for the Modeling App to organizations.""" # noqa: E501
"""# The team tier. """ # noqa: E501
TEAM = "team"
"""# The enterprise tier. """ # noqa: E501
ENTERPRISE = "enterprise"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,37 @@
from typing import List, Optional
from pydantic import BaseModel, ConfigDict
from ..models.modeling_app_subscription_tier_name import ModelingAppSubscriptionTierName
from ..models.subscription_tier_feature import SubscriptionTierFeature
from ..models.subscription_tier_price import SubscriptionTierPrice
from ..models.subscription_tier_type import SubscriptionTierType
from ..models.subscription_training_data_behavior import (
SubscriptionTrainingDataBehavior,
)
from ..models.support_tier import SupportTier
from ..models.zoo_tool import ZooTool
class ModelingAppSubscriptionTier(BaseModel):
"""A subscription tier we offer for the Modeling App."""
description: str
features: Optional[List[SubscriptionTierFeature]] = None
name: ModelingAppSubscriptionTierName
pay_as_you_go_credits: float
price: SubscriptionTierPrice
support_tier: SupportTier
training_data_behavior: SubscriptionTrainingDataBehavior
type: SubscriptionTierType
zoo_tools_included: Optional[List[ZooTool]] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,17 @@
from enum import Enum
class ModelingAppSubscriptionTierName(str, Enum):
"""An enum representing a Modeling App subscription tier name.""" # noqa: E501
"""# The free tier. """ # noqa: E501
FREE = "free"
"""# The pro tier. """ # noqa: E501
PRO = "pro"
"""# The team tier. """ # noqa: E501
TEAM = "team"
"""# The enterprise tier. """ # noqa: E501
ENTERPRISE = "enterprise"
def __str__(self) -> str:
return str(self.value)

View File

@ -12,6 +12,7 @@ from ..models.entity_type import EntityType
from ..models.image_format import ImageFormat
from ..models.import_file import ImportFile
from ..models.input_format import InputFormat
from ..models.length_unit import LengthUnit
from ..models.modeling_cmd_id import ModelingCmdId
from ..models.output_format import OutputFormat
from ..models.path_component_constraint_bound import PathComponentConstraintBound
@ -30,7 +31,7 @@ from ..models.unit_volume import UnitVolume
class start_path(BaseModel):
"""Start a path."""
"""Start a new path."""
type: Literal["start_path"] = "start_path"
@ -62,11 +63,11 @@ class extend_path(BaseModel):
class extrude(BaseModel):
"""Extrude a 2D solid."""
"""Command for extruding a solid."""
cap: bool
distance: float
distance: LengthUnit
target: ModelingCmdId
@ -112,7 +113,7 @@ class camera_drag_move(BaseModel):
class camera_drag_end(BaseModel):
"""Camera drag ended."""
"""Camera drag ended"""
interaction: CameraDragInteractionType
@ -128,6 +129,8 @@ class default_camera_look_at(BaseModel):
center: Point3d
sequence: Optional[int] = None
type: Literal["default_camera_look_at"] = "default_camera_look_at"
up: Point3d
@ -137,6 +140,30 @@ class default_camera_look_at(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class default_camera_perspective_settings(BaseModel):
"""Change what the default camera is looking at."""
center: Point3d
fov_y: float
sequence: Optional[int] = None
type: Literal[
"default_camera_perspective_settings"
] = "default_camera_perspective_settings"
up: Point3d
vantage: Point3d
z_far: float
z_near: float
model_config = ConfigDict(protected_namespaces=())
class default_camera_zoom(BaseModel):
"""Adjust zoom of the default camera."""
@ -179,16 +206,6 @@ class default_camera_disable_sketch_mode(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class default_camera_focus_on(BaseModel):
"""Focus default camera on object."""
type: Literal["default_camera_focus_on"] = "default_camera_focus_on"
uuid: str
model_config = ConfigDict(protected_namespaces=())
class export(BaseModel):
"""Export the scene to a file."""
@ -245,6 +262,56 @@ class entity_get_all_child_uuids(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_distance(BaseModel):
"""What is the distance between these two entities?"""
distance_type: DistanceType
entity_id1: str
entity_id2: str
type: Literal["entity_get_distance"] = "entity_get_distance"
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern(BaseModel):
"""Create a linear pattern using this entity (currently only valid for 3D solids)."""
axis: Point3d
entity_id: str
num_repetitions: int
spacing: LengthUnit
type: Literal["entity_linear_pattern"] = "entity_linear_pattern"
model_config = ConfigDict(protected_namespaces=())
class entity_circular_pattern(BaseModel):
"""Create a circular pattern using this entity (currently only valid for 3D solids)."""
arc_degrees: float
axis: Point3d
center: Point3d
entity_id: str
num_repetitions: int
rotate_duplicates: bool
type: Literal["entity_circular_pattern"] = "entity_circular_pattern"
model_config = ConfigDict(protected_namespaces=())
class edit_mode_enter(BaseModel):
"""Enter edit mode"""
@ -255,14 +322,6 @@ class edit_mode_enter(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class edit_mode_exit(BaseModel):
"""Exit edit mode"""
type: Literal["edit_mode_exit"] = "edit_mode_exit"
model_config = ConfigDict(protected_namespaces=())
class select_with_point(BaseModel):
"""Modifies the selection by simulating a "mouse click" at the given x,y window coordinate Returns ID of whatever was selected."""
@ -275,14 +334,6 @@ class select_with_point(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class select_clear(BaseModel):
"""Clear the selection"""
type: Literal["select_clear"] = "select_clear"
model_config = ConfigDict(protected_namespaces=())
class select_add(BaseModel):
"""Adds one or more entities (by UUID) to the selection."""
@ -304,7 +355,7 @@ class select_remove(BaseModel):
class select_replace(BaseModel):
"""Replaces the current selection with these new entities (by UUID). Equivalent to doing SelectClear then SelectAdd."""
"""Replaces current selection with these entities (by UUID)."""
entities: List[str]
@ -313,14 +364,6 @@ class select_replace(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class select_get(BaseModel):
"""Find all IDs of selected entities"""
type: Literal["select_get"] = "select_get"
model_config = ConfigDict(protected_namespaces=())
class highlight_set_entity(BaseModel):
"""Changes the current highlighted entity to whichever one is at the given window coordinate. If there's no entity at this location, clears the highlight."""
@ -391,6 +434,24 @@ class object_bring_to_front(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class object_set_material_params_pbr(BaseModel):
"""Set the material properties of an object"""
ambient_occlusion: float
color: Color
metalness: float
object_id: str
roughness: float
type: Literal["object_set_material_params_pbr"] = "object_set_material_params_pbr"
model_config = ConfigDict(protected_namespaces=())
class get_entity_type(BaseModel):
"""What type of entity is this?"""
@ -401,18 +462,6 @@ class get_entity_type(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid2d_add_hole(BaseModel):
"""Add a hole to a Solid2d object before extruding it."""
hole_id: str
object_id: str
type: Literal["solid2d_add_hole"] = "solid2d_add_hole"
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_all_edge_faces(BaseModel):
"""Gets all faces which use the given edge."""
@ -425,6 +474,18 @@ class solid3d_get_all_edge_faces(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid2d_add_hole(BaseModel):
"""Add a hole to a Solid2d object before extruding it."""
hole_id: str
object_id: str
type: Literal["solid2d_add_hole"] = "solid2d_add_hole"
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_all_opposite_edges(BaseModel):
"""Gets all edges which are opposite the given edge, across all possible faces."""
@ -481,8 +542,22 @@ class solid3d_get_prev_adjacent_edge(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_fillet_edge(BaseModel):
"""Fillets the given edge with the specified radius."""
edge_id: str
object_id: str
radius: LengthUnit
type: Literal["solid3d_fillet_edge"] = "solid3d_fillet_edge"
model_config = ConfigDict(protected_namespaces=())
class send_object(BaseModel):
"""Sends object to front or back."""
"""Send object to front or back."""
front: bool
@ -506,7 +581,7 @@ class entity_set_opacity(BaseModel):
class entity_fade(BaseModel):
"""Fade the entity in or out."""
"""Fade entity in or out."""
duration_seconds: Optional[float] = None
@ -520,7 +595,7 @@ class entity_fade(BaseModel):
class make_plane(BaseModel):
"""Make a plane."""
"""Make a new plane"""
clobber: bool
@ -528,7 +603,7 @@ class make_plane(BaseModel):
origin: Point3d
size: float
size: LengthUnit
type: Literal["make_plane"] = "make_plane"
@ -540,7 +615,7 @@ class make_plane(BaseModel):
class plane_set_color(BaseModel):
"""Set the plane's color."""
"""Set the color of a plane."""
color: Color
@ -552,7 +627,7 @@ class plane_set_color(BaseModel):
class set_tool(BaseModel):
"""Set the active tool."""
"""Set the current tool."""
tool: SceneToolType
@ -562,7 +637,7 @@ class set_tool(BaseModel):
class mouse_move(BaseModel):
"""Send a mouse move event."""
"""Send a mouse move event"""
sequence: Optional[int] = None
@ -574,7 +649,7 @@ class mouse_move(BaseModel):
class mouse_click(BaseModel):
"""Send a mouse click event. Updates modified/selected entities."""
"""Send a mouse click event Updates modified/selected entities."""
type: Literal["mouse_click"] = "mouse_click"
@ -584,7 +659,7 @@ class mouse_click(BaseModel):
class sketch_mode_enable(BaseModel):
"""Enable sketch mode on the given plane."""
"""Enable sketch mode on the given plane. If you want to sketch on a face, use `enable_sketch_mode` instead."""
animated: bool
@ -600,15 +675,53 @@ class sketch_mode_enable(BaseModel):
class sketch_mode_disable(BaseModel):
"""Disable sketch mode."""
"""Disable sketch mode. If you are sketching on a face, be sure to not disable sketch mode until you have extruded. Otherwise, your object will not be fused with the face."""
type: Literal["sketch_mode_disable"] = "sketch_mode_disable"
model_config = ConfigDict(protected_namespaces=())
class get_sketch_mode_plane(BaseModel):
"""Get the plane for sketch mode."""
type: Literal["get_sketch_mode_plane"] = "get_sketch_mode_plane"
model_config = ConfigDict(protected_namespaces=())
class curve_set_constraint(BaseModel):
"""Get the plane for sketch mode."""
constraint_bound: PathComponentConstraintBound
constraint_type: PathComponentConstraintType
object_id: str
type: Literal["curve_set_constraint"] = "curve_set_constraint"
model_config = ConfigDict(protected_namespaces=())
class enable_sketch_mode(BaseModel):
"""Sketch on some entity (e.g. a plane, a face)."""
adjust_camera: bool
animated: bool
entity_id: str
ortho: bool
type: Literal["enable_sketch_mode"] = "enable_sketch_mode"
model_config = ConfigDict(protected_namespaces=())
class curve_get_type(BaseModel):
"""Get type of a given curve."""
"""Get type of the given curve."""
curve_id: str
@ -618,7 +731,7 @@ class curve_get_type(BaseModel):
class curve_get_control_points(BaseModel):
"""Get control points of a given curve."""
"""Get control points of the given curve."""
curve_id: str
@ -628,7 +741,7 @@ class curve_get_control_points(BaseModel):
class take_snapshot(BaseModel):
"""Take a snapshot."""
"""Take a snapshot of the current view."""
format: ImageFormat
@ -650,7 +763,7 @@ class make_axes_gizmo(BaseModel):
class path_get_info(BaseModel):
"""Query the given path"""
"""Query the given path."""
path_id: str
@ -660,7 +773,7 @@ class path_get_info(BaseModel):
class path_get_curve_uuids_for_vertices(BaseModel):
"""Get curves for vertices within a path"""
"""Obtain curve ids for vertex ids"""
path_id: str
@ -674,7 +787,7 @@ class path_get_curve_uuids_for_vertices(BaseModel):
class path_get_vertex_uuids(BaseModel):
"""Get vertices within a path"""
"""Obtain vertex ids for a path"""
path_id: str
@ -684,7 +797,7 @@ class path_get_vertex_uuids(BaseModel):
class handle_mouse_drag_start(BaseModel):
"""Start dragging mouse."""
"""Start dragging the mouse."""
type: Literal["handle_mouse_drag_start"] = "handle_mouse_drag_start"
@ -694,7 +807,7 @@ class handle_mouse_drag_start(BaseModel):
class handle_mouse_drag_move(BaseModel):
"""Continue dragging mouse."""
"""Continue dragging the mouse."""
sequence: Optional[int] = None
@ -706,7 +819,7 @@ class handle_mouse_drag_move(BaseModel):
class handle_mouse_drag_end(BaseModel):
"""Stop dragging mouse."""
"""Stop dragging the mouse."""
type: Literal["handle_mouse_drag_end"] = "handle_mouse_drag_end"
@ -773,6 +886,16 @@ class import_files(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class set_scene_units(BaseModel):
"""Set the units of the scene. For all following commands, the units will be interpreted as the given units."""
type: Literal["set_scene_units"] = "set_scene_units"
unit: UnitLength
model_config = ConfigDict(protected_namespaces=())
class mass(BaseModel):
"""Get the mass of entities in the scene or the default scene."""
@ -851,86 +974,12 @@ class surface_area(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class get_sketch_mode_plane(BaseModel):
"""Get the plane of the sketch mode. This is useful for getting the normal of the plane after a user selects a plane."""
class default_camera_focus_on(BaseModel):
"""Focus the default camera upon an object in the scene."""
type: Literal["get_sketch_mode_plane"] = "get_sketch_mode_plane"
type: Literal["default_camera_focus_on"] = "default_camera_focus_on"
model_config = ConfigDict(protected_namespaces=())
class curve_set_constraint(BaseModel):
"""Constrain a curve."""
constraint_bound: PathComponentConstraintBound
constraint_type: PathComponentConstraintType
object_id: str
type: Literal["curve_set_constraint"] = "curve_set_constraint"
model_config = ConfigDict(protected_namespaces=())
class enable_sketch_mode(BaseModel):
"""Sketch on some entity (e.g. a plane, a face)"""
animated: bool
entity_id: str
ortho: bool
type: Literal["enable_sketch_mode"] = "enable_sketch_mode"
model_config = ConfigDict(protected_namespaces=())
class object_set_material_params_pbr(BaseModel):
"""Set the material properties of an object"""
ambient_occlusion: float
color: Color
metalness: float
object_id: str
roughness: float
type: Literal["object_set_material_params_pbr"] = "object_set_material_params_pbr"
model_config = ConfigDict(protected_namespaces=())
class entity_get_distance(BaseModel):
"""What is the distance between these two entities?"""
distance_type: DistanceType
entity_id1: str
entity_id2: str
type: Literal["entity_get_distance"] = "entity_get_distance"
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern(BaseModel):
"""Duplicate the given entity, evenly spaced along the chosen axis."""
axis: Point3d
entity_id: str
num_repetitions: int
spacing: float
type: Literal["entity_linear_pattern"] = "entity_linear_pattern"
uuid: str
model_config = ConfigDict(protected_namespaces=())
@ -973,6 +1022,42 @@ class default_camera_set_perspective(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_extrusion_face_info(BaseModel):
"""Get a concise description of all of an extrusion's faces."""
edge_id: str
object_id: str
type: Literal["solid3d_get_extrusion_face_info"] = "solid3d_get_extrusion_face_info"
model_config = ConfigDict(protected_namespaces=())
class edit_mode_exit(BaseModel):
"""Exit edit mode"""
type: Literal["edit_mode_exit"] = "edit_mode_exit"
model_config = ConfigDict(protected_namespaces=())
class select_clear(BaseModel):
"""Clear the selection"""
type: Literal["select_clear"] = "select_clear"
model_config = ConfigDict(protected_namespaces=())
class select_get(BaseModel):
"""Find all IDs of selected entities"""
type: Literal["select_get"] = "select_get"
model_config = ConfigDict(protected_namespaces=())
ModelingCmd = RootModel[
Annotated[
Union[
@ -985,36 +1070,38 @@ ModelingCmd = RootModel[
camera_drag_move,
camera_drag_end,
default_camera_look_at,
default_camera_perspective_settings,
default_camera_zoom,
default_camera_enable_sketch_mode,
default_camera_disable_sketch_mode,
default_camera_focus_on,
export,
entity_get_parent_id,
entity_get_num_children,
entity_get_child_uuid,
entity_get_all_child_uuids,
entity_get_distance,
entity_linear_pattern,
entity_circular_pattern,
edit_mode_enter,
edit_mode_exit,
select_with_point,
select_clear,
select_add,
select_remove,
select_replace,
select_get,
highlight_set_entity,
highlight_set_entities,
new_annotation,
update_annotation,
object_visible,
object_bring_to_front,
object_set_material_params_pbr,
get_entity_type,
solid2d_add_hole,
solid3d_get_all_edge_faces,
solid2d_add_hole,
solid3d_get_all_opposite_edges,
solid3d_get_opposite_edge,
solid3d_get_next_adjacent_edge,
solid3d_get_prev_adjacent_edge,
solid3d_fillet_edge,
send_object,
entity_set_opacity,
entity_fade,
@ -1025,6 +1112,9 @@ ModelingCmd = RootModel[
mouse_click,
sketch_mode_enable,
sketch_mode_disable,
get_sketch_mode_plane,
curve_set_constraint,
enable_sketch_mode,
curve_get_type,
curve_get_control_points,
take_snapshot,
@ -1040,21 +1130,21 @@ ModelingCmd = RootModel[
curve_get_end_points,
reconfigure_stream,
import_files,
set_scene_units,
mass,
density,
volume,
center_of_mass,
surface_area,
get_sketch_mode_plane,
curve_set_constraint,
enable_sketch_mode,
object_set_material_params_pbr,
entity_get_distance,
entity_linear_pattern,
default_camera_focus_on,
set_selection_type,
set_selection_filter,
default_camera_set_orthographic,
default_camera_set_perspective,
solid3d_get_extrusion_face_info,
edit_mode_exit,
select_clear,
select_get,
],
Field(discriminator="type"),
]

View File

@ -8,6 +8,7 @@ from ..models.curve_get_control_points import CurveGetControlPoints
from ..models.curve_get_end_points import CurveGetEndPoints
from ..models.curve_get_type import CurveGetType
from ..models.density import Density
from ..models.entity_circular_pattern import EntityCircularPattern
from ..models.entity_get_all_child_uuids import EntityGetAllChildUuids
from ..models.entity_get_child_uuid import EntityGetChildUuid
from ..models.entity_get_distance import EntityGetDistance
@ -15,6 +16,7 @@ from ..models.entity_get_num_children import EntityGetNumChildren
from ..models.entity_get_parent_id import EntityGetParentId
from ..models.entity_linear_pattern import EntityLinearPattern
from ..models.export import Export
from ..models.extrusion_face_info import ExtrusionFaceInfo
from ..models.get_entity_type import GetEntityType
from ..models.get_sketch_mode_plane import GetSketchModePlane
from ..models.highlight_set_entity import HighlightSetEntity
@ -24,11 +26,13 @@ from ..models.mouse_click import MouseClick
from ..models.path_get_curve_uuids_for_vertices import PathGetCurveUuidsForVertices
from ..models.path_get_info import PathGetInfo
from ..models.path_get_vertex_uuids import PathGetVertexUuids
from ..models.path_segment_info import PathSegmentInfo
from ..models.plane_intersect_and_project import PlaneIntersectAndProject
from ..models.select_get import SelectGet
from ..models.select_with_point import SelectWithPoint
from ..models.solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from ..models.solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
from ..models.solid3d_get_extrusion_face_info import Solid3dGetExtrusionFaceInfo
from ..models.solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge
from ..models.solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from ..models.solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
@ -46,7 +50,7 @@ class empty(BaseModel):
class export(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Export' endpoint"""
data: Export
@ -56,7 +60,7 @@ class export(BaseModel):
class select_with_point(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'SelectWithPoint' endpoint"""
data: SelectWithPoint
@ -66,7 +70,7 @@ class select_with_point(BaseModel):
class highlight_set_entity(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'HighlightSetEntity' endpoint"""
data: HighlightSetEntity
@ -76,7 +80,7 @@ class highlight_set_entity(BaseModel):
class entity_get_child_uuid(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'EntityGetChildUuid' endpoint"""
data: EntityGetChildUuid
@ -86,7 +90,7 @@ class entity_get_child_uuid(BaseModel):
class entity_get_num_children(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'EntityGetNumChildren' endpoint"""
data: EntityGetNumChildren
@ -96,7 +100,7 @@ class entity_get_num_children(BaseModel):
class entity_get_parent_id(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'EntityGetParentId' endpoint"""
data: EntityGetParentId
@ -106,7 +110,7 @@ class entity_get_parent_id(BaseModel):
class entity_get_all_child_uuids(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'EntityGetAllChildUuids' endpoint"""
data: EntityGetAllChildUuids
@ -116,7 +120,7 @@ class entity_get_all_child_uuids(BaseModel):
class select_get(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'SelectGet' endpoint"""
data: SelectGet
@ -125,38 +129,8 @@ class select_get(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class get_entity_type(BaseModel):
"""The response from the ` ` command."""
data: GetEntityType
type: Literal["get_entity_type"] = "get_entity_type"
model_config = ConfigDict(protected_namespaces=())
class entity_get_distance(BaseModel):
"""The response from the ` ` command."""
data: EntityGetDistance
type: Literal["entity_get_distance"] = "entity_get_distance"
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern(BaseModel):
"""The response from the ` ` command."""
data: EntityLinearPattern
type: Literal["entity_linear_pattern"] = "entity_linear_pattern"
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_all_edge_faces(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Solid3dGetAllEdgeFaces' endpoint"""
data: Solid3dGetAllEdgeFaces
@ -166,7 +140,7 @@ class solid3d_get_all_edge_faces(BaseModel):
class solid3d_get_all_opposite_edges(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Solid3dGetAllOppositeEdges' endpoint"""
data: Solid3dGetAllOppositeEdges
@ -176,7 +150,7 @@ class solid3d_get_all_opposite_edges(BaseModel):
class solid3d_get_opposite_edge(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Solid3dGetOppositeEdge' endpoint"""
data: Solid3dGetOppositeEdge
@ -185,18 +159,8 @@ class solid3d_get_opposite_edge(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_prev_adjacent_edge(BaseModel):
"""The response from the ` ` command."""
data: Solid3dGetPrevAdjacentEdge
type: Literal["solid3d_get_prev_adjacent_edge"] = "solid3d_get_prev_adjacent_edge"
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_next_adjacent_edge(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Solid3dGetNextAdjacentEdge' endpoint"""
data: Solid3dGetNextAdjacentEdge
@ -205,28 +169,28 @@ class solid3d_get_next_adjacent_edge(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class mouse_click(BaseModel):
"""The response from the ` ` command."""
class solid3d_get_prev_adjacent_edge(BaseModel):
"""The response to the 'Solid3dGetPrevAdjacentEdge' endpoint"""
data: MouseClick
data: Solid3dGetPrevAdjacentEdge
type: Literal["mouse_click"] = "mouse_click"
type: Literal["solid3d_get_prev_adjacent_edge"] = "solid3d_get_prev_adjacent_edge"
model_config = ConfigDict(protected_namespaces=())
class curve_get_type(BaseModel):
"""The response from the ` ` command."""
class get_entity_type(BaseModel):
"""The response to the 'GetEntityType' endpoint"""
data: CurveGetType
data: GetEntityType
type: Literal["curve_get_type"] = "curve_get_type"
type: Literal["get_entity_type"] = "get_entity_type"
model_config = ConfigDict(protected_namespaces=())
class curve_get_control_points(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'CurveGetControlPoints' endpoint"""
data: CurveGetControlPoints
@ -235,8 +199,28 @@ class curve_get_control_points(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class curve_get_type(BaseModel):
"""The response to the 'CurveGetType' endpoint"""
data: CurveGetType
type: Literal["curve_get_type"] = "curve_get_type"
model_config = ConfigDict(protected_namespaces=())
class mouse_click(BaseModel):
"""The response to the 'MouseClick' endpoint"""
data: MouseClick
type: Literal["mouse_click"] = "mouse_click"
model_config = ConfigDict(protected_namespaces=())
class take_snapshot(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'TakeSnapshot' endpoint"""
data: TakeSnapshot
@ -246,7 +230,7 @@ class take_snapshot(BaseModel):
class path_get_info(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'PathGetInfo' endpoint"""
data: PathGetInfo
@ -255,8 +239,18 @@ class path_get_info(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class path_segment_info(BaseModel):
"""The response to the 'PathSegmentInfo' endpoint"""
data: PathSegmentInfo
type: Literal["path_segment_info"] = "path_segment_info"
model_config = ConfigDict(protected_namespaces=())
class path_get_curve_uuids_for_vertices(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'PathGetCurveUuidsForVertices' endpoint"""
data: PathGetCurveUuidsForVertices
@ -268,7 +262,7 @@ class path_get_curve_uuids_for_vertices(BaseModel):
class path_get_vertex_uuids(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'PathGetVertexUuids' endpoint"""
data: PathGetVertexUuids
@ -277,18 +271,8 @@ class path_get_vertex_uuids(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class plane_intersect_and_project(BaseModel):
"""The response from the ` ` command."""
data: PlaneIntersectAndProject
type: Literal["plane_intersect_and_project"] = "plane_intersect_and_project"
model_config = ConfigDict(protected_namespaces=())
class curve_get_end_points(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'CurveGetEndPoints' endpoint"""
data: CurveGetEndPoints
@ -297,8 +281,18 @@ class curve_get_end_points(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class plane_intersect_and_project(BaseModel):
"""The response to the 'PlaneIntersectAndProject' endpoint"""
data: PlaneIntersectAndProject
type: Literal["plane_intersect_and_project"] = "plane_intersect_and_project"
model_config = ConfigDict(protected_namespaces=())
class import_files(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'ImportFiles' endpoint"""
data: ImportFiles
@ -308,7 +302,7 @@ class import_files(BaseModel):
class mass(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Mass' endpoint"""
data: Mass
@ -318,7 +312,7 @@ class mass(BaseModel):
class volume(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Volume' endpoint"""
data: Volume
@ -328,7 +322,7 @@ class volume(BaseModel):
class density(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'Density' endpoint"""
data: Density
@ -338,7 +332,7 @@ class density(BaseModel):
class surface_area(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'SurfaceArea' endpoint"""
data: SurfaceArea
@ -348,7 +342,7 @@ class surface_area(BaseModel):
class center_of_mass(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'CenterOfMass' endpoint"""
data: CenterOfMass
@ -358,7 +352,7 @@ class center_of_mass(BaseModel):
class get_sketch_mode_plane(BaseModel):
"""The response from the ` ` command."""
"""The response to the 'GetSketchModePlane' endpoint"""
data: GetSketchModePlane
@ -367,6 +361,56 @@ class get_sketch_mode_plane(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_distance(BaseModel):
"""The response to the 'EntityGetDistance' endpoint"""
data: EntityGetDistance
type: Literal["entity_get_distance"] = "entity_get_distance"
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern(BaseModel):
"""The response to the 'EntityLinearPattern' endpoint"""
data: EntityLinearPattern
type: Literal["entity_linear_pattern"] = "entity_linear_pattern"
model_config = ConfigDict(protected_namespaces=())
class entity_circular_pattern(BaseModel):
"""The response to the 'EntityCircularPattern' endpoint"""
data: EntityCircularPattern
type: Literal["entity_circular_pattern"] = "entity_circular_pattern"
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_extrusion_face_info(BaseModel):
"""The response to the 'Solid3dGetExtrusionFaceInfo' endpoint"""
data: Solid3dGetExtrusionFaceInfo
type: Literal["solid3d_get_extrusion_face_info"] = "solid3d_get_extrusion_face_info"
model_config = ConfigDict(protected_namespaces=())
class extrusion_face_info(BaseModel):
"""The response to the 'ExtrusionFaceInfo' endpoint"""
data: ExtrusionFaceInfo
type: Literal["extrusion_face_info"] = "extrusion_face_info"
model_config = ConfigDict(protected_namespaces=())
OkModelingCmdResponse = RootModel[
Annotated[
Union[
@ -379,23 +423,22 @@ OkModelingCmdResponse = RootModel[
entity_get_parent_id,
entity_get_all_child_uuids,
select_get,
get_entity_type,
entity_get_distance,
entity_linear_pattern,
solid3d_get_all_edge_faces,
solid3d_get_all_opposite_edges,
solid3d_get_opposite_edge,
solid3d_get_prev_adjacent_edge,
solid3d_get_next_adjacent_edge,
mouse_click,
curve_get_type,
solid3d_get_prev_adjacent_edge,
get_entity_type,
curve_get_control_points,
curve_get_type,
mouse_click,
take_snapshot,
path_get_info,
path_segment_info,
path_get_curve_uuids_for_vertices,
path_get_vertex_uuids,
plane_intersect_and_project,
curve_get_end_points,
plane_intersect_and_project,
import_files,
mass,
volume,
@ -403,6 +446,11 @@ OkModelingCmdResponse = RootModel[
surface_area,
center_of_mass,
get_sketch_mode_plane,
entity_get_distance,
entity_linear_pattern,
entity_circular_pattern,
solid3d_get_extrusion_face_info,
extrusion_face_info,
],
Field(discriminator="type"),
]

View File

@ -18,6 +18,8 @@ class Org(BaseModel):
block: Optional[BlockReason] = None
can_train_on_data: Optional[bool] = None
created_at: datetime.datetime
domain: Optional[str] = None

View File

@ -0,0 +1,15 @@
from typing import List, Optional
from pydantic import BaseModel, ConfigDict
from ..models.org import Org
class OrgResultsPage(BaseModel):
"""A single page of results"""
items: List[Org]
next_page: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -2,12 +2,14 @@ from enum import Enum
class OrgRole(str, Enum):
"""The roles for users in an organization.""" # noqa: E501
"""The roles in an organization.""" # noqa: E501
"""# Admins can do anything in the org. """ # noqa: E501
ADMIN = "admin"
"""# Members of an org can not modify an org, but they belong in the org. """ # noqa: E501
MEMBER = "member"
"""# A service account role. """ # noqa: E501
SERVICE_ACCOUNT = "service_account"
def __str__(self) -> str:
return str(self.value)

View File

@ -4,6 +4,7 @@ from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
from ..models.angle import Angle
from ..models.length_unit import LengthUnit
from ..models.point2d import Point2d
from ..models.point3d import Point3d
@ -27,7 +28,7 @@ class arc(BaseModel):
end: Angle
radius: float
radius: LengthUnit
relative: bool
@ -59,7 +60,7 @@ class tangential_arc(BaseModel):
offset: Angle
radius: float
radius: LengthUnit
type: Literal["tangential_arc"] = "tangential_arc"

View File

@ -0,0 +1,17 @@
from enum import Enum
class PlanInterval(str, Enum):
"""A plan's interval.""" # noqa: E501
"""# Day. """ # noqa: E501
DAY = "day"
"""# Month. """ # noqa: E501
MONTH = "month"
"""# Week. """ # noqa: E501
WEEK = "week"
"""# Year. """ # noqa: E501
YEAR = "year"
def __str__(self) -> str:
return str(self.value)

View File

@ -1,13 +1,14 @@
from pydantic import BaseModel, ConfigDict
from ..models.length_unit import LengthUnit
class Point2d(BaseModel):
"""A point in 2D space"""
x: float
x: LengthUnit
y: float
y: LengthUnit
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,11 @@
from pydantic import BaseModel, ConfigDict
class PrivacySettings(BaseModel):
"""Privacy settings for an org or user."""
can_train_on_data: bool
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,35 @@
import datetime
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.uuid import Uuid
from .base64data import Base64Data
class SamlIdentityProvider(BaseModel):
"""A SAML identity provider."""
acs_url: str
created_at: datetime.datetime
id: Uuid
idp_entity_id: Optional[str] = None
idp_metadata_document_string: Optional[str] = None
org_id: Uuid
private_key: Optional[Base64Data] = None
public_cert: Optional[Base64Data] = None
slo_url: str
technical_contact_email: Optional[str] = None
updated_at: datetime.datetime
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,20 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.der_encoded_key_pair import DerEncodedKeyPair
from ..models.idp_metadata_source import IdpMetadataSource
class SamlIdentityProviderCreate(BaseModel):
"""Parameters for creating a SAML identity provider."""
idp_entity_id: Optional[str] = None
idp_metadata_source: IdpMetadataSource
signing_keypair: Optional[DerEncodedKeyPair] = None
technical_contact_email: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,31 @@
import datetime
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.uuid import Uuid
class ServiceAccount(BaseModel):
"""A service account.
These are used to authenticate orgs with Bearer authentication.
This works just like an API token, but it is tied to an organization versus an individual user.
"""
created_at: datetime.datetime
id: Uuid
is_valid: bool
label: Optional[str] = None
org_id: Uuid
token: Uuid
updated_at: datetime.datetime
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,15 @@
from typing import List, Optional
from pydantic import BaseModel, ConfigDict
from ..models.service_account import ServiceAccount
class ServiceAccountResultsPage(BaseModel):
"""A single page of results"""
items: List[ServiceAccount]
next_page: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -6,9 +6,7 @@ from ..models.uuid import Uuid
class Session(BaseModel):
"""An authentication session.
For our UIs, these are automatically created by Next.js."""
"""An authentication session."""
created_at: datetime.datetime

View File

@ -0,0 +1,13 @@
from typing import List
from pydantic import BaseModel, ConfigDict
from ..models.extrusion_face_info import ExtrusionFaceInfo
class Solid3dGetExtrusionFaceInfo(BaseModel):
"""Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)"""
faces: List[ExtrusionFaceInfo]
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,11 @@
from pydantic import BaseModel, ConfigDict
class StoreCouponParams(BaseModel):
"""The parameters for a new store coupon."""
percent_off: int
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,11 @@
from pydantic import BaseModel, ConfigDict
class SubscriptionTierFeature(BaseModel):
"""A subscription tier feature."""
info: str
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,50 @@
from typing import Literal, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
from ..models.plan_interval import PlanInterval
class flat(BaseModel):
"""A flat price that we publicly list."""
interval: PlanInterval
price: float
type: Literal["flat"] = "flat"
model_config = ConfigDict(protected_namespaces=())
class per_user(BaseModel):
"""A per user price that we publicly list."""
interval: PlanInterval
price: float
type: Literal["per_user"] = "per_user"
model_config = ConfigDict(protected_namespaces=())
class enterprise(BaseModel):
"""Enterprise: The price is not listed and the user needs to contact sales."""
type: Literal["enterprise"] = "enterprise"
model_config = ConfigDict(protected_namespaces=())
SubscriptionTierPrice = RootModel[
Annotated[
Union[
flat,
per_user,
enterprise,
],
Field(discriminator="type"),
]
]

View File

@ -0,0 +1,34 @@
from typing import Literal, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
class individual(BaseModel):
"""A subscription tier that can be applied to individuals only."""
type: Literal["individual"] = "individual"
model_config = ConfigDict(protected_namespaces=())
class organization(BaseModel):
"""An subscription tier that can be applied to organizations only."""
saml_sso: bool
type: Literal["organization"] = "organization"
model_config = ConfigDict(protected_namespaces=())
SubscriptionTierType = RootModel[
Annotated[
Union[
individual,
organization,
],
Field(discriminator="type"),
]
]

View File

@ -0,0 +1,15 @@
from enum import Enum
class SubscriptionTrainingDataBehavior(str, Enum):
"""An enum representing a subscription training data behavior.""" # noqa: E501
"""# The data is always used for training and cannot be turned off. """ # noqa: E501
ALWAYS = "always"
"""# The data is used for training by default, but can be turned off. """ # noqa: E501
DEFAULT_ON = "default_on"
"""# The data is not used for training by default, but can be turned on. """ # noqa: E501
DEFAULT_OFF = "default_off"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,17 @@
from enum import Enum
class SupportTier(str, Enum):
"""The support tier the subscription provides.""" # noqa: E501
"""# Community support. """ # noqa: E501
COMMUNITY = "community"
"""# Standard support. """ # noqa: E501
STANDARD = "standard"
"""# Premium support. """ # noqa: E501
PREMIUM = "premium"
"""# Priority support. """ # noqa: E501
PRIORITY = "priority"
def __str__(self) -> str:
return str(self.value)

View File

@ -1,12 +1,12 @@
from pydantic import BaseModel, ConfigDict
from ..models.org_role import OrgRole
from ..models.user_org_role import UserOrgRole
class UpdateMemberToOrgBody(BaseModel):
"""Data for updating a member of an org."""
role: OrgRole
role: UserOrgRole
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,16 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
class UpdatePaymentBalance(BaseModel):
"""The data for updating a balance."""
monthly_credits_remaining: Optional[float] = None
pre_pay_cash_remaining: Optional[float] = None
pre_pay_credits_remaining: Optional[float] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -15,6 +15,8 @@ class UpdateUser(BaseModel):
github: Optional[str] = None
image: str
last_name: Optional[str] = None
phone: Optional[str] = None

View File

@ -12,6 +12,8 @@ class User(BaseModel):
block: Optional[BlockReason] = None
can_train_on_data: Optional[bool] = None
company: Optional[str] = None
created_at: datetime.datetime
@ -30,6 +32,8 @@ class User(BaseModel):
image: str
is_service_account: Optional[bool] = None
last_name: Optional[str] = None
name: Optional[str] = None

View File

@ -0,0 +1,13 @@
from enum import Enum
class UserOrgRole(str, Enum):
"""The roles for users in an organization.""" # noqa: E501
"""# Admins can do anything in the org. """ # noqa: E501
ADMIN = "admin"
"""# Members of an org can not modify an org, but they belong in the org. """ # noqa: E501
MEMBER = "member"
def __str__(self) -> str:
return str(self.value)

View File

@ -6,10 +6,8 @@ from pydantic import BaseModel, ConfigDict
from ..models.uuid import Uuid
class VerificationToken(BaseModel):
"""A verification token for a user.
This is typically used to verify a user's email address."""
class VerificationTokenResponse(BaseModel):
"""A verification token response."""
created_at: datetime.datetime
@ -19,6 +17,8 @@ class VerificationToken(BaseModel):
identifier: Optional[str] = None
saml_redirect_url: Optional[str] = None
updated_at: datetime.datetime
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,40 @@
from typing import List, Optional, Union
from pydantic import BaseModel, ConfigDict, RootModel
from ..models.modeling_app_subscription_tier_name import ModelingAppSubscriptionTierName
from ..models.subscription_tier_feature import SubscriptionTierFeature
from ..models.subscription_tier_price import SubscriptionTierPrice
from ..models.subscription_tier_type import SubscriptionTierType
from ..models.subscription_training_data_behavior import (
SubscriptionTrainingDataBehavior,
)
from ..models.support_tier import SupportTier
from ..models.zoo_tool import ZooTool
class ZooProductSubscription0(BaseModel):
"""A subscription to the modeling app."""
description: str
features: Optional[List[SubscriptionTierFeature]] = None
name: ModelingAppSubscriptionTierName
pay_as_you_go_credits: float
price: SubscriptionTierPrice
support_tier: SupportTier
training_data_behavior: SubscriptionTrainingDataBehavior
type: SubscriptionTierType
zoo_tools_included: Optional[List[ZooTool]] = None
model_config = ConfigDict(protected_namespaces=())
ZooProductSubscription = RootModel[Union[ZooProductSubscription0,]]

View File

@ -0,0 +1,12 @@
from pydantic import BaseModel, ConfigDict
from ..models.modeling_app_subscription_tier import ModelingAppSubscriptionTier
class ZooProductSubscriptions(BaseModel):
"""A struct of Zoo product subscriptions."""
modeling_app: ModelingAppSubscriptionTier
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,15 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.modeling_app_organization_subscription_tier import (
ModelingAppOrganizationSubscriptionTier,
)
class ZooProductSubscriptionsOrgRequest(BaseModel):
"""A struct of Zoo product subscriptions an organization can request."""
modeling_app: Optional[ModelingAppOrganizationSubscriptionTier] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,15 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.modeling_app_individual_subscription_tier import (
ModelingAppIndividualSubscriptionTier,
)
class ZooProductSubscriptionsUserRequest(BaseModel):
"""A struct of Zoo product subscriptions a user can request."""
modeling_app: Optional[ModelingAppIndividualSubscriptionTier] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,15 @@
from enum import Enum
class ZooTool(str, Enum):
"""The Zoo tools that can make API calls.""" # noqa: E501
"""# The modeling app. """ # noqa: E501
MODELING_APP = "modeling_app"
"""# The Text-to-CAD UI. """ # noqa: E501
TEXT_TO_CAD = "text_to_cad"
"""# The Diff Chrome Extension. """ # noqa: E501
DIFF_CHROME_EXTENSION = "diff_chrome_extension"
def __str__(self) -> str:
return str(self.value)

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