diff --git a/generate/generate.py b/generate/generate.py index 661a82e14..295b1c985 100755 --- a/generate/generate.py +++ b/generate/generate.py @@ -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") diff --git a/generate/run.sh b/generate/run.sh index bc6796423..4d7d9682c 100755 --- a/generate/run.sh +++ b/generate/run.sh @@ -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. diff --git a/kittycad.py.patch.json b/kittycad.py.patch.json index 52dc3e76b..2999c9ad4 100644 --- a/kittycad.py.patch.json +++ b/kittycad.py.patch.json @@ -9,580 +9,212 @@ }, { "op": "add", - "path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python", + "path": "/paths/~1async~1operations~1{id}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1onboarding/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Onboarding = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment~1intent/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1ai-prompts~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_ai_prompt\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPrompt, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_prompt():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPrompt = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_ai_prompt.html" - } - }, - { - "op": "add", - "path": "/paths/~1internal~1discord~1api-token~1{discord_id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import internal_get_api_token_for_discord_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_internal_get_api_token_for_discord_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiToken, Error]\n ] = internal_get_api_token_for_discord_user.sync(\n client=client,\n discord_id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.internal_get_api_token_for_discord_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment/put/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_org.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_org.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment/delete/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1file~1center-of-mass/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment~1methods~1{id}/delete/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_org.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment~1invoices/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1apps~1github~1webhook/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html" - } - }, - { - "op": "add", - "path": "/paths/~1file~1execute~1{lang}/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html" - } - }, - { - "op": "add", - "path": "/paths/~1/get/x-python", - "value": { - "example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html" - } - }, - { - "op": "add", - "path": "/paths/~1apps~1github~1consent/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment~1methods/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment/put/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment/delete/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1members/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import create_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMember\nfrom kittycad.models.add_org_member import AddOrgMember\nfrom kittycad.models.org_role import OrgRole\nfrom kittycad.types import Response\n\n\ndef example_create_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMember, Error]] = create_org_member.sync(\n client=client,\n body=AddOrgMember(\n email=\"\",\n role=OrgRole.ADMIN,\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMember = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.create_org_member.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1members/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import list_org_members\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMemberResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.models.org_role import OrgRole\nfrom kittycad.types import Response\n\n\ndef example_list_org_members():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMemberResultsPage, Error]] = list_org_members.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n role=OrgRole.ADMIN,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMemberResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.list_org_members.html" - } - }, - { - "op": "add", - "path": "/paths/~1ai-prompts/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_ai_prompts\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPromptResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_ai_prompts():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPromptResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_ai_prompts.html" - } - }, - { - "op": "add", - "path": "/paths/~1users~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment~1balance/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1api-calls~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_org.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_power_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPowerConversion\nfrom kittycad.models.unit_power import UnitPower\nfrom kittycad.types import Response\n\n\ndef example_get_power_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPowerConversion, Error]\n ] = get_power_unit_conversion.sync(\n client=client,\n input_unit=UnitPower.BTU_PER_MINUTE,\n output_unit=UnitPower.BTU_PER_MINUTE,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPowerConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment~1tax/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1api-tokens/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import create_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_create_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = create_api_token_for_user.sync(\n client=client,\n label=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.create_api_token_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1api-tokens/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import list_api_tokens_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiTokenResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_tokens_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiTokenResultsPage, Error]\n ] = list_api_tokens_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiTokenResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.list_api_tokens_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1api-calls/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import org_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_org_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = org_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.org_list_api_calls.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1org/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_user_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserOrgInfo\nfrom kittycad.types import Response\n\n\ndef example_get_user_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserOrgInfo, Error]] = get_user_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserOrgInfo = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_user_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org/put/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import update_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Org\nfrom kittycad.models.org_details import OrgDetails\nfrom kittycad.types import Response\n\n\ndef example_update_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Org, Error]] = update_org.sync(\n client=client,\n body=OrgDetails(\n billing_email=\"\",\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Org = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.update_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import create_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Org\nfrom kittycad.models.org_details import OrgDetails\nfrom kittycad.types import Response\n\n\ndef example_create_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Org, Error]] = create_org.sync(\n client=client,\n body=OrgDetails(\n billing_email=\"\",\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Org = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.create_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Org\nfrom kittycad.types import Response\n\n\ndef example_get_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Org, Error]] = get_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Org = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1org/delete/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import delete_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.delete_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1api-calls~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n TextToCad,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n Error,\n ]\n ] = get_async_operation.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n ] = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html" } }, { "op": "add", "path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n", + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_pressure_unit_conversion.html" } }, { "op": "add", - "path": "/paths/~1org~1payment~1tax/get/x-python", + "path": "/paths/~1org~1payment~1methods~1{id}/delete/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_org.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_org.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_org.html" } }, { "op": "add", - "path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python", + "path": "/paths/~1async~1operations/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1file~1surface-area/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1text-to-cad~1{id}/post/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad_model_feedback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.ai_feedback import AiFeedback\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad_model_feedback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = create_text_to_cad_model_feedback.sync(\n client=client,\n id=\"\",\n feedback=AiFeedback.THUMBS_UP,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad_model_feedback.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1text-to-cad~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_text_to_cad_model_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.types import Response\n\n\ndef example_get_text_to_cad_model_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCad, Error]\n ] = get_text_to_cad_model_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1payment~1balance/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTemperatureConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitEnergyConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment~1methods/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1auth~1email~1callback/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"\",\n token=\"\",\n callback_url=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AsyncApiCallResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html" } }, { "op": "add", "path": "/paths/~1file~1volume/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n", + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_volume.html" } }, { "op": "add", - "path": "/paths/~1user~1api-calls/get/x-python", + "path": "/paths/~1user~1api-calls~1{id}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html" } }, { "op": "add", - "path": "/paths/~1apps~1github~1callback/get/x-python", + "path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html" } }, { "op": "add", - "path": "/paths/~1org~1members~1{user_id}/put/x-python", + "path": "/paths/~1user~1privacy/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import update_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMember\nfrom kittycad.models.org_role import OrgRole\nfrom kittycad.models.update_member_to_org_body import UpdateMemberToOrgBody\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_update_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMember, Error]] = update_org_member.sync(\n client=client,\n user_id=Uuid(\"\"),\n body=UpdateMemberToOrgBody(\n role=OrgRole.ADMIN,\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMember = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.update_org_member.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_privacy_settings\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PrivacySettings\nfrom kittycad.types import Response\n\n\ndef example_get_user_privacy_settings():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PrivacySettings, Error]\n ] = get_user_privacy_settings.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PrivacySettings = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_privacy_settings.html" } }, { "op": "add", - "path": "/paths/~1org~1members~1{user_id}/get/x-python", + "path": "/paths/~1user~1privacy/put/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMember\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_get_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMember, Error]] = get_org_member.sync(\n client=client,\n user_id=Uuid(\"\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMember = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_org_member.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import update_user_privacy_settings\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PrivacySettings\nfrom kittycad.models.privacy_settings import PrivacySettings\nfrom kittycad.types import Response\n\n\ndef example_update_user_privacy_settings():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PrivacySettings, Error]\n ] = update_user_privacy_settings.sync(\n client=client,\n body=PrivacySettings(\n can_train_on_data=False,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PrivacySettings = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.update_user_privacy_settings.html" } }, { "op": "add", - "path": "/paths/~1org~1members~1{user_id}/delete/x-python", + "path": "/paths/~1pricing~1subscriptions/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import delete_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_delete_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_org_member.sync(\n client=client,\n user_id=Uuid(\"\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.delete_org_member.html" + "example": "from kittycad.api.meta import get_pricing_subscriptions\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_pricing_subscriptions():\n # Create our client.\n client = ClientFromEnv()\n\n get_pricing_subscriptions.sync(\n client=client,\n )\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_pricing_subscriptions.html" } }, { "op": "add", - "path": "/paths/~1user/put/x-python", + "path": "/paths/~1user~1payment/delete/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import update_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.models.update_user import UpdateUser\nfrom kittycad.types import Response\n\n\ndef example_update_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = update_user_self.sync(\n client=client,\n body=UpdateUser(\n company=\"\",\n discord=\"\",\n first_name=\"\",\n github=\"\",\n last_name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.update_user_self.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html" } }, { "op": "add", - "path": "/paths/~1user/get/x-python", + "path": "/paths/~1user~1payment/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html" } }, { "op": "add", - "path": "/paths/~1user/delete/x-python", + "path": "/paths/~1user~1payment/put/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import delete_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.delete_user_self.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html" } }, { "op": "add", - "path": "/paths/~1user~1session~1{token}/get/x-python", + "path": "/paths/~1user~1payment/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_for_user.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html" } }, { "op": "add", - "path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python", + "path": "/paths/~1internal~1discord~1api-token~1{discord_id}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1ping/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html" - } - }, - { - "op": "add", - "path": "/paths/~1users-extended~1{id}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html" - } - }, - { - "op": "add", - "path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1api-call-metrics/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1text-to-cad/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_text_to_cad_models_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCadResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_text_to_cad_models_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCadResultsPage, Error]\n ] = list_text_to_cad_models_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n no_models=None, # Optional[bool]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCadResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_text_to_cad_models_for_user.html" - } - }, - { - "op": "add", - "path": "/paths/~1org~1payment~1invoices/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_org.html" - } - }, - { - "op": "add", - "path": "/paths/~1users/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html" - } - }, - { - "op": "add", - "path": "/paths/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_mass_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitMassConversion\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_get_mass_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitMassConversion, Error]\n ] = get_mass_unit_conversion.sync(\n client=client,\n input_unit=UnitMass.G,\n output_unit=UnitMass.G,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitMassConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_mass_unit_conversion.html" - } - }, - { - "op": "add", - "path": "/paths/~1user~1extended/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html" - } - }, - { - "op": "add", - "path": "/paths/~1api-calls/get/x-python", - "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import internal_get_api_token_for_discord_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_internal_get_api_token_for_discord_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiToken, Error]\n ] = internal_get_api_token_for_discord_user.sync(\n client=client,\n discord_id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.internal_get_api_token_for_discord_user.html" } }, { "op": "add", "path": "/paths/~1file~1mass/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n", + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_mass.html" } }, + { + "op": "add", + "path": "/paths/~1user~1payment~1intent/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1file~1execute~1{lang}/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1privacy/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_org_privacy_settings\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PrivacySettings\nfrom kittycad.types import Response\n\n\ndef example_get_org_privacy_settings():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PrivacySettings, Error]\n ] = get_org_privacy_settings.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PrivacySettings = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_org_privacy_settings.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1privacy/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import update_org_privacy_settings\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PrivacySettings\nfrom kittycad.models.privacy_settings import PrivacySettings\nfrom kittycad.types import Response\n\n\ndef example_update_org_privacy_settings():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PrivacySettings, Error]\n ] = update_org_privacy_settings.sync(\n client=client,\n body=PrivacySettings(\n can_train_on_data=False,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PrivacySettings = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.update_org_privacy_settings.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment~1subscriptions/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_org_subscription\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ZooProductSubscriptions\nfrom kittycad.types import Response\n\n\ndef example_get_org_subscription():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ZooProductSubscriptions, Error]\n ] = get_org_subscription.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ZooProductSubscriptions = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_org_subscription.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment~1subscriptions/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_org_subscription\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ZooProductSubscriptions\nfrom kittycad.models.modeling_app_organization_subscription_tier import (\n ModelingAppOrganizationSubscriptionTier,\n)\nfrom kittycad.models.zoo_product_subscriptions_org_request import (\n ZooProductSubscriptionsOrgRequest,\n)\nfrom kittycad.types import Response\n\n\ndef example_create_org_subscription():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ZooProductSubscriptions, Error]\n ] = create_org_subscription.sync(\n client=client,\n body=ZooProductSubscriptionsOrgRequest(\n modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ZooProductSubscriptions = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_org_subscription.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment~1subscriptions/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_org_subscription\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ZooProductSubscriptions\nfrom kittycad.models.modeling_app_organization_subscription_tier import (\n ModelingAppOrganizationSubscriptionTier,\n)\nfrom kittycad.models.zoo_product_subscriptions_org_request import (\n ZooProductSubscriptionsOrgRequest,\n)\nfrom kittycad.types import Response\n\n\ndef example_update_org_subscription():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ZooProductSubscriptions, Error]\n ] = update_org_subscription.sync(\n client=client,\n body=ZooProductSubscriptionsOrgRequest(\n modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ZooProductSubscriptions = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_org_subscription.html" + } + }, + { + "op": "add", + "path": "/paths/~1orgs~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_any_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Org\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_get_any_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Org, Error]] = get_any_org.sync(\n client=client,\n id=Uuid(\"\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Org = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_any_org.html" + } + }, { "op": "add", "path": "/paths/~1ws~1modeling~1commands/get/x-python", @@ -593,74 +225,314 @@ }, { "op": "add", - "path": "/paths/~1async~1operations~1{id}/get/x-python", + "path": "/paths/~1org~1payment~1intent/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n TextToCad,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n Error,\n ]\n ] = get_async_operation.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n ] = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_org.html" } }, { "op": "add", - "path": "/paths/~1users~1{id}~1api-calls/get/x-python", + "path": "/paths/~1user~1payment~1invoices/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_user.html" } }, { "op": "add", - "path": "/paths/~1user~1payment~1intent/post/x-python", + "path": "/paths/~1api-calls~1{id}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html" } }, { "op": "add", - "path": "/paths/~1user~1api-calls~1{id}/get/x-python", + "path": "/paths/~1/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html" + "example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html" + } + }, + { + "op": "add", + "path": "/paths/~1orgs/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import list_orgs\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_orgs():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgResultsPage, Error]] = list_orgs.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.list_orgs.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment~1balance/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment~1invoices/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1store~1coupon/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.store import create_store_coupon\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import DiscountCode, Error\nfrom kittycad.models.store_coupon_params import StoreCouponParams\nfrom kittycad.types import Response\n\n\ndef example_create_store_coupon():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[DiscountCode, Error]] = create_store_coupon.sync(\n client=client,\n body=StoreCouponParams(\n percent_off=10,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: DiscountCode = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.store.create_store_coupon.html" + } + }, + { + "op": "add", + "path": "/paths/~1users~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1payment~1methods/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1service-accounts/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.service_accounts import list_service_accounts_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ServiceAccountResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_service_accounts_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ServiceAccountResultsPage, Error]\n ] = list_service_accounts_for_org.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ServiceAccountResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.service_accounts.list_service_accounts_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1service-accounts/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.service_accounts import create_service_account_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ServiceAccount\nfrom kittycad.types import Response\n\n\ndef example_create_service_account_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ServiceAccount, Error]\n ] = create_service_account_for_org.sync(\n client=client,\n label=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ServiceAccount = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.service_accounts.create_service_account_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1orgs~1{id}~1payment~1balance/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_any_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_any_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_any_org.sync(\n client=client,\n id=Uuid(\"\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_any_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1orgs~1{id}~1payment~1balance/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_balance_for_any_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.models.update_payment_balance import UpdatePaymentBalance\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_update_payment_balance_for_any_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = update_payment_balance_for_any_org.sync(\n client=client,\n id=Uuid(\"\"),\n body=UpdatePaymentBalance(),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_balance_for_any_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1extended/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html" + } + }, + { + "op": "add", + "path": "/paths/~1file~1surface-area/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html" + } + }, + { + "op": "add", + "path": "/paths/~1user/delete/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import delete_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.delete_user_self.html" + } + }, + { + "op": "add", + "path": "/paths/~1user/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self.html" + } + }, + { + "op": "add", + "path": "/paths/~1user/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import update_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.models.update_user import UpdateUser\nfrom kittycad.types import Response\n\n\ndef example_update_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = update_user_self.sync(\n client=client,\n body=UpdateUser(\n company=\"\",\n discord=\"\",\n first_name=\"\",\n github=\"\",\n image=\"\",\n last_name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.update_user_self.html" } }, { "op": "add", "path": "/paths/~1logout/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.logout.html" } }, { "op": "add", - "path": "/paths/~1_meta~1info/get/x-python", + "path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_metadata\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Metadata\nfrom kittycad.types import Response\n\n\ndef example_get_metadata():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Metadata, Error]] = get_metadata.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Metadata = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_metadata.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitEnergyConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html" } }, { "op": "add", - "path": "/paths/~1file~1density/post/x-python", + "path": "/paths/~1user~1payment~1tax/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html" } }, { "op": "add", - "path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python", + "path": "/paths/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_mass_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitMassConversion\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_get_mass_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitMassConversion, Error]\n ] = get_mass_unit_conversion.sync(\n client=client,\n input_unit=UnitMass.G,\n output_unit=UnitMass.G,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitMassConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_mass_unit_conversion.html" } }, { "op": "add", - "path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python", + "path": "/paths/~1auth~1email~1callback/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"\",\n token=\"\",\n callback_url=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1payment~1balance/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment~1tax/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1text-to-cad~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_text_to_cad_model_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.types import Response\n\n\ndef example_get_text_to_cad_model_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCad, Error]\n ] = get_text_to_cad_model_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1text-to-cad~1{id}/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad_model_feedback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.ai_feedback import AiFeedback\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad_model_feedback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = create_text_to_cad_model_feedback.sync(\n client=client,\n id=\"\",\n feedback=AiFeedback.THUMBS_UP,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad_model_feedback.html" + } + }, + { + "op": "add", + "path": "/paths/~1users-extended/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html" + } + }, + { + "op": "add", + "path": "/paths/~1ping/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1api-calls/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment~1methods/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1apps~1github~1callback/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html" + } + }, + { + "op": "add", + "path": "/paths/~1auth~1saml~1provider~1{provider_id}~1login/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import get_auth_saml\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_get_auth_saml():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = get_auth_saml.sync(\n client=client,\n provider_id=Uuid(\"\"),\n callback_url=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.get_auth_saml.html" + } + }, + { + "op": "add", + "path": "/paths/~1auth~1saml~1provider~1{provider_id}~1login/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import post_auth_saml\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_post_auth_saml():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = post_auth_saml.sync(\n client=client,\n provider_id=Uuid(\"\"),\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.post_auth_saml.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1session~1{token}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1file~1center-of-mass/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html" } }, { @@ -673,74 +545,458 @@ }, { "op": "add", - "path": "/paths/~1auth~1email/post/x-python", + "path": "/paths/~1ai~1kcl~1completions/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, VerificationToken\nfrom kittycad.models.email_authentication_form import EmailAuthenticationForm\nfrom kittycad.types import Response\n\n\ndef example_auth_email():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[VerificationToken, Error]] = auth_email.sync(\n client=client,\n body=EmailAuthenticationForm(\n email=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: VerificationToken = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_kcl_code_completions\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, KclCodeCompletionResponse\nfrom kittycad.models.kcl_code_completion_params import KclCodeCompletionParams\nfrom kittycad.models.kcl_code_completion_request import KclCodeCompletionRequest\nfrom kittycad.types import Response\n\n\ndef example_create_kcl_code_completions():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[KclCodeCompletionResponse, Error]\n ] = create_kcl_code_completions.sync(\n client=client,\n body=KclCodeCompletionRequest(\n extra=KclCodeCompletionParams(\n language=\"\",\n trim_by_indentation=False,\n ),\n prompt=\"\",\n stop=[\"\"],\n stream=False,\n suffix=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: KclCodeCompletionResponse = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_kcl_code_completions.html" } }, { "op": "add", - "path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python", + "path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html" } }, { "op": "add", - "path": "/paths/~1user~1api-tokens~1{token}/get/x-python", + "path": "/paths/~1_meta~1info/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.get_api_token_for_user.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_metadata\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Metadata\nfrom kittycad.types import Response\n\n\ndef example_get_metadata():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Metadata, Error]] = get_metadata.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Metadata = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_metadata.html" } }, { "op": "add", - "path": "/paths/~1user~1api-tokens~1{token}/delete/x-python", + "path": "/paths/~1file~1density/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import delete_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.delete_api_token_for_user.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html" } }, { "op": "add", - "path": "/paths/~1users-extended/get/x-python", + "path": "/paths/~1org~1saml~1idp/delete/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import delete_org_saml_idp\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_org_saml_idp():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_org_saml_idp.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.delete_org_saml_idp.html" } }, { "op": "add", - "path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python", + "path": "/paths/~1org~1saml~1idp/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import create_org_saml_idp\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, SamlIdentityProvider\nfrom kittycad.models.idp_metadata_source import base64_encoded_xml\nfrom kittycad.models.saml_identity_provider_create import (\n SamlIdentityProviderCreate,\n)\nfrom kittycad.types import Response\n\n\ndef example_create_org_saml_idp():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[SamlIdentityProvider, Error]\n ] = create_org_saml_idp.sync(\n client=client,\n body=SamlIdentityProviderCreate(\n idp_entity_id=\"\",\n idp_metadata_source=base64_encoded_xml(\n data=\"\",\n ),\n technical_contact_email=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: SamlIdentityProvider = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.create_org_saml_idp.html" } }, { "op": "add", - "path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python", + "path": "/paths/~1org~1saml~1idp/put/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import update_org_saml_idp\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, SamlIdentityProvider\nfrom kittycad.models.idp_metadata_source import base64_encoded_xml\nfrom kittycad.models.saml_identity_provider_create import (\n SamlIdentityProviderCreate,\n)\nfrom kittycad.types import Response\n\n\ndef example_update_org_saml_idp():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[SamlIdentityProvider, Error]\n ] = update_org_saml_idp.sync(\n client=client,\n body=SamlIdentityProviderCreate(\n idp_entity_id=\"\",\n idp_metadata_source=base64_encoded_xml(\n data=\"\",\n ),\n technical_contact_email=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: SamlIdentityProvider = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.update_org_saml_idp.html" } }, { "op": "add", - "path": "/paths/~1async~1operations/get/x-python", + "path": "/paths/~1org~1saml~1idp/get/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AsyncApiCallResultsPage = result\n print(body)\n", - "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html" + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_org_saml_idp\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, SamlIdentityProvider\nfrom kittycad.types import Response\n\n\ndef example_get_org_saml_idp():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[SamlIdentityProvider, Error]] = get_org_saml_idp.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: SamlIdentityProvider = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_org_saml_idp.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1members/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import list_org_members\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMemberResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.models.user_org_role import UserOrgRole\nfrom kittycad.types import Response\n\n\ndef example_list_org_members():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMemberResultsPage, Error]] = list_org_members.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n role=UserOrgRole.ADMIN,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMemberResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.list_org_members.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1members/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import create_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMember\nfrom kittycad.models.add_org_member import AddOrgMember\nfrom kittycad.models.user_org_role import UserOrgRole\nfrom kittycad.types import Response\n\n\ndef example_create_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMember, Error]] = create_org_member.sync(\n client=client,\n body=AddOrgMember(\n email=\"\",\n role=UserOrgRole.ADMIN,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMember = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.create_org_member.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1service-accounts~1{token}/delete/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.service_accounts import delete_service_account_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_service_account_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_service_account_for_org.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.service_accounts.delete_service_account_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1service-accounts~1{token}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.service_accounts import get_service_account_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ServiceAccount\nfrom kittycad.types import Response\n\n\ndef example_get_service_account_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ServiceAccount, Error]\n ] = get_service_account_for_org.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ServiceAccount = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.service_accounts.get_service_account_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1ai-prompts~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_ai_prompt\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPrompt, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_prompt():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPrompt = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_ai_prompt.html" } }, { "op": "add", "path": "/paths/~1ai~1text-to-cad~1{output_format}/post/x-python", "value": { - "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.text_to_cad_create_body import TextToCadCreateBody\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n body=TextToCadCreateBody(\n prompt=\"\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n", + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.text_to_cad_create_body import TextToCadCreateBody\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n body=TextToCadCreateBody(\n prompt=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n", "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad.html" } + }, + { + "op": "add", + "path": "/paths/~1org/delete/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import delete_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.delete_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import create_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Org\nfrom kittycad.models.org_details import OrgDetails\nfrom kittycad.types import Response\n\n\ndef example_create_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Org, Error]] = create_org.sync(\n client=client,\n body=OrgDetails(\n billing_email=\"\",\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Org = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.create_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import update_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Org\nfrom kittycad.models.org_details import OrgDetails\nfrom kittycad.types import Response\n\n\ndef example_update_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Org, Error]] = update_org.sync(\n client=client,\n body=OrgDetails(\n billing_email=\"\",\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Org = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.update_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Org\nfrom kittycad.types import Response\n\n\ndef example_get_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Org, Error]] = get_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Org = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1api-calls/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import org_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_org_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = org_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.org_list_api_calls.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1api-tokens/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import list_api_tokens_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiTokenResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_tokens_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiTokenResultsPage, Error]\n ] = list_api_tokens_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiTokenResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.list_api_tokens_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1api-tokens/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import create_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_create_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = create_api_token_for_user.sync(\n client=client,\n label=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.create_api_token_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1payment~1subscriptions/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_user_subscription\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ZooProductSubscriptions\nfrom kittycad.types import Response\n\n\ndef example_get_user_subscription():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ZooProductSubscriptions, Error]\n ] = get_user_subscription.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ZooProductSubscriptions = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_user_subscription.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1payment~1subscriptions/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_user_subscription\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ZooProductSubscriptions\nfrom kittycad.models.modeling_app_individual_subscription_tier import (\n ModelingAppIndividualSubscriptionTier,\n)\nfrom kittycad.models.zoo_product_subscriptions_user_request import (\n ZooProductSubscriptionsUserRequest,\n)\nfrom kittycad.types import Response\n\n\ndef example_create_user_subscription():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ZooProductSubscriptions, Error]\n ] = create_user_subscription.sync(\n client=client,\n body=ZooProductSubscriptionsUserRequest(\n modeling_app=ModelingAppIndividualSubscriptionTier.FREE,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ZooProductSubscriptions = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_user_subscription.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1payment~1subscriptions/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_user_subscription\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ZooProductSubscriptions\nfrom kittycad.models.modeling_app_individual_subscription_tier import (\n ModelingAppIndividualSubscriptionTier,\n)\nfrom kittycad.models.zoo_product_subscriptions_user_request import (\n ZooProductSubscriptionsUserRequest,\n)\nfrom kittycad.types import Response\n\n\ndef example_update_user_subscription():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ZooProductSubscriptions, Error]\n ] = update_user_subscription.sync(\n client=client,\n body=ZooProductSubscriptionsUserRequest(\n modeling_app=ModelingAppIndividualSubscriptionTier.FREE,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ZooProductSubscriptions = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_user_subscription.html" + } + }, + { + "op": "add", + "path": "/paths/~1ai-prompts/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_ai_prompts\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPromptResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_ai_prompts():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPromptResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_ai_prompts.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment/delete/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_org.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_org.sync(\n client=client,\n body=BillingInfo(\n name=\"\",\n phone=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1payment/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1users~1{id}~1payment~1balance/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_any_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_any_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_any_user.sync(\n client=client,\n id=Uuid(\"\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_any_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1users~1{id}~1payment~1balance/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_balance_for_any_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.models.update_payment_balance import UpdatePaymentBalance\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_update_payment_balance_for_any_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = update_payment_balance_for_any_user.sync(\n client=client,\n id=Uuid(\"\"),\n body=UpdatePaymentBalance(),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_balance_for_any_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1users-extended~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html" + } + }, + { + "op": "add", + "path": "/paths/~1users~1{id}~1api-calls/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1_meta~1ipinfo/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_ipinfo\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, IpAddrInfo\nfrom kittycad.types import Response\n\n\ndef example_get_ipinfo():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[IpAddrInfo, Error]] = get_ipinfo.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: IpAddrInfo = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_ipinfo.html" + } + }, + { + "op": "add", + "path": "/paths/~1api-calls/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1oauth2~1providers/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_oauth2_providers_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AccountProvider, Error\nfrom kittycad.types import Response\n\n\ndef example_get_oauth2_providers_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[AccountProvider], Error]\n ] = get_oauth2_providers_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[AccountProvider] = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_oauth2_providers_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1auth~1email/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, VerificationTokenResponse\nfrom kittycad.models.email_authentication_form import EmailAuthenticationForm\nfrom kittycad.types import Response\n\n\ndef example_auth_email():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[VerificationTokenResponse, Error]] = auth_email.sync(\n client=client,\n body=EmailAuthenticationForm(\n email=\"\",\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: VerificationTokenResponse = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email.html" + } + }, + { + "op": "add", + "path": "/paths/~1apps~1github~1webhook/post/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1onboarding/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Onboarding = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html" + } + }, + { + "op": "add", + "path": "/paths/~1apps~1github~1consent/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1api-call-metrics/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html" + } + }, + { + "op": "add", + "path": "/paths/~1users/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1api-tokens~1{token}/delete/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import delete_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.delete_api_token_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1api-tokens~1{token}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.get_api_token_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_power_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPowerConversion\nfrom kittycad.models.unit_power import UnitPower\nfrom kittycad.types import Response\n\n\ndef example_get_power_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPowerConversion, Error]\n ] = get_power_unit_conversion.sync(\n client=client,\n input_unit=UnitPower.BTU_PER_MINUTE,\n output_unit=UnitPower.BTU_PER_MINUTE,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPowerConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTemperatureConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1orgs~1{id}~1enterprise~1pricing/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import update_enterprise_pricing_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ZooProductSubscriptions\nfrom kittycad.models.plan_interval import PlanInterval\nfrom kittycad.models.subscription_tier_price import per_user\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_update_enterprise_pricing_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ZooProductSubscriptions, Error]\n ] = update_enterprise_pricing_for_org.sync(\n client=client,\n id=Uuid(\"\"),\n body=per_user(\n interval=PlanInterval.DAY,\n price=3.14,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ZooProductSubscriptions = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.update_enterprise_pricing_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1api-calls~1{id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_org.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1members~1{user_id}/delete/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import delete_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_delete_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_org_member.sync(\n client=client,\n user_id=Uuid(\"\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.delete_org_member.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1members~1{user_id}/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMember\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_get_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMember, Error]] = get_org_member.sync(\n client=client,\n user_id=Uuid(\"\"),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMember = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_org_member.html" + } + }, + { + "op": "add", + "path": "/paths/~1org~1members~1{user_id}/put/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import update_org_member\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, OrgMember\nfrom kittycad.models.update_member_to_org_body import UpdateMemberToOrgBody\nfrom kittycad.models.user_org_role import UserOrgRole\nfrom kittycad.models.uuid import Uuid\nfrom kittycad.types import Response\n\n\ndef example_update_org_member():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[OrgMember, Error]] = update_org_member.sync(\n client=client,\n user_id=Uuid(\"\"),\n body=UpdateMemberToOrgBody(\n role=UserOrgRole.ADMIN,\n ),\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: OrgMember = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.update_org_member.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1text-to-cad/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_text_to_cad_models_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCadResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_text_to_cad_models_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCadResultsPage, Error]\n ] = list_text_to_cad_models_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n no_models=None, # Optional[bool]\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCadResultsPage = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_text_to_cad_models_for_user.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1org/get/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.orgs import get_user_org\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserOrgInfo\nfrom kittycad.types import Response\n\n\ndef example_get_user_org():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserOrgInfo, Error]] = get_user_org.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserOrgInfo = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.orgs.get_user_org.html" + } + }, + { + "op": "add", + "path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python", + "value": { + "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"\",\n )\n\n if isinstance(result, Error) or result is None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", + "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html" + } } ] \ No newline at end of file diff --git a/kittycad/api/ai/create_kcl_code_completions.py b/kittycad/api/ai/create_kcl_code_completions.py new file mode 100644 index 000000000..376f40ced --- /dev/null +++ b/kittycad/api/ai/create_kcl_code_completions.py @@ -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 diff --git a/kittycad/api/ai/create_text_to_cad.py b/kittycad/api/ai/create_text_to_cad.py index bb88f7855..d22b49869 100644 --- a/kittycad/api/ai/create_text_to_cad.py +++ b/kittycad/api/ai/create_text_to_cad.py @@ -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 ( diff --git a/kittycad/api/hidden/auth_email.py b/kittycad/api/hidden/auth_email.py index 1bdce317e..dc214adab 100644 --- a/kittycad/api/hidden/auth_email.py +++ b/kittycad/api/hidden/auth_email.py @@ -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, diff --git a/kittycad/api/hidden/get_auth_saml.py b/kittycad/api/hidden/get_auth_saml.py new file mode 100644 index 000000000..00b0d4d80 --- /dev/null +++ b/kittycad/api/hidden/get_auth_saml.py @@ -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 diff --git a/kittycad/api/hidden/post_auth_saml.py b/kittycad/api/hidden/post_auth_saml.py new file mode 100644 index 000000000..8e6b1769c --- /dev/null +++ b/kittycad/api/hidden/post_auth_saml.py @@ -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 diff --git a/kittycad/api/meta/get_ipinfo.py b/kittycad/api/meta/get_ipinfo.py new file mode 100644 index 000000000..da7ce08dc --- /dev/null +++ b/kittycad/api/meta/get_ipinfo.py @@ -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 diff --git a/kittycad/api/meta/get_pricing_subscriptions.py b/kittycad/api/meta/get_pricing_subscriptions.py new file mode 100644 index 000000000..4bb270f59 --- /dev/null +++ b/kittycad/api/meta/get_pricing_subscriptions.py @@ -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 diff --git a/kittycad/api/orgs/create_org_member.py b/kittycad/api/orgs/create_org_member.py index 5686f0b73..72331cb93 100644 --- a/kittycad/api/orgs/create_org_member.py +++ b/kittycad/api/orgs/create_org_member.py @@ -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( diff --git a/kittycad/api/orgs/create_org_saml_idp.py b/kittycad/api/orgs/create_org_saml_idp.py new file mode 100644 index 000000000..4fd1de47d --- /dev/null +++ b/kittycad/api/orgs/create_org_saml_idp.py @@ -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 diff --git a/kittycad/api/orgs/delete_org_saml_idp.py b/kittycad/api/orgs/delete_org_saml_idp.py new file mode 100644 index 000000000..f99ef498d --- /dev/null +++ b/kittycad/api/orgs/delete_org_saml_idp.py @@ -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 diff --git a/kittycad/api/orgs/get_any_org.py b/kittycad/api/orgs/get_any_org.py new file mode 100644 index 000000000..a7e6ddbd9 --- /dev/null +++ b/kittycad/api/orgs/get_any_org.py @@ -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 diff --git a/kittycad/api/orgs/get_org_privacy_settings.py b/kittycad/api/orgs/get_org_privacy_settings.py new file mode 100644 index 000000000..1108ea86a --- /dev/null +++ b/kittycad/api/orgs/get_org_privacy_settings.py @@ -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 diff --git a/kittycad/api/orgs/get_org_saml_idp.py b/kittycad/api/orgs/get_org_saml_idp.py new file mode 100644 index 000000000..56cc83626 --- /dev/null +++ b/kittycad/api/orgs/get_org_saml_idp.py @@ -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 diff --git a/kittycad/api/orgs/list_org_members.py b/kittycad/api/orgs/list_org_members.py index 1f75a2d23..8288bef59 100644 --- a/kittycad/api/orgs/list_org_members.py +++ b/kittycad/api/orgs/list_org_members.py @@ -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, diff --git a/kittycad/api/orgs/list_orgs.py b/kittycad/api/orgs/list_orgs.py new file mode 100644 index 000000000..9f17f5732 --- /dev/null +++ b/kittycad/api/orgs/list_orgs.py @@ -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 diff --git a/kittycad/api/orgs/update_enterprise_pricing_for_org.py b/kittycad/api/orgs/update_enterprise_pricing_for_org.py new file mode 100644 index 000000000..02fdd9a2e --- /dev/null +++ b/kittycad/api/orgs/update_enterprise_pricing_for_org.py @@ -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 diff --git a/kittycad/api/orgs/update_org_privacy_settings.py b/kittycad/api/orgs/update_org_privacy_settings.py new file mode 100644 index 000000000..5f3c041d7 --- /dev/null +++ b/kittycad/api/orgs/update_org_privacy_settings.py @@ -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 diff --git a/kittycad/api/orgs/update_org_saml_idp.py b/kittycad/api/orgs/update_org_saml_idp.py new file mode 100644 index 000000000..25928c1ad --- /dev/null +++ b/kittycad/api/orgs/update_org_saml_idp.py @@ -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 diff --git a/kittycad/api/payments/create_org_subscription.py b/kittycad/api/payments/create_org_subscription.py new file mode 100644 index 000000000..959687d82 --- /dev/null +++ b/kittycad/api/payments/create_org_subscription.py @@ -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 diff --git a/kittycad/api/payments/create_user_subscription.py b/kittycad/api/payments/create_user_subscription.py new file mode 100644 index 000000000..6c8756726 --- /dev/null +++ b/kittycad/api/payments/create_user_subscription.py @@ -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 diff --git a/kittycad/api/payments/get_org_subscription.py b/kittycad/api/payments/get_org_subscription.py new file mode 100644 index 000000000..4b55dd9d3 --- /dev/null +++ b/kittycad/api/payments/get_org_subscription.py @@ -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 diff --git a/kittycad/api/payments/get_payment_balance_for_any_org.py b/kittycad/api/payments/get_payment_balance_for_any_org.py new file mode 100644 index 000000000..a213bbc23 --- /dev/null +++ b/kittycad/api/payments/get_payment_balance_for_any_org.py @@ -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 diff --git a/kittycad/api/payments/get_payment_balance_for_any_user.py b/kittycad/api/payments/get_payment_balance_for_any_user.py new file mode 100644 index 000000000..1e8aafa3a --- /dev/null +++ b/kittycad/api/payments/get_payment_balance_for_any_user.py @@ -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 diff --git a/kittycad/api/payments/get_user_subscription.py b/kittycad/api/payments/get_user_subscription.py new file mode 100644 index 000000000..51db22d95 --- /dev/null +++ b/kittycad/api/payments/get_user_subscription.py @@ -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 diff --git a/kittycad/api/payments/update_org_subscription.py b/kittycad/api/payments/update_org_subscription.py new file mode 100644 index 000000000..ddc1e8da0 --- /dev/null +++ b/kittycad/api/payments/update_org_subscription.py @@ -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 diff --git a/kittycad/api/payments/update_payment_balance_for_any_org.py b/kittycad/api/payments/update_payment_balance_for_any_org.py new file mode 100644 index 000000000..8c9766328 --- /dev/null +++ b/kittycad/api/payments/update_payment_balance_for_any_org.py @@ -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 diff --git a/kittycad/api/payments/update_payment_balance_for_any_user.py b/kittycad/api/payments/update_payment_balance_for_any_user.py new file mode 100644 index 000000000..061d926b7 --- /dev/null +++ b/kittycad/api/payments/update_payment_balance_for_any_user.py @@ -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 diff --git a/kittycad/api/payments/update_user_subscription.py b/kittycad/api/payments/update_user_subscription.py new file mode 100644 index 000000000..733d9c5cb --- /dev/null +++ b/kittycad/api/payments/update_user_subscription.py @@ -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 diff --git a/kittycad/api/service_accounts/__init__.py b/kittycad/api/service_accounts/__init__.py new file mode 100644 index 000000000..c0e3e3a6f --- /dev/null +++ b/kittycad/api/service_accounts/__init__.py @@ -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 diff --git a/kittycad/api/service_accounts/create_service_account_for_org.py b/kittycad/api/service_accounts/create_service_account_for_org.py new file mode 100644 index 000000000..11752bfcb --- /dev/null +++ b/kittycad/api/service_accounts/create_service_account_for_org.py @@ -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 diff --git a/kittycad/api/service_accounts/delete_service_account_for_org.py b/kittycad/api/service_accounts/delete_service_account_for_org.py new file mode 100644 index 000000000..dfe8ded09 --- /dev/null +++ b/kittycad/api/service_accounts/delete_service_account_for_org.py @@ -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 diff --git a/kittycad/api/service_accounts/get_service_account_for_org.py b/kittycad/api/service_accounts/get_service_account_for_org.py new file mode 100644 index 000000000..2bbcbe9b6 --- /dev/null +++ b/kittycad/api/service_accounts/get_service_account_for_org.py @@ -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 diff --git a/kittycad/api/service_accounts/list_service_accounts_for_org.py b/kittycad/api/service_accounts/list_service_accounts_for_org.py new file mode 100644 index 000000000..ed05ccbe1 --- /dev/null +++ b/kittycad/api/service_accounts/list_service_accounts_for_org.py @@ -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 diff --git a/kittycad/api/store/__init__.py b/kittycad/api/store/__init__.py new file mode 100644 index 000000000..967461f68 --- /dev/null +++ b/kittycad/api/store/__init__.py @@ -0,0 +1 @@ +""" Contains methods for accessing the store API paths: Operations involving our swag store. """ # noqa: E501 diff --git a/kittycad/api/store/create_store_coupon.py b/kittycad/api/store/create_store_coupon.py new file mode 100644 index 000000000..24314d004 --- /dev/null +++ b/kittycad/api/store/create_store_coupon.py @@ -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 diff --git a/kittycad/api/users/get_oauth2_providers_for_user.py b/kittycad/api/users/get_oauth2_providers_for_user.py new file mode 100644 index 000000000..26b55057b --- /dev/null +++ b/kittycad/api/users/get_oauth2_providers_for_user.py @@ -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 diff --git a/kittycad/api/users/get_user_privacy_settings.py b/kittycad/api/users/get_user_privacy_settings.py new file mode 100644 index 000000000..e00d95c3d --- /dev/null +++ b/kittycad/api/users/get_user_privacy_settings.py @@ -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 diff --git a/kittycad/api/users/list_users.py b/kittycad/api/users/list_users.py index 2a3358053..9b09b6681 100644 --- a/kittycad/api/users/list_users.py +++ b/kittycad/api/users/list_users.py @@ -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( diff --git a/kittycad/api/users/list_users_extended.py b/kittycad/api/users/list_users_extended.py index 12827951f..c3a5a1ede 100644 --- a/kittycad/api/users/list_users_extended.py +++ b/kittycad/api/users/list_users_extended.py @@ -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( diff --git a/kittycad/api/users/update_user_privacy_settings.py b/kittycad/api/users/update_user_privacy_settings.py new file mode 100644 index 000000000..e840a722e --- /dev/null +++ b/kittycad/api/users/update_user_privacy_settings.py @@ -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 diff --git a/kittycad/examples_test.py b/kittycad/examples_test.py index 04ccf6da1..f379d14be 100644 --- a/kittycad/examples_test.py +++ b/kittycad/examples_test.py @@ -3,6 +3,7 @@ from typing import List, Optional, Union import pytest from kittycad.api.ai import ( + create_kcl_code_completions, create_text_to_cad, create_text_to_cad_model_feedback, get_ai_prompt, @@ -42,9 +43,17 @@ from kittycad.api.file import ( create_file_surface_area, create_file_volume, ) -from kittycad.api.hidden import auth_email, auth_email_callback, logout +from kittycad.api.hidden import ( + auth_email, + auth_email_callback, + get_auth_saml, + logout, + post_auth_saml, +) from kittycad.api.meta import ( + get_ipinfo, get_metadata, + get_pricing_subscriptions, get_schema, internal_get_api_token_for_discord_user, ping, @@ -53,37 +62,63 @@ from kittycad.api.modeling import modeling_commands_ws from kittycad.api.orgs import ( create_org, create_org_member, + create_org_saml_idp, delete_org, delete_org_member, + delete_org_saml_idp, + get_any_org, get_org, get_org_member, + get_org_privacy_settings, + get_org_saml_idp, get_user_org, list_org_members, + list_orgs, + update_enterprise_pricing_for_org, update_org, update_org_member, + update_org_privacy_settings, + update_org_saml_idp, ) from kittycad.api.payments import ( + create_org_subscription, create_payment_information_for_org, create_payment_information_for_user, create_payment_intent_for_org, create_payment_intent_for_user, + create_user_subscription, delete_payment_information_for_org, delete_payment_information_for_user, delete_payment_method_for_org, delete_payment_method_for_user, + get_org_subscription, + get_payment_balance_for_any_org, + get_payment_balance_for_any_user, get_payment_balance_for_org, get_payment_balance_for_user, get_payment_information_for_org, get_payment_information_for_user, + get_user_subscription, list_invoices_for_org, list_invoices_for_user, list_payment_methods_for_org, list_payment_methods_for_user, + update_org_subscription, + update_payment_balance_for_any_org, + update_payment_balance_for_any_user, update_payment_information_for_org, update_payment_information_for_user, + update_user_subscription, validate_customer_tax_information_for_org, validate_customer_tax_information_for_user, ) +from kittycad.api.service_accounts import ( + create_service_account_for_org, + delete_service_account_for_org, + get_service_account_for_org, + list_service_accounts_for_org, +) +from kittycad.api.store import create_store_coupon from kittycad.api.unit import ( get_angle_unit_conversion, get_area_unit_conversion, @@ -101,18 +136,22 @@ from kittycad.api.unit import ( ) from kittycad.api.users import ( delete_user_self, + get_oauth2_providers_for_user, get_session_for_user, get_user, get_user_extended, get_user_onboarding_self, + get_user_privacy_settings, get_user_self, get_user_self_extended, list_users, list_users_extended, + update_user_privacy_settings, update_user_self, ) from kittycad.client import ClientFromEnv from kittycad.models import ( + AccountProvider, AiPrompt, AiPromptResultsPage, ApiCallQueryGroup, @@ -125,6 +164,7 @@ from kittycad.models import ( CodeOutput, Customer, CustomerBalance, + DiscountCode, Error, ExtendedUser, ExtendedUserResultsPage, @@ -135,14 +175,21 @@ from kittycad.models import ( FileSurfaceArea, FileVolume, Invoice, + IpAddrInfo, + KclCodeCompletionResponse, Metadata, Onboarding, Org, OrgMember, OrgMemberResultsPage, + OrgResultsPage, PaymentIntent, PaymentMethod, Pong, + PrivacySettings, + SamlIdentityProvider, + ServiceAccount, + ServiceAccountResultsPage, Session, TextToCad, TextToCadResultsPage, @@ -162,8 +209,9 @@ from kittycad.models import ( User, UserOrgInfo, UserResultsPage, - VerificationToken, + VerificationTokenResponse, WebSocketRequest, + ZooProductSubscriptions, ) from kittycad.models.add_org_member import AddOrgMember from kittycad.models.ai_feedback import AiFeedback @@ -175,10 +223,22 @@ from kittycad.models.created_at_sort_mode import CreatedAtSortMode from kittycad.models.email_authentication_form import EmailAuthenticationForm from kittycad.models.file_export_format import FileExportFormat from kittycad.models.file_import_format import FileImportFormat +from kittycad.models.idp_metadata_source import base64_encoded_xml +from kittycad.models.kcl_code_completion_params import KclCodeCompletionParams +from kittycad.models.kcl_code_completion_request import KclCodeCompletionRequest +from kittycad.models.modeling_app_individual_subscription_tier import ( + ModelingAppIndividualSubscriptionTier, +) +from kittycad.models.modeling_app_organization_subscription_tier import ( + ModelingAppOrganizationSubscriptionTier, +) from kittycad.models.org_details import OrgDetails -from kittycad.models.org_role import OrgRole +from kittycad.models.plan_interval import PlanInterval from kittycad.models.rtc_sdp_type import RtcSdpType from kittycad.models.rtc_session_description import RtcSessionDescription +from kittycad.models.saml_identity_provider_create import SamlIdentityProviderCreate +from kittycad.models.store_coupon_params import StoreCouponParams +from kittycad.models.subscription_tier_price import per_user from kittycad.models.text_to_cad_create_body import TextToCadCreateBody from kittycad.models.unit_angle import UnitAngle from kittycad.models.unit_area import UnitArea @@ -195,9 +255,17 @@ from kittycad.models.unit_temperature import UnitTemperature from kittycad.models.unit_torque import UnitTorque from kittycad.models.unit_volume import UnitVolume from kittycad.models.update_member_to_org_body import UpdateMemberToOrgBody +from kittycad.models.update_payment_balance import UpdatePaymentBalance from kittycad.models.update_user import UpdateUser +from kittycad.models.user_org_role import UserOrgRole from kittycad.models.uuid import Uuid from kittycad.models.web_socket_request import sdp_offer +from kittycad.models.zoo_product_subscriptions_org_request import ( + ZooProductSubscriptionsOrgRequest, +) +from kittycad.models.zoo_product_subscriptions_user_request import ( + ZooProductSubscriptionsUserRequest, +) from kittycad.types import Response @@ -274,6 +342,47 @@ async def test_get_metadata_async(): ) +@pytest.mark.skip +def test_get_ipinfo(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[IpAddrInfo, Error]] = get_ipinfo.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: IpAddrInfo = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[Optional[Union[IpAddrInfo, Error]]] = get_ipinfo.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_ipinfo_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[IpAddrInfo, Error]] = await get_ipinfo.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[ + Optional[Union[IpAddrInfo, Error]] + ] = await get_ipinfo.asyncio_detailed( + client=client, + ) + + @pytest.mark.skip def test_list_ai_prompts(): # Create our client. @@ -374,6 +483,93 @@ async def test_get_ai_prompt_async(): ) +@pytest.mark.skip +def test_create_kcl_code_completions(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[KclCodeCompletionResponse, Error] + ] = create_kcl_code_completions.sync( + client=client, + body=KclCodeCompletionRequest( + extra=KclCodeCompletionParams( + language="", + trim_by_indentation=False, + ), + prompt="", + stop=[""], + stream=False, + suffix="", + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: KclCodeCompletionResponse = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[KclCodeCompletionResponse, Error]] + ] = create_kcl_code_completions.sync_detailed( + client=client, + body=KclCodeCompletionRequest( + extra=KclCodeCompletionParams( + language="", + trim_by_indentation=False, + ), + prompt="", + stop=[""], + stream=False, + suffix="", + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_create_kcl_code_completions_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[KclCodeCompletionResponse, Error] + ] = await create_kcl_code_completions.asyncio( + client=client, + body=KclCodeCompletionRequest( + extra=KclCodeCompletionParams( + language="", + trim_by_indentation=False, + ), + prompt="", + stop=[""], + stream=False, + suffix="", + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[KclCodeCompletionResponse, Error]] + ] = await create_kcl_code_completions.asyncio_detailed( + client=client, + body=KclCodeCompletionRequest( + extra=KclCodeCompletionParams( + language="", + trim_by_indentation=False, + ), + prompt="", + stop=[""], + stream=False, + suffix="", + ), + ) + + @pytest.mark.skip def test_create_text_to_cad(): # Create our client. @@ -878,7 +1074,7 @@ def test_auth_email(): # Create our client. client = ClientFromEnv() - result: Optional[Union[VerificationToken, Error]] = auth_email.sync( + result: Optional[Union[VerificationTokenResponse, Error]] = auth_email.sync( client=client, body=EmailAuthenticationForm( email="", @@ -889,12 +1085,12 @@ def test_auth_email(): print(result) raise Exception("Error in response") - body: VerificationToken = result + body: VerificationTokenResponse = result print(body) # OR if you need more info (e.g. status_code) response: Response[ - Optional[Union[VerificationToken, Error]] + Optional[Union[VerificationTokenResponse, Error]] ] = auth_email.sync_detailed( client=client, body=EmailAuthenticationForm( @@ -910,7 +1106,9 @@ async def test_auth_email_async(): # Create our client. client = ClientFromEnv() - result: Optional[Union[VerificationToken, Error]] = await auth_email.asyncio( + result: Optional[ + Union[VerificationTokenResponse, Error] + ] = await auth_email.asyncio( client=client, body=EmailAuthenticationForm( email="", @@ -919,7 +1117,7 @@ async def test_auth_email_async(): # OR run async with more info response: Response[ - Optional[Union[VerificationToken, Error]] + Optional[Union[VerificationTokenResponse, Error]] ] = await auth_email.asyncio_detailed( client=client, body=EmailAuthenticationForm( @@ -979,6 +1177,100 @@ async def test_auth_email_callback_async(): ) +@pytest.mark.skip +def test_get_auth_saml(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = get_auth_saml.sync( + client=client, + provider_id=Uuid(""), + callback_url=None, # Optional[str] + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[Optional[Error]] = get_auth_saml.sync_detailed( + client=client, + provider_id=Uuid(""), + callback_url=None, # Optional[str] + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_auth_saml_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = await get_auth_saml.asyncio( + client=client, + provider_id=Uuid(""), + callback_url=None, # Optional[str] + ) + + # OR run async with more info + response: Response[Optional[Error]] = await get_auth_saml.asyncio_detailed( + client=client, + provider_id=Uuid(""), + callback_url=None, # Optional[str] + ) + + +@pytest.mark.skip +def test_post_auth_saml(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = post_auth_saml.sync( + client=client, + provider_id=Uuid(""), + body=bytes("some bytes", "utf-8"), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[Optional[Error]] = post_auth_saml.sync_detailed( + client=client, + provider_id=Uuid(""), + body=bytes("some bytes", "utf-8"), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_post_auth_saml_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = await post_auth_saml.asyncio( + client=client, + provider_id=Uuid(""), + body=bytes("some bytes", "utf-8"), + ) + + # OR run async with more info + response: Response[Optional[Error]] = await post_auth_saml.asyncio_detailed( + client=client, + provider_id=Uuid(""), + body=bytes("some bytes", "utf-8"), + ) + + @pytest.mark.skip def test_create_file_center_of_mass(): # Create our client. @@ -1788,7 +2080,7 @@ def test_list_org_members(): result: Optional[Union[OrgMemberResultsPage, Error]] = list_org_members.sync( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, limit=None, # Optional[int] page_token=None, # Optional[str] ) @@ -1806,7 +2098,7 @@ def test_list_org_members(): ] = list_org_members.sync_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, limit=None, # Optional[int] page_token=None, # Optional[str] ) @@ -1824,7 +2116,7 @@ async def test_list_org_members_async(): ] = await list_org_members.asyncio( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, limit=None, # Optional[int] page_token=None, # Optional[str] ) @@ -1835,7 +2127,7 @@ async def test_list_org_members_async(): ] = await list_org_members.asyncio_detailed( client=client, sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, limit=None, # Optional[int] page_token=None, # Optional[str] ) @@ -1850,7 +2142,7 @@ def test_create_org_member(): client=client, body=AddOrgMember( email="", - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -1868,7 +2160,7 @@ def test_create_org_member(): client=client, body=AddOrgMember( email="", - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -1884,7 +2176,7 @@ async def test_create_org_member_async(): client=client, body=AddOrgMember( email="", - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -1895,7 +2187,7 @@ async def test_create_org_member_async(): client=client, body=AddOrgMember( email="", - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -1956,7 +2248,7 @@ def test_update_org_member(): client=client, user_id=Uuid(""), body=UpdateMemberToOrgBody( - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -1974,7 +2266,7 @@ def test_update_org_member(): client=client, user_id=Uuid(""), body=UpdateMemberToOrgBody( - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -1990,7 +2282,7 @@ async def test_update_org_member_async(): client=client, user_id=Uuid(""), body=UpdateMemberToOrgBody( - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -2001,7 +2293,7 @@ async def test_update_org_member_async(): client=client, user_id=Uuid(""), body=UpdateMemberToOrgBody( - role=OrgRole.ADMIN, + role=UserOrgRole.ADMIN, ), ) @@ -2484,6 +2776,169 @@ async def test_delete_payment_method_for_org_async(): ) +@pytest.mark.skip +def test_get_org_subscription(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[ZooProductSubscriptions, Error]] = get_org_subscription.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ZooProductSubscriptions = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = get_org_subscription.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_org_subscription_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = await get_org_subscription.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = await get_org_subscription.asyncio_detailed( + client=client, + ) + + +@pytest.mark.skip +def test_update_org_subscription(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = update_org_subscription.sync( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ZooProductSubscriptions = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = update_org_subscription.sync_detailed( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_org_subscription_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = await update_org_subscription.asyncio( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = await update_org_subscription.asyncio_detailed( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + +@pytest.mark.skip +def test_create_org_subscription(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = create_org_subscription.sync( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ZooProductSubscriptions = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = create_org_subscription.sync_detailed( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_create_org_subscription_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = await create_org_subscription.asyncio( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = await create_org_subscription.asyncio_detailed( + client=client, + body=ZooProductSubscriptionsOrgRequest( + modeling_app=ModelingAppOrganizationSubscriptionTier.TEAM, + ), + ) + + @pytest.mark.skip def test_validate_customer_tax_information_for_org(): # Create our client. @@ -2527,6 +2982,815 @@ async def test_validate_customer_tax_information_for_org_async(): ) +@pytest.mark.skip +def test_get_org_privacy_settings(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[PrivacySettings, Error]] = get_org_privacy_settings.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: PrivacySettings = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = get_org_privacy_settings.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_org_privacy_settings_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[PrivacySettings, Error] + ] = await get_org_privacy_settings.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = await get_org_privacy_settings.asyncio_detailed( + client=client, + ) + + +@pytest.mark.skip +def test_update_org_privacy_settings(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[PrivacySettings, Error]] = update_org_privacy_settings.sync( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: PrivacySettings = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = update_org_privacy_settings.sync_detailed( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_org_privacy_settings_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[PrivacySettings, Error] + ] = await update_org_privacy_settings.asyncio( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = await update_org_privacy_settings.asyncio_detailed( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + +@pytest.mark.skip +def test_get_org_saml_idp(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[SamlIdentityProvider, Error]] = get_org_saml_idp.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: SamlIdentityProvider = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[SamlIdentityProvider, Error]] + ] = get_org_saml_idp.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_org_saml_idp_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[SamlIdentityProvider, Error] + ] = await get_org_saml_idp.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[ + Optional[Union[SamlIdentityProvider, Error]] + ] = await get_org_saml_idp.asyncio_detailed( + client=client, + ) + + +@pytest.mark.skip +def test_update_org_saml_idp(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[SamlIdentityProvider, Error]] = update_org_saml_idp.sync( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: SamlIdentityProvider = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[SamlIdentityProvider, Error]] + ] = update_org_saml_idp.sync_detailed( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_org_saml_idp_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[SamlIdentityProvider, Error] + ] = await update_org_saml_idp.asyncio( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[SamlIdentityProvider, Error]] + ] = await update_org_saml_idp.asyncio_detailed( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + +@pytest.mark.skip +def test_create_org_saml_idp(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[SamlIdentityProvider, Error]] = create_org_saml_idp.sync( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: SamlIdentityProvider = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[SamlIdentityProvider, Error]] + ] = create_org_saml_idp.sync_detailed( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_create_org_saml_idp_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[SamlIdentityProvider, Error] + ] = await create_org_saml_idp.asyncio( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[SamlIdentityProvider, Error]] + ] = await create_org_saml_idp.asyncio_detailed( + client=client, + body=SamlIdentityProviderCreate( + idp_entity_id="", + idp_metadata_source=base64_encoded_xml( + data="", + ), + technical_contact_email="", + ), + ) + + +@pytest.mark.skip +def test_delete_org_saml_idp(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = delete_org_saml_idp.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[Optional[Error]] = delete_org_saml_idp.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_delete_org_saml_idp_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = await delete_org_saml_idp.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[Optional[Error]] = await delete_org_saml_idp.asyncio_detailed( + client=client, + ) + + +@pytest.mark.skip +def test_list_service_accounts_for_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ServiceAccountResultsPage, Error] + ] = list_service_accounts_for_org.sync( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ServiceAccountResultsPage = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ServiceAccountResultsPage, Error]] + ] = list_service_accounts_for_org.sync_detailed( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_list_service_accounts_for_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ServiceAccountResultsPage, Error] + ] = await list_service_accounts_for_org.asyncio( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + # OR run async with more info + response: Response[ + Optional[Union[ServiceAccountResultsPage, Error]] + ] = await list_service_accounts_for_org.asyncio_detailed( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + +@pytest.mark.skip +def test_create_service_account_for_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ServiceAccount, Error] + ] = create_service_account_for_org.sync( + client=client, + label=None, # Optional[str] + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ServiceAccount = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ServiceAccount, Error]] + ] = create_service_account_for_org.sync_detailed( + client=client, + label=None, # Optional[str] + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_create_service_account_for_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ServiceAccount, Error] + ] = await create_service_account_for_org.asyncio( + client=client, + label=None, # Optional[str] + ) + + # OR run async with more info + response: Response[ + Optional[Union[ServiceAccount, Error]] + ] = await create_service_account_for_org.asyncio_detailed( + client=client, + label=None, # Optional[str] + ) + + +@pytest.mark.skip +def test_get_service_account_for_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[ServiceAccount, Error]] = get_service_account_for_org.sync( + client=client, + token="", + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ServiceAccount = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ServiceAccount, Error]] + ] = get_service_account_for_org.sync_detailed( + client=client, + token="", + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_service_account_for_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ServiceAccount, Error] + ] = await get_service_account_for_org.asyncio( + client=client, + token="", + ) + + # OR run async with more info + response: Response[ + Optional[Union[ServiceAccount, Error]] + ] = await get_service_account_for_org.asyncio_detailed( + client=client, + token="", + ) + + +@pytest.mark.skip +def test_delete_service_account_for_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = delete_service_account_for_org.sync( + client=client, + token="", + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Error = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[Optional[Error]] = delete_service_account_for_org.sync_detailed( + client=client, + token="", + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_delete_service_account_for_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Error] = await delete_service_account_for_org.asyncio( + client=client, + token="", + ) + + # OR run async with more info + response: Response[ + Optional[Error] + ] = await delete_service_account_for_org.asyncio_detailed( + client=client, + token="", + ) + + +@pytest.mark.skip +def test_list_orgs(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[OrgResultsPage, Error]] = list_orgs.sync( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: OrgResultsPage = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[OrgResultsPage, Error]] + ] = list_orgs.sync_detailed( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_list_orgs_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[OrgResultsPage, Error]] = await list_orgs.asyncio( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + # OR run async with more info + response: Response[ + Optional[Union[OrgResultsPage, Error]] + ] = await list_orgs.asyncio_detailed( + client=client, + sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING, + limit=None, # Optional[int] + page_token=None, # Optional[str] + ) + + +@pytest.mark.skip +def test_get_any_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[Org, Error]] = get_any_org.sync( + client=client, + id=Uuid(""), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: Org = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[Optional[Union[Org, Error]]] = get_any_org.sync_detailed( + client=client, + id=Uuid(""), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_any_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[Org, Error]] = await get_any_org.asyncio( + client=client, + id=Uuid(""), + ) + + # OR run async with more info + response: Response[ + Optional[Union[Org, Error]] + ] = await get_any_org.asyncio_detailed( + client=client, + id=Uuid(""), + ) + + +@pytest.mark.skip +def test_update_enterprise_pricing_for_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = update_enterprise_pricing_for_org.sync( + client=client, + id=Uuid(""), + body=per_user( + interval=PlanInterval.DAY, + price=3.14, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ZooProductSubscriptions = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = update_enterprise_pricing_for_org.sync_detailed( + client=client, + id=Uuid(""), + body=per_user( + interval=PlanInterval.DAY, + price=3.14, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_enterprise_pricing_for_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = await update_enterprise_pricing_for_org.asyncio( + client=client, + id=Uuid(""), + body=per_user( + interval=PlanInterval.DAY, + price=3.14, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = await update_enterprise_pricing_for_org.asyncio_detailed( + client=client, + id=Uuid(""), + body=per_user( + interval=PlanInterval.DAY, + price=3.14, + ), + ) + + +@pytest.mark.skip +def test_get_payment_balance_for_any_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = get_payment_balance_for_any_org.sync( + client=client, + id=Uuid(""), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: CustomerBalance = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = get_payment_balance_for_any_org.sync_detailed( + client=client, + id=Uuid(""), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_payment_balance_for_any_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = await get_payment_balance_for_any_org.asyncio( + client=client, + id=Uuid(""), + ) + + # OR run async with more info + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = await get_payment_balance_for_any_org.asyncio_detailed( + client=client, + id=Uuid(""), + ) + + +@pytest.mark.skip +def test_update_payment_balance_for_any_org(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = update_payment_balance_for_any_org.sync( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: CustomerBalance = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = update_payment_balance_for_any_org.sync_detailed( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_payment_balance_for_any_org_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = await update_payment_balance_for_any_org.asyncio( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + # OR run async with more info + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = await update_payment_balance_for_any_org.asyncio_detailed( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + @pytest.mark.skip def test_ping(): # Create our client. @@ -2566,6 +3830,93 @@ async def test_ping_async(): ) +@pytest.mark.skip +def test_get_pricing_subscriptions(): + # Create our client. + client = ClientFromEnv() + + get_pricing_subscriptions.sync( + client=client, + ) + + # OR if you need more info (e.g. status_code) + get_pricing_subscriptions.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_pricing_subscriptions_async(): + # Create our client. + client = ClientFromEnv() + + await get_pricing_subscriptions.asyncio( + client=client, + ) + + # OR run async with more info + await get_pricing_subscriptions.asyncio_detailed( + client=client, + ) + + +@pytest.mark.skip +def test_create_store_coupon(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[DiscountCode, Error]] = create_store_coupon.sync( + client=client, + body=StoreCouponParams( + percent_off=10, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: DiscountCode = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[DiscountCode, Error]] + ] = create_store_coupon.sync_detailed( + client=client, + body=StoreCouponParams( + percent_off=10, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_create_store_coupon_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[DiscountCode, Error]] = await create_store_coupon.asyncio( + client=client, + body=StoreCouponParams( + percent_off=10, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[DiscountCode, Error]] + ] = await create_store_coupon.asyncio_detailed( + client=client, + body=StoreCouponParams( + percent_off=10, + ), + ) + + @pytest.mark.skip def test_get_angle_unit_conversion(): # Create our client. @@ -3382,6 +4733,7 @@ def test_update_user_self(): discord="", first_name="", github="", + image="", last_name="", phone="", ), @@ -3402,6 +4754,7 @@ def test_update_user_self(): discord="", first_name="", github="", + image="", last_name="", phone="", ), @@ -3422,6 +4775,7 @@ async def test_update_user_self_async(): discord="", first_name="", github="", + image="", last_name="", phone="", ), @@ -3437,6 +4791,7 @@ async def test_update_user_self_async(): discord="", first_name="", github="", + image="", last_name="", phone="", ), @@ -3829,6 +5184,53 @@ async def test_get_user_self_extended_async(): ) +@pytest.mark.skip +def test_get_oauth2_providers_for_user(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[List[AccountProvider], Error] + ] = get_oauth2_providers_for_user.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: List[AccountProvider] = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[List[AccountProvider], Error]] + ] = get_oauth2_providers_for_user.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_oauth2_providers_for_user_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[List[AccountProvider], Error] + ] = await get_oauth2_providers_for_user.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[ + Optional[Union[List[AccountProvider], Error]] + ] = await get_oauth2_providers_for_user.asyncio_detailed( + client=client, + ) + + @pytest.mark.skip def test_get_user_onboarding_self(): # Create our client. @@ -4352,6 +5754,171 @@ async def test_delete_payment_method_for_user_async(): ) +@pytest.mark.skip +def test_get_user_subscription(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = get_user_subscription.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ZooProductSubscriptions = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = get_user_subscription.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_user_subscription_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = await get_user_subscription.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = await get_user_subscription.asyncio_detailed( + client=client, + ) + + +@pytest.mark.skip +def test_update_user_subscription(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = update_user_subscription.sync( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ZooProductSubscriptions = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = update_user_subscription.sync_detailed( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_user_subscription_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = await update_user_subscription.asyncio( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = await update_user_subscription.asyncio_detailed( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + +@pytest.mark.skip +def test_create_user_subscription(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = create_user_subscription.sync( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: ZooProductSubscriptions = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = create_user_subscription.sync_detailed( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_create_user_subscription_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[ZooProductSubscriptions, Error] + ] = await create_user_subscription.asyncio( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[ZooProductSubscriptions, Error]] + ] = await create_user_subscription.asyncio_detailed( + client=client, + body=ZooProductSubscriptionsUserRequest( + modeling_app=ModelingAppIndividualSubscriptionTier.FREE, + ), + ) + + @pytest.mark.skip def test_validate_customer_tax_information_for_user(): # Create our client. @@ -4395,6 +5962,108 @@ async def test_validate_customer_tax_information_for_user_async(): ) +@pytest.mark.skip +def test_get_user_privacy_settings(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[PrivacySettings, Error]] = get_user_privacy_settings.sync( + client=client, + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: PrivacySettings = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = get_user_privacy_settings.sync_detailed( + client=client, + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_user_privacy_settings_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[PrivacySettings, Error] + ] = await get_user_privacy_settings.asyncio( + client=client, + ) + + # OR run async with more info + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = await get_user_privacy_settings.asyncio_detailed( + client=client, + ) + + +@pytest.mark.skip +def test_update_user_privacy_settings(): + # Create our client. + client = ClientFromEnv() + + result: Optional[Union[PrivacySettings, Error]] = update_user_privacy_settings.sync( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: PrivacySettings = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = update_user_privacy_settings.sync_detailed( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_user_privacy_settings_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[PrivacySettings, Error] + ] = await update_user_privacy_settings.asyncio( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + # OR run async with more info + response: Response[ + Optional[Union[PrivacySettings, Error]] + ] = await update_user_privacy_settings.asyncio_detailed( + client=client, + body=PrivacySettings( + can_train_on_data=False, + ), + ) + + @pytest.mark.skip def test_get_session_for_user(): # Create our client. @@ -4870,6 +6539,112 @@ async def test_list_api_calls_for_user_async(): ) +@pytest.mark.skip +def test_get_payment_balance_for_any_user(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = get_payment_balance_for_any_user.sync( + client=client, + id=Uuid(""), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: CustomerBalance = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = get_payment_balance_for_any_user.sync_detailed( + client=client, + id=Uuid(""), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_get_payment_balance_for_any_user_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = await get_payment_balance_for_any_user.asyncio( + client=client, + id=Uuid(""), + ) + + # OR run async with more info + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = await get_payment_balance_for_any_user.asyncio_detailed( + client=client, + id=Uuid(""), + ) + + +@pytest.mark.skip +def test_update_payment_balance_for_any_user(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = update_payment_balance_for_any_user.sync( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + if isinstance(result, Error) or result is None: + print(result) + raise Exception("Error in response") + + body: CustomerBalance = result + print(body) + + # OR if you need more info (e.g. status_code) + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = update_payment_balance_for_any_user.sync_detailed( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + +# OR run async +@pytest.mark.asyncio +@pytest.mark.skip +async def test_update_payment_balance_for_any_user_async(): + # Create our client. + client = ClientFromEnv() + + result: Optional[ + Union[CustomerBalance, Error] + ] = await update_payment_balance_for_any_user.asyncio( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + # OR run async with more info + response: Response[ + Optional[Union[CustomerBalance, Error]] + ] = await update_payment_balance_for_any_user.asyncio_detailed( + client=client, + id=Uuid(""), + body=UpdatePaymentBalance(), + ) + + @pytest.mark.skip def test_create_executor_term(): # Create our client. diff --git a/kittycad/models/__init__.py b/kittycad/models/__init__.py index e7956f3ff..cb7e36580 100644 --- a/kittycad/models/__init__.py +++ b/kittycad/models/__init__.py @@ -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 diff --git a/kittycad/models/account_provider.py b/kittycad/models/account_provider.py index 0a31c45e0..217acb280 100644 --- a/kittycad/models/account_provider.py +++ b/kittycad/models/account_provider.py @@ -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) diff --git a/kittycad/models/add_org_member.py b/kittycad/models/add_org_member.py index a93686c00..8a053a165 100644 --- a/kittycad/models/add_org_member.py +++ b/kittycad/models/add_org_member.py @@ -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=()) diff --git a/kittycad/models/auth_callback.py b/kittycad/models/auth_callback.py new file mode 100644 index 000000000..2ce984f2f --- /dev/null +++ b/kittycad/models/auth_callback.py @@ -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=()) diff --git a/kittycad/models/customer_balance.py b/kittycad/models/customer_balance.py index ea7dc277e..07294edc4 100644 --- a/kittycad/models/customer_balance.py +++ b/kittycad/models/customer_balance.py @@ -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 diff --git a/kittycad/models/der_encoded_key_pair.py b/kittycad/models/der_encoded_key_pair.py new file mode 100644 index 000000000..714d40f86 --- /dev/null +++ b/kittycad/models/der_encoded_key_pair.py @@ -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=()) diff --git a/kittycad/models/discount_code.py b/kittycad/models/discount_code.py new file mode 100644 index 000000000..44c8fa76b --- /dev/null +++ b/kittycad/models/discount_code.py @@ -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=()) diff --git a/kittycad/models/entity_circular_pattern.py b/kittycad/models/entity_circular_pattern.py new file mode 100644 index 000000000..c752a36b6 --- /dev/null +++ b/kittycad/models/entity_circular_pattern.py @@ -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=()) diff --git a/kittycad/models/entity_get_distance.py b/kittycad/models/entity_get_distance.py index a64187b48..444db174e 100644 --- a/kittycad/models/entity_get_distance.py +++ b/kittycad/models/entity_get_distance.py @@ -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=()) diff --git a/kittycad/models/extended_user.py b/kittycad/models/extended_user.py index d24a0d9e2..72d9a3522 100644 --- a/kittycad/models/extended_user.py +++ b/kittycad/models/extended_user.py @@ -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 diff --git a/kittycad/models/extrusion_face_cap_type.py b/kittycad/models/extrusion_face_cap_type.py new file mode 100644 index 000000000..aa214cf8b --- /dev/null +++ b/kittycad/models/extrusion_face_cap_type.py @@ -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) diff --git a/kittycad/models/extrusion_face_info.py b/kittycad/models/extrusion_face_info.py new file mode 100644 index 000000000..1a58a8d1f --- /dev/null +++ b/kittycad/models/extrusion_face_info.py @@ -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=()) diff --git a/kittycad/models/global_axis.py b/kittycad/models/global_axis.py index 1ca303196..0cbe48686 100644 --- a/kittycad/models/global_axis.py +++ b/kittycad/models/global_axis.py @@ -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" diff --git a/kittycad/models/idp_metadata_source.py b/kittycad/models/idp_metadata_source.py new file mode 100644 index 000000000..14590a1ca --- /dev/null +++ b/kittycad/models/idp_metadata_source.py @@ -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"), + ] +] diff --git a/kittycad/models/import_file.py b/kittycad/models/import_file.py index 5a6a76a97..8cbc37c8c 100644 --- a/kittycad/models/import_file.py +++ b/kittycad/models/import_file.py @@ -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 diff --git a/kittycad/models/ip_addr_info.py b/kittycad/models/ip_addr_info.py new file mode 100644 index 000000000..1febfa1a6 --- /dev/null +++ b/kittycad/models/ip_addr_info.py @@ -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=()) diff --git a/kittycad/models/kcl_code_completion_params.py b/kittycad/models/kcl_code_completion_params.py new file mode 100644 index 000000000..8e3990741 --- /dev/null +++ b/kittycad/models/kcl_code_completion_params.py @@ -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=()) diff --git a/kittycad/models/kcl_code_completion_request.py b/kittycad/models/kcl_code_completion_request.py new file mode 100644 index 000000000..5d5da533e --- /dev/null +++ b/kittycad/models/kcl_code_completion_request.py @@ -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=()) diff --git a/kittycad/models/kcl_code_completion_response.py b/kittycad/models/kcl_code_completion_response.py new file mode 100644 index 000000000..5e3b10e64 --- /dev/null +++ b/kittycad/models/kcl_code_completion_response.py @@ -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=()) diff --git a/kittycad/models/length_unit.py b/kittycad/models/length_unit.py new file mode 100644 index 000000000..c77f0c184 --- /dev/null +++ b/kittycad/models/length_unit.py @@ -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)) diff --git a/kittycad/models/modeling_app_individual_subscription_tier.py b/kittycad/models/modeling_app_individual_subscription_tier.py new file mode 100644 index 000000000..6b20b2c72 --- /dev/null +++ b/kittycad/models/modeling_app_individual_subscription_tier.py @@ -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) diff --git a/kittycad/models/modeling_app_organization_subscription_tier.py b/kittycad/models/modeling_app_organization_subscription_tier.py new file mode 100644 index 000000000..d8ba69f57 --- /dev/null +++ b/kittycad/models/modeling_app_organization_subscription_tier.py @@ -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) diff --git a/kittycad/models/modeling_app_subscription_tier.py b/kittycad/models/modeling_app_subscription_tier.py new file mode 100644 index 000000000..69e64e9dd --- /dev/null +++ b/kittycad/models/modeling_app_subscription_tier.py @@ -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=()) diff --git a/kittycad/models/modeling_app_subscription_tier_name.py b/kittycad/models/modeling_app_subscription_tier_name.py new file mode 100644 index 000000000..1380d9dd0 --- /dev/null +++ b/kittycad/models/modeling_app_subscription_tier_name.py @@ -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) diff --git a/kittycad/models/modeling_cmd.py b/kittycad/models/modeling_cmd.py index d5b622d44..e931de36b 100644 --- a/kittycad/models/modeling_cmd.py +++ b/kittycad/models/modeling_cmd.py @@ -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"), ] diff --git a/kittycad/models/ok_modeling_cmd_response.py b/kittycad/models/ok_modeling_cmd_response.py index b538e1ffc..34e414dba 100644 --- a/kittycad/models/ok_modeling_cmd_response.py +++ b/kittycad/models/ok_modeling_cmd_response.py @@ -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"), ] diff --git a/kittycad/models/org.py b/kittycad/models/org.py index eee4da533..a6df7bef6 100644 --- a/kittycad/models/org.py +++ b/kittycad/models/org.py @@ -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 diff --git a/kittycad/models/org_results_page.py b/kittycad/models/org_results_page.py new file mode 100644 index 000000000..264565b2c --- /dev/null +++ b/kittycad/models/org_results_page.py @@ -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=()) diff --git a/kittycad/models/org_role.py b/kittycad/models/org_role.py index a1e0aa151..3e7c78de3 100644 --- a/kittycad/models/org_role.py +++ b/kittycad/models/org_role.py @@ -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) diff --git a/kittycad/models/path_segment.py b/kittycad/models/path_segment.py index ccddb809b..b779391ed 100644 --- a/kittycad/models/path_segment.py +++ b/kittycad/models/path_segment.py @@ -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" diff --git a/kittycad/models/plan_interval.py b/kittycad/models/plan_interval.py new file mode 100644 index 000000000..b84f06364 --- /dev/null +++ b/kittycad/models/plan_interval.py @@ -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) diff --git a/kittycad/models/point2d.py b/kittycad/models/point2d.py index 181554b74..dde8f2059 100644 --- a/kittycad/models/point2d.py +++ b/kittycad/models/point2d.py @@ -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=()) diff --git a/kittycad/models/privacy_settings.py b/kittycad/models/privacy_settings.py new file mode 100644 index 000000000..25f991e15 --- /dev/null +++ b/kittycad/models/privacy_settings.py @@ -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=()) diff --git a/kittycad/models/saml_identity_provider.py b/kittycad/models/saml_identity_provider.py new file mode 100644 index 000000000..3bb7d19a4 --- /dev/null +++ b/kittycad/models/saml_identity_provider.py @@ -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=()) diff --git a/kittycad/models/saml_identity_provider_create.py b/kittycad/models/saml_identity_provider_create.py new file mode 100644 index 000000000..196c107b9 --- /dev/null +++ b/kittycad/models/saml_identity_provider_create.py @@ -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=()) diff --git a/kittycad/models/service_account.py b/kittycad/models/service_account.py new file mode 100644 index 000000000..6413775a6 --- /dev/null +++ b/kittycad/models/service_account.py @@ -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=()) diff --git a/kittycad/models/service_account_results_page.py b/kittycad/models/service_account_results_page.py new file mode 100644 index 000000000..a6ea47127 --- /dev/null +++ b/kittycad/models/service_account_results_page.py @@ -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=()) diff --git a/kittycad/models/session.py b/kittycad/models/session.py index 5f749c4bd..ef3a1e04b 100644 --- a/kittycad/models/session.py +++ b/kittycad/models/session.py @@ -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 diff --git a/kittycad/models/solid3d_get_extrusion_face_info.py b/kittycad/models/solid3d_get_extrusion_face_info.py new file mode 100644 index 000000000..ae2f99716 --- /dev/null +++ b/kittycad/models/solid3d_get_extrusion_face_info.py @@ -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=()) diff --git a/kittycad/models/store_coupon_params.py b/kittycad/models/store_coupon_params.py new file mode 100644 index 000000000..70d2e5749 --- /dev/null +++ b/kittycad/models/store_coupon_params.py @@ -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=()) diff --git a/kittycad/models/subscription_tier_feature.py b/kittycad/models/subscription_tier_feature.py new file mode 100644 index 000000000..08a84bc21 --- /dev/null +++ b/kittycad/models/subscription_tier_feature.py @@ -0,0 +1,11 @@ + +from pydantic import BaseModel, ConfigDict + + + +class SubscriptionTierFeature(BaseModel): + """A subscription tier feature.""" + + info: str + + model_config = ConfigDict(protected_namespaces=()) diff --git a/kittycad/models/subscription_tier_price.py b/kittycad/models/subscription_tier_price.py new file mode 100644 index 000000000..9905f0e80 --- /dev/null +++ b/kittycad/models/subscription_tier_price.py @@ -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"), + ] +] diff --git a/kittycad/models/subscription_tier_type.py b/kittycad/models/subscription_tier_type.py new file mode 100644 index 000000000..4b5d81253 --- /dev/null +++ b/kittycad/models/subscription_tier_type.py @@ -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"), + ] +] diff --git a/kittycad/models/subscription_training_data_behavior.py b/kittycad/models/subscription_training_data_behavior.py new file mode 100644 index 000000000..b7ecc3e56 --- /dev/null +++ b/kittycad/models/subscription_training_data_behavior.py @@ -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) diff --git a/kittycad/models/support_tier.py b/kittycad/models/support_tier.py new file mode 100644 index 000000000..000b3dfd2 --- /dev/null +++ b/kittycad/models/support_tier.py @@ -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) diff --git a/kittycad/models/update_member_to_org_body.py b/kittycad/models/update_member_to_org_body.py index 8fafd2fc6..879c19c49 100644 --- a/kittycad/models/update_member_to_org_body.py +++ b/kittycad/models/update_member_to_org_body.py @@ -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=()) diff --git a/kittycad/models/update_payment_balance.py b/kittycad/models/update_payment_balance.py new file mode 100644 index 000000000..b8a24f75a --- /dev/null +++ b/kittycad/models/update_payment_balance.py @@ -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=()) diff --git a/kittycad/models/update_user.py b/kittycad/models/update_user.py index 6ec4a8009..a55d0c91b 100644 --- a/kittycad/models/update_user.py +++ b/kittycad/models/update_user.py @@ -15,6 +15,8 @@ class UpdateUser(BaseModel): github: Optional[str] = None + image: str + last_name: Optional[str] = None phone: Optional[str] = None diff --git a/kittycad/models/user.py b/kittycad/models/user.py index 084db5d04..5bc677b6e 100644 --- a/kittycad/models/user.py +++ b/kittycad/models/user.py @@ -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 diff --git a/kittycad/models/user_org_role.py b/kittycad/models/user_org_role.py new file mode 100644 index 000000000..ac9aa942b --- /dev/null +++ b/kittycad/models/user_org_role.py @@ -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) diff --git a/kittycad/models/verification_token.py b/kittycad/models/verification_token_response.py similarity index 70% rename from kittycad/models/verification_token.py rename to kittycad/models/verification_token_response.py index f05a2f6c1..1ca1fa64e 100644 --- a/kittycad/models/verification_token.py +++ b/kittycad/models/verification_token_response.py @@ -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=()) diff --git a/kittycad/models/zoo_product_subscription.py b/kittycad/models/zoo_product_subscription.py new file mode 100644 index 000000000..601fedb25 --- /dev/null +++ b/kittycad/models/zoo_product_subscription.py @@ -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,]] diff --git a/kittycad/models/zoo_product_subscriptions.py b/kittycad/models/zoo_product_subscriptions.py new file mode 100644 index 000000000..58d1673f8 --- /dev/null +++ b/kittycad/models/zoo_product_subscriptions.py @@ -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=()) diff --git a/kittycad/models/zoo_product_subscriptions_org_request.py b/kittycad/models/zoo_product_subscriptions_org_request.py new file mode 100644 index 000000000..89289cb04 --- /dev/null +++ b/kittycad/models/zoo_product_subscriptions_org_request.py @@ -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=()) diff --git a/kittycad/models/zoo_product_subscriptions_user_request.py b/kittycad/models/zoo_product_subscriptions_user_request.py new file mode 100644 index 000000000..7c754f9f0 --- /dev/null +++ b/kittycad/models/zoo_product_subscriptions_user_request.py @@ -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=()) diff --git a/kittycad/models/zoo_tool.py b/kittycad/models/zoo_tool.py new file mode 100644 index 000000000..a7d3c5943 --- /dev/null +++ b/kittycad/models/zoo_tool.py @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 5b89ca8be..27bb79cd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "kittycad" -version = "0.6.5" +version = "0.6.6" description = "A client library for accessing KittyCAD" authors = [] @@ -84,6 +84,8 @@ combine_as_imports = true [tool.ruff] line-length = 88 + +[tool.ruff.lint] # Since we auto fix these, we don't want to warn about them. Since some doc strings are too long. ignore = ["E501"] # Allow autofix for all enabled rules (when `--fix`) is provided. @@ -92,7 +94,7 @@ unfixable = [] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # We exclude init files since otherwise ruff will delete all the unused imports. # This code comes from here: https://beta.ruff.rs/docs/rules/#pyflakes-f "__init__.py" = ["F401"]